커뮤니티

청산 수식 수정 좀 요청 드립니다.

프로필 이미지
요타
2025-05-27 10:21:24
172
글번호 191191
답변완료
ㅇ 항상 많은 도움에 고맙습니다. ㅇ 아래 매매식에서 청산부분이 안되는데 수정좀 요청 드림니다. # 매수식 (요부분이 안됨니다) 1. 360틱 수익 이었다가 320틱 이하로 떨어지면 청산 2. 240틱 수익 이었다가 220틱 이하로 떨어지면 청산 3. 150틱 수익 이었다가 120틱 이하로 떨어지면 청산 4. 130틱 수익 이었다가 90틱 이하로 떨어지면 청산 5. 80틱 수익 이었다가 40틱 이하로 떨어지면 청산 6. 38틱 수익 이었다가 0틱 이하로 떨어지면 청산 ## 아래 수식 ##============================================================================================================ ##============================================================================================================ If sDate >= 20250422 and stime >= 100000 and stime <= 220000 AND CrossUp( ma(c,5) , ma(c,20) ) Then { Buy( "수"); } If sDate >= 20250422 and stime >= 100000 and stime <= 220000 AND CrossDown( ma(c,5) , ma(c,20) ) ) Then { Sell("도"); } if MarketPosition == 1 then { if MarketPosition == 1 and highest(H,BarsSinceEntry) >= EntryPrice + PriceScale*360 Then ExitLong("bx1",AtStop, EntryPrice - PriceScale*320); if MarketPosition == 1 and highest(H,BarsSinceEntry) >= EntryPrice + PriceScale*240 Then ExitLong("bx2",AtStop, EntryPrice - PriceScale*220); if MarketPosition == 1 and highest(H,BarsSinceEntry) >= EntryPrice + PriceScale*150 Then ExitLong("bx3",AtStop, EntryPrice - PriceScale*120); if MarketPosition == 1 and highest(H,BarsSinceEntry) >= EntryPrice + PriceScale*130 Then ExitLong("bx4",AtStop, EntryPrice - PriceScale*90); if MarketPosition == 1 and highest(H,BarsSinceEntry) >= EntryPrice + PriceScale*80 Then ExitLong("bx5",AtStop, EntryPrice - PriceScale*40); if MarketPosition == 1 and highest(H,BarsSinceEntry) >= EntryPrice + PriceScale*38 Then ExitLong("bx6",AtStop, EntryPrice - PriceScale*0); } if MarketPosition == -1 then { if MarketPosition == -1 and Lowest(L,BarsSinceEntry) <= EntryPrice - PriceScale*160 Then ExitShort("sx1",AtStop,EntryPrice - PriceScale*140); if MarketPosition == -1 and Lowest(L,BarsSinceEntry) <= EntryPrice - PriceScale*130 Then ExitShort("sx2",AtStop,EntryPrice - PriceScale*100); if MarketPosition == -1 and Lowest(L,BarsSinceEntry) <= EntryPrice - PriceScale*80 Then ExitShort("sx3",AtStop,EntryPrice - PriceScale*40); } ##============================================================================================================ ##============================================================================================================ SetStopEndofday(220000); ##============================================================================================================ ##============================================================================================================ ㅇ 고맙 습니다. 수고하십시요.
시스템
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2025-05-27 10:49:18

