예스스탁
예스스탁 답변
2020-01-02 14:15:22
안녕하세요
예스스탁입니다.
Input:length(20),익청(20),손절(20);
Var:종가사용여부(0),TL_NewBit(0);
Array:고[10,4](0),저[10,4](0);
Value1 = HiLoLineZigZag(length,종가사용여부,고,저,TL_NewBit);
if value1 == 1 and value1 != value1[1] Then
{
Condition1 = true;
Condition2 = true;
}
if value1 == -1 and value1 != value1[1] Then
{
Condition3 = true;
Condition4 = true;
}
If MarketPosition <= 0 and value1 == 1 and Condition1 == true Then
Buy("B1",AtStop,고[2,1]);
If MarketPosition <= 0 and value1 == -1 and Condition4 == true Then
Buy("B2",AtStop,고[1,1]);
if MarketPosition == 1 Then
{
ExitLong("Bp",AtLimit,EntryPrice+PriceScale*익청,"",1,1);
}
If MarketPosition >= 0 and value1 == -1 and Condition3 == true Then
Sell("S1",AtStop,저[2,1]);
If MarketPosition >= 0 and value1 == 1 and Condition2 == true Then
Sell("S2",AtStop,저[1,1]);
if MarketPosition == -1 Then
{
ExitShort("Sp",AtLimit,EntryPrice-PriceScale*익청,"",1,1);
}
SetStoploss(PriceScale*손절,PointStop);
if MarketPosition == 1 Then
{
Condition1 = false;
Condition4 = false;
}
if MarketPosition == -1 Then
{
Condition2 = false;
Condition3 = false;
}
즐거운 하루 되세요
> 상중하 님이 쓴 글입니다.
> 제목 : 65448번 추가질문입니다.
> 안녕하세요?
65448번 추가질문입니다.
익절 또는 손절한이후 재진입 수식 수정 부탁드립니다.
그림1 매수손절 이후 매수 정상적으로 진입됨.
그림2 매도손절이후 매도재진입이 안됨.
그림3 매수익절이후 한파동에 한번진입되어야하는데 재진입.
그림4 매도익절이후 재진입이 안됨.
아래수식에서 위부분을 수정부탁드립니다.
지난 한해동안 고생 많으셨습니다.
새해 복 많이 받으세요.
----------------------------------------------------------------
Input:length(20),익청(20),손절(20);
Var:종가사용여부(0),
TL_NewBit(0);
Array:고[10,4](0),저[10,4](0);
Value1 = HiLoLineZigZag(length,종가사용여부,고,저,TL_NewBit);
if TotalTrades > TotalTrades[1] then
{
if MarketPosition(1) == 1 Then
Condition1 = false;
if MarketPosition(1) == -1 Then
Condition2 = false;
}
If MarketPosition <= 0 and value1 == 1 and Condition1 == False Then
Buy("B1",AtStop,고[2,1]);
If MarketPosition <= 0 and value1 == -1 and Condition1 == false Then
Buy("B2",AtStop,고[1,1]);
if MarketPosition == 1 Then
{
ExitLong("Bp",AtLimit,EntryPrice+PriceScale*익청,"",1,1);
}
If MarketPosition >= 0 and value1 == -1 and Condition2 == true Then // 저점
Sell("S1",AtStop,저[2,1]);
If MarketPosition >= 0 and value1 == 1 and Condition2 == true Then // 저점
Sell("S2",AtStop,저[1,1]);
if MarketPosition == -1 Then
{
ExitShort("Sp",AtLimit,EntryPrice-PriceScale*익청,"",1,1);
}
SetStoploss(PriceScale*손절,PointStop);
if MarketPosition == 1 Then
Condition1 = true;
if MarketPosition == 1 Then
Condition2 = true;