커뮤니티

수식부탁드립니다

프로필 이미지
미송
2017-03-30 13:12:27
211
글번호 108353
답변완료

첨부 이미지

피라미딩중&nbsp;최근&nbsp;진입과&nbsp;최근&nbsp;직전&nbsp;진입이&nbsp;모두&nbsp;손절(setstoploss)되는&nbsp;경우 &nbsp;(만약&nbsp;총&nbsp;피라미딩&nbsp;가능수량이&nbsp;10개이고&nbsp;실제진입이&nbsp;5개&nbsp;되었는데&nbsp;가장&nbsp;최근&nbsp;진입&nbsp;2개가&nbsp;손절 &nbsp;된&nbsp;경우) &nbsp;추후&nbsp;피라미딩&nbsp;추가&nbsp;진입이&nbsp;가능한&nbsp;경우라도,&nbsp;추가&nbsp;진입(피라미딩)은&nbsp;하지않고&nbsp;기존&nbsp;진입분만&nbsp; &nbsp;청산시점에서&nbsp;청산하게&nbsp;만들고&nbsp;싶습니다. 라고 질문 드려 답을 주셔서 다음과 같이 식을 적용해서 시스템에 적용 했습니다 if MarketPosition == 1 Then { if CurrentContracts < CurrentContracts[1] Then { if LatestExitName(0) == "StopLoss" Then bloss = bloss+1; Else bloss = 0; } if Bloss < 2 and MaxContracts < 20 and EntryPrice + 10.0 > LatestEntryPrice Then buy("bb",atstop,LatestEntryPrice(0)+1.0,1); } Else bloss = 0; if MarketPosition == -1 Then { if CurrentContracts < CurrentContracts[1] Then { if LatestExitName(0) == "StopLoss" Then sloss = sloss+1; Else sloss = 0; } if sloss < 2 and MaxContracts < 20 AND EntryPrice - 10.0 < LatestEntryPrice Then sell("ss",atstop,LatestEntryPrice(0)-1.0,1); } Else sloss = 0; 그림에서 보면 2번 손절 후 청산이 상황이 발생하여 신규 진입없이 청산만 이루어 졌는데 청산 후 동일 진입 지점이 다시오니 신규 진입이 발생했습니다 신규 진입이 없이 기존 보유분을 청산만 가능하도록 식을 수정하고 싶습니다 그림은 그림판을 사용해 작성했습니다
시스템
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2017-03-30 15:57:03

안녕하세요 예스스탁입니다. 현재 수식이 손절이 연속2회 발생하면 진입을 막고 추가로 손절이 아닌 청산이 발생하면 추가진입을 할수가 있습니다. 손절2번이 발생하면 추가로 발생되는 청산과 관계없이 진입을 못하도록 수정했습니다. var : Bloss(0),Sloss(0),XBE(false),XSE(false);; if MarketPosition == 1 Then { if CurrentContracts < CurrentContracts[1] Then { if LatestExitName(0) == "StopLoss" Then bloss = bloss+1; Else bloss = 0; } if Bloss == 2 Then XBE = true; if XBE == false and MaxContracts < 20 and EntryPrice + 10.0 > LatestEntryPrice Then buy("bb",atstop,LatestEntryPrice(0)+1.0,1); } Else{ bloss = 0; XBE = false; } if MarketPosition == -1 Then { if CurrentContracts < CurrentContracts[1] Then { if LatestExitName(0) == "StopLoss" Then sloss = sloss+1; Else sloss = 0; } if Sloss == 2 Then XSE = true; if XSE == false and MaxContracts < 20 AND EntryPrice - 10.0 < LatestEntryPrice Then sell("ss",atstop,LatestEntryPrice(0)-1.0,1); } Else{ sloss = 0; XSE = false; } 즐거운 하루되세요 > 미송 님이 쓴 글입니다. > 제목 : 수식부탁드립니다 > 피라미딩중&nbsp;최근&nbsp;진입과&nbsp;최근&nbsp;직전&nbsp;진입이&nbsp;모두&nbsp;손절(setstoploss)되는&nbsp;경우 &nbsp;(만약&nbsp;총&nbsp;피라미딩&nbsp;가능수량이&nbsp;10개이고&nbsp;실제진입이&nbsp;5개&nbsp;되었는데&nbsp;가장&nbsp;최근&nbsp;진입&nbsp;2개가&nbsp;손절 &nbsp;된&nbsp;경우) &nbsp;추후&nbsp;피라미딩&nbsp;추가&nbsp;진입이&nbsp;가능한&nbsp;경우라도,&nbsp;추가&nbsp;진입(피라미딩)은&nbsp;하지않고&nbsp;기존&nbsp;진입분만&nbsp; &nbsp;청산시점에서&nbsp;청산하게&nbsp;만들고&nbsp;싶습니다. 라고 질문 드려 답을 주셔서 다음과 같이 식을 적용해서 시스템에 적용 했습니다 if MarketPosition == 1 Then { if CurrentContracts < CurrentContracts[1] Then { if LatestExitName(0) == "StopLoss" Then bloss = bloss+1; Else bloss = 0; } if Bloss < 2 and MaxContracts < 20 and EntryPrice + 10.0 > LatestEntryPrice Then buy("bb",atstop,LatestEntryPrice(0)+1.0,1); } Else bloss = 0; if MarketPosition == -1 Then { if CurrentContracts < CurrentContracts[1] Then { if LatestExitName(0) == "StopLoss" Then sloss = sloss+1; Else sloss = 0; } if sloss < 2 and MaxContracts < 20 AND EntryPrice - 10.0 < LatestEntryPrice Then sell("ss",atstop,LatestEntryPrice(0)-1.0,1); } Else sloss = 0; 그림에서 보면 2번 손절 후 청산이 상황이 발생하여 신규 진입없이 청산만 이루어 졌는데 청산 후 동일 진입 지점이 다시오니 신규 진입이 발생했습니다 신규 진입이 없이 기존 보유분을 청산만 가능하도록 식을 수정하고 싶습니다 그림은 그림판을 사용해 작성했습니다