커뮤니티

수식 부탁드립니다

프로필 이미지
미송
2017-02-19 09:44:12
108
글번호 106973
답변완료
1.&nbsp;entryprice&nbsp;는&nbsp;최초&nbsp;진입가이고 &nbsp;&nbsp;&nbsp;latestentryprice&nbsp;는&nbsp;최종&nbsp;진입가인데 &nbsp;&nbsp;&nbsp;최초&nbsp;진입후&nbsp;최초&nbsp;진입가가&nbsp;수익&nbsp;목표가에서&nbsp;청산된&nbsp;경우&nbsp;피라미딩&nbsp;후&nbsp;청산되지&nbsp;않고&nbsp;계&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;속보유중인&nbsp;가격&nbsp;중&nbsp;최저가를&nbsp;나타내는&nbsp;명령어가&nbsp;있나요? 이 질문에 답변을 해주셔서 당초 시스템식 if MarketPosition == 1 Then { if MaxContracts < 4 Then buy("bb",atstop,LatestEntryPrice(0)+1.5,1); } if MarketPosition == -1 Then { if MaxContracts < 4 Then sell("ss",atstop,LatestEntryPrice(0)-1.5,1); } #진입별 5포인트 수익시 청산 SetStopProfittarget(5.0,PointStop); #진입별 1.5포인트 손실시 청산 SetStoploss(1.5,PointStop); if MarketPosition == 1 Then ExitLong("bp",atlimit,EntryPrice+20.0); if MarketPosition == -1 Then ExitShort("sp",atlimit,EntryPrice-20.0); if MarketPosition == 1 and c > entryprice + 15.0 and Relative1 >= 65 Then exitlong("bx1",AtStop,c); if MarketPosition == -1 and c < entryprice - 15.0 and Relative1 <= 35 Then exitShort("sx1",AtStop,c); if MarketPosition == 1 and highest(h,BarsSinceEntry) >= EntryPrice + 0.6 Then Exitlong("bx2",AtStop,highest(H,BarsSinceEntry) - abs(highest(H,BarsSinceEntry)-EntryPrice)*1.0); if MarketPosition == -1 and lowest(L,BarsSinceEntry) <= EntryPrice - 0.6 Then Exitshort("Sx2",AtStop,lowest(L,BarsSinceEntry) + abs(lowest(L,BarsSinceEntry)-EntryPrice)*1.0); if MarketPosition == 1 and highest(h,BarsSinceEntry) >= EntryPrice + 1.0 Then Exitlong("bx3",AtStop,highest(H,BarsSinceEntry) - abs(highest(H,BarsSinceEntry)-EntryPrice)*0.9); if MarketPosition == -1 and lowest(L,BarsSinceEntry) <= EntryPrice - 1.0 Then Exitshort("Sx3",AtStop,lowest(L,BarsSinceEntry) + abs(lowest(L,BarsSinceEntry)-EntryPrice)*0.9); 을 다음과 같이 바꾸었습니다 if MarketPosition == 1 Then { if MaxContracts < 4 Then buy("bb",atstop,LatestEntryPrice(0)+1.5,1); } if MarketPosition == -1 Then { if MaxContracts < 4 Then sell("ss",atstop,LatestEntryPrice(0)-1.5,1); } If MarketPosition == -1 Then { if MaxEntries == 1 Then LL = EntryPrice; if CurrentContracts > CurrentContracts[1] and LatestEntryPrice(0) > LL Then LL = LatestEntryPrice(0); } #진입별 5포인트 수익시 청산 SetStopProfittarget(5.0,PointStop); #진입별 1.5포인트 손실시 청산 SetStoploss(1.5,PointStop); if MarketPosition == 1 Then ExitLong("bp",atlimit,EntryPrice+20); if MarketPosition == -1 Then ExitShort("sp",atlimit,EntryPrice-20); if MarketPosition == 1 and c > entryprice + 15.0 and Relative1 >= 65 Then exitlong("bx1",AtStop,c); if MarketPosition == -1 and c < EntryPrice - 15.0 and Relative1 <= 35 Then exitShort("sx1",AtStop,c); if MarketPosition == 1 and CurrentContracts == 1 and highest(h,BarsSinceEntry) >= LL + 0.6 Then Exitlong("bx2",AtStop,highest(H,BarsSinceEntry) - abs(highest(H,BarsSinceEntry)- LL)*1.0); if MarketPosition == -1 and CurrentContracts == 1 and lowest(L,BarsSinceEntry) <= LL - 0.6 Then Exitshort("Sx2",AtStop,lowest(L,BarsSinceEntry) + abs(lowest(L,BarsSinceEntry)- LL)*1.0); if MarketPosition == 1 and CurrentContracts <= 2 and highest(h,BarsSinceEntry) >= LL-1.0 Then Exitlong("bx3",AtStop,highest(H,BarsSinceEntry) - abs(highest(H,BarsSinceEntry)- LL)*0.9); if MarketPosition == -1 and CurrentContracts <= 2 and lowest(L,BarsSinceEntry) <= LL- 1.0 Then Exitshort("Sx3",AtStop,lowest(L,BarsSinceEntry) + abs(lowest(L,BarsSinceEntry)- LL)*0.9); 바꾼 결과는 당초와 다른것이 하나도 없었습니다. 더 바꿔야 하는 수식이 있는지 검토 부탁드립니다 2. entryprice&nbsp;는&nbsp;최초&nbsp;진입가이고 &nbsp;&nbsp;&nbsp;latestentryprice&nbsp;는&nbsp;최종&nbsp;진입가인데 피라미딩 후 청산되지 않고 보유중인 계약이 다수 있을경우 각 가격을 나타내는 명령어가 있 나요? 3. 또 위의 피라미딩 시스템은 4개의 잔량까지 보유 할 수 있는데 보유중인 가격중 하위 2개, 또는 3개 가격의 평균가(avgentryprice)을 나타내는 명령어를 만들고 싶습니다 감사합니다
시스템
답변 2
프로필 이미지

