예스스탁
예스스탁 답변
2020-07-14 09:06:44
안녕하세요
예스스탁입니다.
Input : 단기(5), 장기(20), profit_pt(0.5), loss_pt(0.5), 장종료청산(151000),진입횟수(3);
Variable : ent_position(0),entry(0);
if MarketPosition == 0 Then{
var1 = 0;
ent_position = 0;
entry = 0;
}
if (MarketPosition != 0 and MarketPosition != MarketPosition[1]) or
(MarketPosition == MarketPosition[1] and TotalTrades > TotalTrades[1]) then
entry = entry+1;
//If ma(C,단기)>ma(C,장기) and ( C>O and L==O ) or ( C[1]<O[1] and H[1]==O[1] and C>O ) Then {
If ma(C,단기)>ma(C,장기) and ( C>O and L==O ) and ent_position == 0 and entry < 진입횟수 Then {
Buy("매수",AtMarket);
Var1 = NextBarOpen;
ent_position = 1;
}
//If ma(C,단기)<ma(C,장기) and ( C<O and H==O ) or ( C[1]>O[1] and L[1]==O[1] and C<O ) Then {
If ma(C,단기)<ma(C,장기) and ( C<O and H==O ) and ent_position == 0 and entry < 진입횟수 Then {
Sell("매도",AtMarket);
Var1 = NextBarOpen;
ent_position = -1;
}
if PositionProfit >= profit_pt and ent_position<>0 Then{
if ent_position == 1 and C<O Then {
ExitLong("매수청산");
}
if ent_position == -1 and C>O Then {
ExitLong("매도청산");
}
}
SetStopLoss(loss_pt,PointStop);
SetStopEndofday(장종료청산);
즐거운 하루되세요
> 대구어린울프 님이 쓴 글입니다.
> 제목 : 수정부탁드립니다.
> 안녕하세요? 아래와같은 답변 감사히 잘받았습니다.
매매횟수가 적용이안되서 죄송하지만 한번더 검토 부탁드리겠습니다.
횟수에 1회~5회까지 다양하게 적용해봤는데 훨씬많이 나오는 증상입니다.
부탁드리겠습니다. 감사합니다.
안녕하세요
예스스탁입니다.
Input : 단기(5), 장기(20), profit_pt(0.5), loss_pt(0.5), 장종료청산(151000),진입횟수(3);
Variable : ent_position(0),entry(0);
if MarketPosition == 0 Then{
var1 = 0;
ent_position = 0;
entry = 0;
}
if (MarketPosition != 0 and MarketPosition != MarketPosition[1]) or
(MarketPosition != MarketPosition[1] and TotalTrades > TotalTrades[1]) then
entry = entry+1;
//If ma(C,단기)>ma(C,장기) and ( C>O and L==O ) or ( C[1]<O[1] and H[1]==O[1] and C>O ) Then {
If ma(C,단기)>ma(C,장기) and ( C>O and L==O ) and ent_position == 0 and entry < 진입횟수 Then {
Buy("매수",AtMarket);
Var1 = NextBarOpen;
ent_position = 1;
}
//If ma(C,단기)<ma(C,장기) and ( C<O and H==O ) or ( C[1]>O[1] and L[1]==O[1] and C<O ) Then {
If ma(C,단기)<ma(C,장기) and ( C<O and H==O ) and ent_position == 0 and entry < 진입횟수 Then {
Sell("매도",AtMarket);
Var1 = NextBarOpen;
ent_position = -1;
}
if PositionProfit >= profit_pt and ent_position<>0 Then{
if ent_position == 1 and C<O Then {
ExitLong("매수청산");
}
if ent_position == -1 and C>O Then {
ExitLong("매도청산");
}
}
SetStopLoss(loss_pt,PointStop);
SetStopEndofday(장종료청산);
즐거운 하루되세요
> 대구어린울프 님이 쓴 글입니다.
> 제목 : 수정 부탁드립니다.
> 안녕하세요?
아래의 수식에서 하루매매횟를 외부변수로 넣고싶습니다.
부탁드립니다.
감사합니다.
Input : 단기(5), 장기(20), profit_pt(0.5), loss_pt(0.5), 장종료청산(151000);
Variable : ent_position(0);
if MarketPosition == 0 Then{
var1 = 0;
ent_position = 0;
}
//If ma(C,단기)>ma(C,장기) and ( C>O and L==O ) or ( C[1]<O[1] and H[1]==O[1] and C>O ) Then {
If ma(C,단기)>ma(C,장기) and ( C>O and L==O ) and ent_position == 0 Then {
Buy("매수",AtMarket);
Var1 = NextBarOpen;
ent_position = 1;
}
//If ma(C,단기)<ma(C,장기) and ( C<O and H==O ) or ( C[1]>O[1] and L[1]==O[1] and C<O ) Then {
If ma(C,단기)<ma(C,장기) and ( C<O and H==O ) and ent_position == 0 Then {
Sell("매도",AtMarket);
Var1 = NextBarOpen;
ent_position = -1;
}
if PositionProfit >= profit_pt and ent_position<>0 Then{
if ent_position == 1 and C<O Then {
ExitLong("매수청산");
}
if ent_position == -1 and C>O Then {
ExitLong("매도청산");
}
}
SetStopLoss(loss_pt,PointStop);
SetStopEndofday(장종료청산);