안녕하세요 예스스탁입니다. ##============================================================================================================ ##============================================================================================================ If sDate >= 20250422 and stime >= 100000 and stime <= 220000 AND CrossUp( ma(c,5) , ma(c,20) ) Then { Buy( "수"); } If sDate >= 20250422 and stime >= 100000 and stime <= 220000 AND CrossDown( ma(c,5) , ma(c,20) ) Then { Sell("도"); } if MarketPosition == 1 then { if highest(H,BarsSinceEntry) >= EntryPrice + PriceScale*360 Then ExitLong("bx1",AtStop, EntryPrice + PriceScale*320); if highest(H,BarsSinceEntry) >= EntryPrice + PriceScale*240 Then ExitLong("bx2",AtStop, EntryPrice + PriceScale*220); if highest(H,BarsSinceEntry) >= EntryPrice + PriceScale*150 Then ExitLong("bx3",AtStop, EntryPrice + PriceScale*120); if highest(H,BarsSinceEntry) >= EntryPrice + PriceScale*130 Then ExitLong("bx4",AtStop, EntryPrice + PriceScale*90); if highest(H,BarsSinceEntry) >= EntryPrice + PriceScale*80 Then ExitLong("bx5",AtStop, EntryPrice + PriceScale*40); if highest(H,BarsSinceEntry) >= EntryPrice + PriceScale*38 Then ExitLong("bx6",AtStop, EntryPrice + PriceScale*0); } if MarketPosition == -1 then { if Lowest(L,BarsSinceEntry) <= EntryPrice - PriceScale*360 Then ExitShort("sx1",AtStop,EntryPrice - PriceScale*320); if Lowest(L,BarsSinceEntry) <= EntryPrice - PriceScale*240 Then ExitShort("sx2",AtStop,EntryPrice - PriceScale*220); if Lowest(L,BarsSinceEntry) <= EntryPrice - PriceScale*150 Then ExitShort("sx3",AtStop,EntryPrice - PriceScale*120); if Lowest(L,BarsSinceEntry) <= EntryPrice - PriceScale*130 Then ExitShort("sx4",AtStop,EntryPrice - PriceScale*90); if Lowest(L,BarsSinceEntry) <= EntryPrice - PriceScale*80 Then ExitShort("sx5",AtStop,EntryPrice - PriceScale*40); if Lowest(L,BarsSinceEntry) <= EntryPrice - PriceScale*38 Then ExitShort("sx6",AtStop,EntryPrice - PriceScale*0); } ##============================================================================================================ ##============================================================================================================ SetStopEndofday(220000); ##============================================================================================================ ##============================================================================================================ 즐거운 하루되세요 > 요타 님이 쓴 글입니다. > 제목 : 청산 수식 수정 좀 요청 드립니다. > ㅇ 항상 많은 도움에 고맙습니다. ㅇ 아래 매매식에서 청산부분이 안되는데 수정좀 요청 드림니다. # 매수식 (요부분이 안됨니다) 1. 360틱 수익 이었다가 320틱 이하로 떨어지면 청산 2. 240틱 수익 이었다가 220틱 이하로 떨어지면 청산 3. 150틱 수익 이었다가 120틱 이하로 떨어지면 청산 4. 130틱 수익 이었다가 90틱 이하로 떨어지면 청산 5. 80틱 수익 이었다가 40틱 이하로 떨어지면 청산 6. 38틱 수익 이었다가 0틱 이하로 떨어지면 청산 ## 아래 수식 ##============================================================================================================ ##============================================================================================================ If sDate >= 20250422 and stime >= 100000 and stime <= 220000 AND CrossUp( ma(c,5) , ma(c,20) ) Then { Buy( "수"); } If sDate >= 20250422 and stime >= 100000 and stime <= 220000 AND CrossDown( ma(c,5) , ma(c,20) ) ) Then { Sell("도"); } if MarketPosition == 1 then { if MarketPosition == 1 and highest(H,BarsSinceEntry) >= EntryPrice + PriceScale*360 Then ExitLong("bx1",AtStop, EntryPrice - PriceScale*320); if MarketPosition == 1 and highest(H,BarsSinceEntry) >= EntryPrice + PriceScale*240 Then ExitLong("bx2",AtStop, EntryPrice - PriceScale*220); if MarketPosition == 1 and highest(H,BarsSinceEntry) >= EntryPrice + PriceScale*150 Then ExitLong("bx3",AtStop, EntryPrice - PriceScale*120); if MarketPosition == 1 and highest(H,BarsSinceEntry) >= EntryPrice + PriceScale*130 Then ExitLong("bx4",AtStop, EntryPrice - PriceScale*90); if MarketPosition == 1 and highest(H,BarsSinceEntry) >= EntryPrice + PriceScale*80 Then ExitLong("bx5",AtStop, EntryPrice - PriceScale*40); if MarketPosition == 1 and highest(H,BarsSinceEntry) >= EntryPrice + PriceScale*38 Then ExitLong("bx6",AtStop, EntryPrice - PriceScale*0); } if MarketPosition == -1 then { if MarketPosition == -1 and Lowest(L,BarsSinceEntry) <= EntryPrice - PriceScale*160 Then ExitShort("sx1",AtStop,EntryPrice - PriceScale*140); if MarketPosition == -1 and Lowest(L,BarsSinceEntry) <= EntryPrice - PriceScale*130 Then ExitShort("sx2",AtStop,EntryPrice - PriceScale*100); if MarketPosition == -1 and Lowest(L,BarsSinceEntry) <= EntryPrice - PriceScale*80 Then ExitShort("sx3",AtStop,EntryPrice - PriceScale*40); } ##============================================================================================================ ##============================================================================================================ SetStopEndofday(220000); ##============================================================================================================ ##============================================================================================================ ㅇ 고맙 습니다. 수고하십시요.