예스스탁 예스스탁 답변

2017-02-20 14:10:32

안녕하세요 예스스탁입니다. 1. LatestEntryPrice(0)가 LL보다 작다라고 하셔야 합니다. If MarketPosition != 0 Then { if MaxEntries == 1 Then LL = EntryPrice; if CurrentContracts > CurrentContracts[1] and LatestEntryPrice(0) < LL Then LL = LatestEntryPrice(0); } 2 없습니다. 3 아래 내용 참고하시기 바랍니다. var : E1(0),E2(0),E3(0),E4(0),avg2(0),avg3(0); If MarketPosition != 0 Then { if CurrentContracts > CurrentContracts[1] Then{ if MaxEntries == 1 Then E1 = LatestEntryPrice(0); if MaxEntries == 2 Then E2 = LatestEntryPrice(0); if MaxEntries == 3 Then E3 = LatestEntryPrice(0); if MaxEntries == 4 Then E4 = LatestEntryPrice(0); } if MaxEntries == 1 Then{ avg2 = E1; avg3 = E1; } if MaxEntries == 2 Then{ avg2 = (E1+E2)/2; avg3 = (E1+E2)/2; } if MaxEntries == 3 Then{ avg2 = (NthMinList(1,E1,E2,E3)+NthMinList(2,E1,E2,E3))/2; avg3 = (E1+E2+E3)/3; } if MaxEntries == 4 Then{ avg2 = (NthMinList(1,E1,E2,E3,E4)+NthMinList(2,E1,E2,E3,E4))/2; avg3 = (NthMinList(1,E1,E2,E3,E4)+NthMinList(2,E1,E2,E3,E4)+NthMinList(3,E1,E2,E3,E4))/3; } } 즐거운 하루되세요 > 미송 님이 쓴 글입니다. > 제목 : 수식 부탁드립니다 > 1.&nbsp;entryprice&nbsp;는&nbsp;최초&nbsp;진입가이고 &nbsp;&nbsp;&nbsp;latestentryprice&nbsp;는&nbsp;최종&nbsp;진입가인데 &nbsp;&nbsp;&nbsp;최초&nbsp;진입후&nbsp;최초&nbsp;진입가가&nbsp;수익&nbsp;목표가에서&nbsp;청산된&nbsp;경우&nbsp;피라미딩&nbsp;후&nbsp;청산되지&nbsp;않고&nbsp;계&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;속보유중인&nbsp;가격&nbsp;중&nbsp;최저가를&nbsp;나타내는&nbsp;명령어가&nbsp;있나요? 이 질문에 답변을 해주셔서 당초 시스템식 if MarketPosition == 1 Then { if MaxContracts < 4 Then buy("bb",atstop,LatestEntryPrice(0)+1.5,1); } if MarketPosition == -1 Then { if MaxContracts < 4 Then sell("ss",atstop,LatestEntryPrice(0)-1.5,1); } #진입별 5포인트 수익시 청산 SetStopProfittarget(5.0,PointStop); #진입별 1.5포인트 손실시 청산 SetStoploss(1.5,PointStop); if MarketPosition == 1 Then ExitLong("bp",atlimit,EntryPrice+20.0); if MarketPosition == -1 Then ExitShort("sp",atlimit,EntryPrice-20.0); if MarketPosition == 1 and c > entryprice + 15.0 and Relative1 >= 65 Then exitlong("bx1",AtStop,c); if MarketPosition == -1 and c < entryprice - 15.0 and Relative1 <= 35 Then exitShort("sx1",AtStop,c); if MarketPosition == 1 and highest(h,BarsSinceEntry) >= EntryPrice + 0.6 Then Exitlong("bx2",AtStop,highest(H,BarsSinceEntry) - abs(highest(H,BarsSinceEntry)-EntryPrice)*1.0); if MarketPosition == -1 and lowest(L,BarsSinceEntry) <= EntryPrice - 0.6 Then Exitshort("Sx2",AtStop,lowest(L,BarsSinceEntry) + abs(lowest(L,BarsSinceEntry)-EntryPrice)*1.0); if MarketPosition == 1 and highest(h,BarsSinceEntry) >= EntryPrice + 1.0 Then Exitlong("bx3",AtStop,highest(H,BarsSinceEntry) - abs(highest(H,BarsSinceEntry)-EntryPrice)*0.9); if MarketPosition == -1 and lowest(L,BarsSinceEntry) <= EntryPrice - 1.0 Then Exitshort("Sx3",AtStop,lowest(L,BarsSinceEntry) + abs(lowest(L,BarsSinceEntry)-EntryPrice)*0.9); 을 다음과 같이 바꾸었습니다 if MarketPosition == 1 Then { if MaxContracts < 4 Then buy("bb",atstop,LatestEntryPrice(0)+1.5,1); } if MarketPosition == -1 Then { if MaxContracts < 4 Then sell("ss",atstop,LatestEntryPrice(0)-1.5,1); } If MarketPosition == -1 Then { if MaxEntries == 1 Then LL = EntryPrice; if CurrentContracts > CurrentContracts[1] and LatestEntryPrice(0) > LL Then LL = LatestEntryPrice(0); } #진입별 5포인트 수익시 청산 SetStopProfittarget(5.0,PointStop); #진입별 1.5포인트 손실시 청산 SetStoploss(1.5,PointStop); if MarketPosition == 1 Then ExitLong("bp",atlimit,EntryPrice+20); if MarketPosition == -1 Then ExitShort("sp",atlimit,EntryPrice-20); if MarketPosition == 1 and c > entryprice + 15.0 and Relative1 >= 65 Then exitlong("bx1",AtStop,c); if MarketPosition == -1 and c < EntryPrice - 15.0 and Relative1 <= 35 Then exitShort("sx1",AtStop,c); if MarketPosition == 1 and CurrentContracts == 1 and highest(h,BarsSinceEntry) >= LL + 0.6 Then Exitlong("bx2",AtStop,highest(H,BarsSinceEntry) - abs(highest(H,BarsSinceEntry)- LL)*1.0); if MarketPosition == -1 and CurrentContracts == 1 and lowest(L,BarsSinceEntry) <= LL - 0.6 Then Exitshort("Sx2",AtStop,lowest(L,BarsSinceEntry) + abs(lowest(L,BarsSinceEntry)- LL)*1.0); if MarketPosition == 1 and CurrentContracts <= 2 and highest(h,BarsSinceEntry) >= LL-1.0 Then Exitlong("bx3",AtStop,highest(H,BarsSinceEntry) - abs(highest(H,BarsSinceEntry)- LL)*0.9); if MarketPosition == -1 and CurrentContracts <= 2 and lowest(L,BarsSinceEntry) <= LL- 1.0 Then Exitshort("Sx3",AtStop,lowest(L,BarsSinceEntry) + abs(lowest(L,BarsSinceEntry)- LL)*0.9); 바꾼 결과는 당초와 다른것이 하나도 없었습니다. 더 바꿔야 하는 수식이 있는지 검토 부탁드립니다 2. entryprice&nbsp;는&nbsp;최초&nbsp;진입가이고 &nbsp;&nbsp;&nbsp;latestentryprice&nbsp;는&nbsp;최종&nbsp;진입가인데 피라미딩 후 청산되지 않고 보유중인 계약이 다수 있을경우 각 가격을 나타내는 명령어가 있 나요? 3. 또 위의 피라미딩 시스템은 4개의 잔량까지 보유 할 수 있는데 보유중인 가격중 하위 2개, 또는 3개 가격의 평균가(avgentryprice)을 나타내는 명령어를 만들고 싶습니다 감사합니다
프로필 이미지

미송

2017-02-20 20:09:42

미송 님에 의해 삭제된 답변입니다.