답변완료
문의드립니다.
if MarketPosition <= 0 Then{ if 조건수식1 Then { if CurrentContracts < 1 Then buy("매수1",OnClose,def,1); }}if MarketPosition == 1 Then{ if IsEntryName("매수1") == true Then { if 조건수식3 Then { if CurrentContracts < 1 Then buy("수1",OnClose,def,1); } Else { if 조건수식4 and CurrentContracts < 2 Then buy("수2",OnClose,def,1); } if 조건수식1 Then { exitlong("청산1",OnClose,def,"매수1"); } Else { if 조건수식1-2 Then exitlong("청산1-1",OnClose,def,"매수1"); } if 조건수식2 Then { exitlong("청산2",OnClose,def,"수1"); } Else { if 조건수식2-1 Then exitlong("청산2-1",OnClose,def,"수1"); } if 조건수식4 Then { exitlong("청산4",OnClose,def,"수2"); } Else { if 조건수식4-1 Then exitlong("청산4-1",OnClose,def,"수2"); } ExitLong("bp1",atlimit,AvgEntryPrice+PriceScale*익절틱수1,"매수1"); ExitLong("bl1",AtStop,AvgEntryPrice-PriceScale*손절틱수1,"매수1"); ExitLong("bp2",atlimit,AvgEntryPrice+PriceScale*익절틱수2,"수1"); ExitLong("bl2",AtStop,AvgEntryPrice-PriceScale*손절틱수2,"수1"); ExitLong("bp4",atlimit,AvgEntryPrice+PriceScale*익절틱수4,"수2"); ExitLong("bl4",AtStop,AvgEntryPrice-PriceScale*손절틱수4,"수2"); }} 피라미딩 사용한 후여기에서 조건수식3가 3번 발생한다면 if 조건수식3 Then { if CurrentContracts < 1 Then buy("수1",OnClose,def,1); }만약에 ExitLong("bp2",atlimit,AvgEntryPrice+PriceScale*익절틱수2,"수1"); 실행시3번 실행한 평균값이 청산되나요.아니면 익절틱수2 만큼 개별 청산되나요.실제 실행하니 매수1 포함 피라미딩 전체의 평균값이 청산되나요.피라미딩 사용에서 평균값 청산으로 사용한다면 어떤 믜미인가요.
2026-02-13
107
글번호 230555
시스템
답변완료
길이좀 늘려 주십시요.
항사 많은 도움에 고맙 습니다.아래 수식에서 생기는 수평선이 길이가 다른데 기본 5봉 가지 나오도록 부탁 드림니다. 더 긴것은 그대로 나오면 됨니다.즉 기본 5봉 (변수)까지 수평선이 나오도록 부탁 드림니다. ##input : P(3),n(8),틱(20), 굵기(0);var : TX(0);var : cnt(0),LL(0),HH(0);Array : LTL[10](0),HTL[10](0),LI[10](0),HI[10](0),Lv[10](0),Hv[10](0);;var : LTL1(0),LTL2(0),LTL3(0),LTL4(0),LTL5(0),LTL6(0);var : HTL1(0),HTL2(0),HTL3(0),HTL4(0),HTL5(0),HTL6(0);if L < Lowest(L,P)[1] and (LL == 0 or (LL > 0 and abs(L-LL) >= PriceScale*틱)) Then{ LL = L; For cnt = 9 DownTo 1 { LTL[cnt] = LTL[cnt-1]; Li[cnt] = Li[cnt-1]; Lv[cnt] = Lv[cnt-1]; } LTL[0] = TL_new(sDate,sTime,LL,NextBarSdate,NextBarStime,LL); Lv[0] = LL; Li[0] = Index; TL_SetColor(LTL[0],Rgb(0,0,0)); TL_SetSize(LTL[0],굵기); TL_Delete(LTL[n]);}Else{ TL_SetEnd(LTL[0],NextBarSdate,NextBarStime,LL[0]);}if H > highest(H,P)[1] and (HH == 0 or (HH > 0 and abs(H-HH) >= PriceScale*틱)) Then{ HH = H; For cnt = 9 DownTo 1 { HTL[cnt] = HTL[cnt-1]; Hi[cnt] = Hi[cnt-1]; Hv[cnt] = Hv[cnt-1]; } HTL[0] = TL_new(sDate,sTime,HH,NextBarSdate,NextBarStime,HH); Hv[0] = HH; Hi[0] = Index; TL_SetColor(HTL[0],Rgb(220,0,255)); TL_SetSize(HTL[0],굵기); TL_Delete(HTL[n]);}Else{ TL_SetEnd(HTL[0],NextBarSdate,NextBarStime,HH);}For cnt = 1 to n-1{ if LL[cnt] > 0 and Index <= Li[cnt]+5 Then TL_SetEnd(LTL[cnt],NextBarSdate,NextBarStime,Lv[cnt]); if HH[cnt] > 0 and Index <= Hi[cnt]+5 Then TL_SetEnd(HTL[cnt],NextBarSdate,NextBarStime,Hv[cnt]);}고맙습니다.
2026-02-12
132
글번호 230545
지표
답변완료
예비신호음
안녕하세요.신호캔들이 완성되기 전, 캔들이 진행되는 도중 진입조건을 만족하면 예비신호음이 나도록 수식을 만들어 봤는데, 문제는 한 캔들당 발생하는 신호음의 수를 제한하는 것이 안되고 계속해서 신호음이 발생합니다. 아래의 수식에서 예비신호음이 1번 내지 2번만 발생할 수 있도록 도와주세요.감사합니다.Input : MaxSounds(1);Var: SoundCount(0);If Index != Index[1] Then { SoundCount = 0;}If CrossUp(ma(C,5),ma(C,20))and (DayIndex >= 4)and (Time < 151000)Then { If SoundCount < MaxSounds Then { PlaySound("C:\Windows\Media\보낸 호출.wav"); // 예비 경보음 SoundCount = SoundCount + 1; } Buy("매수", OnClose, Def, 1); }
답변완료
문의드립니다.
아래와 같이 진입청산식에서 평균 진입가격에 청상한다고 가정 한다면 평균 진입가격이 아닌 진입가격 기준으로 변경하고자 합니다.수직을 변경하여 주시면 감사하겠습니다. ExitLong("bp9",atlimit,AvgEntryPrice+PriceScale*익절틱수b9,"b9"); ExitLong("bl9",AtStop,AvgEntryPrice-PriceScale*손절틱수b9,"b9"); ExitLong("bp91",atlimit,AvgEntryPrice+PriceScale*익절틱수b91,"b91"); ExitLong("bl91",AtStop,AvgEntryPrice-PriceScale*손절틱수b91,"b91");