커뮤니티

질의

프로필 이미지
블루3
2026-01-25 00:43:33
96
글번호 230050
답변완료

input : 시작일(20260101),시작시간(090000);

input : 이평1(180),이평2(15);

input : 윌리엄스R기간값(14);

input : 손절틱수(100),목표틱수(200),트레일링스탑틱수(100);

var : mav1(0),WR(0);


if sdate >=  시작일 and sTime >= 시작시간 Then

{

Condition1 = true;

Condition2 = true;

}


MAV1 = MA(c,이평1);

WR = WILLR(윌리엄스R기간값);


if TotalTrades > TotalTrades and IsExitName("StopLoss",1) ==true Then

Condition2 = False;


if  Condition1 == true and Condition2 == true Then


{

if MarketPosition == 0 and c  < mav1 and CrossDown(WR, -20) Then

Sell("s");


if MarketPosition == -1 Then


{


if lowest(L,BarsSinceEntry) <= EntryPrice-PriceScale*목표틱수 Then

ExitShort("str",AtStop,EntryPrice-PriceScale*트레일링스탑틱수);

}

SetStopLoss(PriceScale*손절틱수,PointStop);

}



위의 수식은 손절이 되면은 더이상 진입이 안되게 하려고 한것인데요..


실전에서는 아직 확인 안되었지만 시물레이셔나트나 시험적용에서는 손절 후 진입신호가 나오는데,


원래 그런 것인지 아니면 수식이 잘못 된 것인지 알고 싶습니다.


감사합니다..


수고하세요..



시스템
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2026-01-26 13:53:37

안녕하세요 예스스탁입니다. 변수가 지정일 지정시간 이후에도 초기화가 됩니다. 초기화가 안되고 수정해 드립니다. Input : 시작일(20260101),시작시간(090000); input : 이평1(180),이평2(15); input : 윌리엄스R기간값(14); input : 손절틱수(100),목표틱수(200),트레일링스탑틱수(100); var : mav1(0),WR(0); if Condition1 == False and sdate >= 시작일 and sTime >= 시작시간 Then { Condition1 = true; Condition2 = true; } MAV1 = MA(c,이평1); WR = WILLR(윌리엄스R기간값); if TotalTrades > TotalTrades[1] and IsExitName("StopLoss",1) ==true Then Condition2 = False; if Condition1 == true and Condition2 == true Then { if MarketPosition == 0 and c < mav1 and CrossDown(WR, -20) Then Sell("s"); if MarketPosition == -1 Then { if lowest(L,BarsSinceEntry) <= EntryPrice-PriceScale*목표틱수 Then ExitShort("str",AtStop,EntryPrice-PriceScale*트레일링스탑틱수); } SetStopLoss(PriceScale*손절틱수,PointStop); } 즐거운 하루되세요