커뮤니티

문의드립니다

프로필 이미지
시고르시고르
2024-03-26 23:54:07
633
글번호 177982
답변완료

첨부 이미지

if MarketPosition == 1 Then { if CurrentContracts > CurrentContracts[1] Then { Condition11 = False; Condition12 = False; Condition13 = False; Condition14 = False; } if CurrentContracts < CurrentContracts[1] Then { if LatestExitName(0) == "bx1" Then Condition11 = true; if LatestExitName(0) == "bx2" Then Condition12 = true; if LatestExitName(0) == "bx3" Then Condition13 = true; if LatestExitName(0) == "bx4" Then Condition14 = true; } if Condition11 == False Then Exitlong("bx1", atstop, X,def,Ceiling(CurrentContracts/4),1); if Condition12 == False Then Exitlong("bx2", atstop, X-10,Ceiling(CurrentContracts/3),1); if Condition13 == False Then Exitlong("bx3", atstop, X-20,def,Ceiling(CurrentContracts/2),1); if Condition14 == False Then Exitlong("bx4", atstop, X-30,def,Ceiling(CurrentContracts/1),1); } Else { Condition11 = False; Condition12 = False; Condition13 = False; Condition14 = False; } 분할 청산을 위한 수식입니다. 그런데 각각의 청산을 1번씩만 발생하도록 의도한 것인데 첨부 그림과 같이 첫째봉에서 1번 청산, 2번 청산이 둘다 일어나면 다음봉에서 1번 청산이 또 발생하는 것을 볼수가 있습니다. 간격을 더 촘촘하게 할 경우 첫봉에서 1,2,3 번청산이 다 발생할 경우 다음봉에서 1,2번 청산이 다시 발생하기도 합니다. 잘 이해가 안되네요. 설명 및 수정부탁드립니다. 언제나 예스스탁에 감사드립니다.
시스템
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2024-03-27 11:31:58

안녕하세요 예스스탁입니다. 랭귀지는 봉완성을 기준으로 합니다. 봉완성기준으로 값을 사용하고 변수에 값을 저장하게 되며 LatestExitName(0)은 가장 최근 청산명만 리턴됩니다. 봉중간에 여러차례 청산이 발생하면 마지막 이름만 리턴받을 수 있기 때문에 한봉에 여러차례 신호가 발생한다면 청산명으로 제어를 할수는 없습니다. 이런 경우에는 청산이 발생하는 내용으로 제어를 해보셔야 합니다. 올리신 수식에서 X가 어떤 값인지 알수 없지만 진입이후 청산가격으로 지정한 값 이하의 시세가 발생하면 해당 청산은 발생한 것이므로 아래와 같이 진입이후 청산값보다 저가가 같거나 작은 시세가 발생하지 않은 상환에서만 청산이 발생하게 작성하셔야 합니다. if MarketPosition == 1 Then { if CurrentContracts > CurrentContracts[1] Then { Condition11 = False; Condition12 = False; Condition13 = False; Condition14 = False; } if L <= X Then Condition1 = true; if L <= X-10 Then Condition1 = true; if L <= X-20 Then Condition1 = true; if L <= X-30 Then Condition1 = true; if Condition11 == False Then Exitlong("bx1", atstop, X,def,Ceiling(CurrentContracts/4),1); if Condition12 == False Then Exitlong("bx2", atstop, X-10,Ceiling(CurrentContracts/3),1); if Condition13 == False Then Exitlong("bx3", atstop, X-20,def,Ceiling(CurrentContracts/2),1); if Condition14 == False Then Exitlong("bx4", atstop, X-30,def,Ceiling(CurrentContracts/1),1); } Else { Condition11 = False; Condition12 = False; Condition13 = False; Condition14 = False; } 즐거운 하루되세요 > 시고르시고르 님이 쓴 글입니다. > 제목 : 문의드립니다 > if MarketPosition == 1 Then { if CurrentContracts > CurrentContracts[1] Then { Condition11 = False; Condition12 = False; Condition13 = False; Condition14 = False; } if CurrentContracts < CurrentContracts[1] Then { if LatestExitName(0) == "bx1" Then Condition11 = true; if LatestExitName(0) == "bx2" Then Condition12 = true; if LatestExitName(0) == "bx3" Then Condition13 = true; if LatestExitName(0) == "bx4" Then Condition14 = true; } if Condition11 == False Then Exitlong("bx1", atstop, X,def,Ceiling(CurrentContracts/4),1); if Condition12 == False Then Exitlong("bx2", atstop, X-10,Ceiling(CurrentContracts/3),1); if Condition13 == False Then Exitlong("bx3", atstop, X-20,def,Ceiling(CurrentContracts/2),1); if Condition14 == False Then Exitlong("bx4", atstop, X-30,def,Ceiling(CurrentContracts/1),1); } Else { Condition11 = False; Condition12 = False; Condition13 = False; Condition14 = False; } 분할 청산을 위한 수식입니다. 그런데 각각의 청산을 1번씩만 발생하도록 의도한 것인데 첨부 그림과 같이 첫째봉에서 1번 청산, 2번 청산이 둘다 일어나면 다음봉에서 1번 청산이 또 발생하는 것을 볼수가 있습니다. 간격을 더 촘촘하게 할 경우 첫봉에서 1,2,3 번청산이 다 발생할 경우 다음봉에서 1,2번 청산이 다시 발생하기도 합니다. 잘 이해가 안되네요. 설명 및 수정부탁드립니다. 언제나 예스스탁에 감사드립니다.