커뮤니티

문의드립니다

프로필 이미지
복둥이
2022-03-14 12:09:17
1122
글번호 157139
답변완료
수고 많으세요. 아래 수식에서 청산 시점 수정을 바래요. 현재 추세가 파랑에서 빨강으로 빨강에서 파랑으로 바뀔 때 이미 진입된 매도, 매수 물량이 일괄 청산되도록 되어 있는데 수정해주시길 바라는 바는 추세가 바뀔 때 청산하는 것이 아니라 이미 진입된 매도 물량은 전저점에, 매수 물량은 전고점에 일괄 청산되도록 해주세요. 감사합니다. TL_SetSize(TL1,3); input : N(),첫진입틱수(),추가진입틱수(); #상승구간의 마지막저점 저장 if Color == RED Then { var1 = 저점[2,1]; } #하락구간의 마지막 고점 저장 if Color == BLUE Then { var2 = 고점[2,1]; } if MarketPosition <= 0 Then { if color == BLUE and var1 > 0 and L > var1-PriceScale*첫진입틱수 Then Buy("b",AtLimit,var1-PriceScale*첫진입틱수,1); } if MarketPosition == 1 Then { value1 = Floor(MaxEntries/N)+1; Buy("bb",AtLimit,(var1[BarsSinceEntry]-PriceScale*첫진입틱수)-(PriceScale*추가진입틱수)*MaxEntries,value1); if T == -1 and 고점[1,1] > 0 Then ExitLong("bx1",AtLimit,고점[1,1]+PriceScale*1); if T == 1 and 고점[2,1] > 0 Then ExitLong("bx2",AtLimit,고점[2,1]+PriceScale*1); } if MarketPosition >= 0 Then { if Color == RED and Var2 > 0 and H < var2+PriceScale*첫진입틱수 Then Sell("s",AtLimit,Var2+PriceScale*첫진입틱수,1); } if MarketPosition == -1 Then { value1 = Floor(MaxEntries/N)+1; Sell("ss",AtLimit,(var2[BarsSinceEntry]+PriceScale*첫진입틱수)+(PriceScale*추가진입틱수)*MaxEntries,value1); if T == 1 and 저점[1,1] > 0 Then ExitShort("sx1",AtLimit,저점[1,1]-PriceScale*1); if T == -1 and 저점[2,1] > 0 Then ExitShort("sx2",AtLimit,저점[2,1]-PriceScale*1); }
시스템
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2022-03-15 12:34:18

안녕하세요 예스스탁입니다. 현재 올려주신 수식의 청산에는 추세변경된 이후에 청산하라는 내용이 없습니다. 진입 후에 현재 추세방향에 따라 전고점이나 전저점값이 다르므로 추세방향에 따라 식이 별도로 2개 있을 뿐입닙니다. 내용은 매수 우 전고점에 청산, 매도 후 전저점의 청산으로 되어 있습니다. 즐거운 하루되세요 > 복둥이 님이 쓴 글입니다. > 제목 : 문의드립니다 > 수고 많으세요. 아래 수식에서 청산 시점 수정을 바래요. 현재 추세가 파랑에서 빨강으로 빨강에서 파랑으로 바뀔 때 이미 진입된 매도, 매수 물량이 일괄 청산되도록 되어 있는데 수정해주시길 바라는 바는 추세가 바뀔 때 청산하는 것이 아니라 이미 진입된 매도 물량은 전저점에, 매수 물량은 전고점에 일괄 청산되도록 해주세요. 감사합니다. TL_SetSize(TL1,3); input : N(),첫진입틱수(),추가진입틱수(); #상승구간의 마지막저점 저장 if Color == RED Then { var1 = 저점[2,1]; } #하락구간의 마지막 고점 저장 if Color == BLUE Then { var2 = 고점[2,1]; } if MarketPosition <= 0 Then { if color == BLUE and var1 > 0 and L > var1-PriceScale*첫진입틱수 Then Buy("b",AtLimit,var1-PriceScale*첫진입틱수,1); } if MarketPosition == 1 Then { value1 = Floor(MaxEntries/N)+1; Buy("bb",AtLimit,(var1[BarsSinceEntry]-PriceScale*첫진입틱수)-(PriceScale*추가진입틱수)*MaxEntries,value1); if T == -1 and 고점[1,1] > 0 Then ExitLong("bx1",AtLimit,고점[1,1]+PriceScale*1); if T == 1 and 고점[2,1] > 0 Then ExitLong("bx2",AtLimit,고점[2,1]+PriceScale*1); } if MarketPosition >= 0 Then { if Color == RED and Var2 > 0 and H < var2+PriceScale*첫진입틱수 Then Sell("s",AtLimit,Var2+PriceScale*첫진입틱수,1); } if MarketPosition == -1 Then { value1 = Floor(MaxEntries/N)+1; Sell("ss",AtLimit,(var2[BarsSinceEntry]+PriceScale*첫진입틱수)+(PriceScale*추가진입틱수)*MaxEntries,value1); if T == 1 and 저점[1,1] > 0 Then ExitShort("sx1",AtLimit,저점[1,1]-PriceScale*1); if T == -1 and 저점[2,1] > 0 Then ExitShort("sx2",AtLimit,저점[2,1]-PriceScale*1); }