커뮤니티

시스템 매매 분할매수 관련 수정문의 합니다...

프로필 이미지
서민순
2026-03-14 14:57:46
62
글번호 231072
답변완료

*아래 시스템 매매수식에서 20분할로 분할매수를 할려고 합니다..

추가적으로 날짜를 변수로 하고 싶습니다...

  아래수식좀 수정 부탁드립니다...


input : ATRperiod(14);

input : BBperiod(20);

input : BBdeviation(1.5);

input : UseATRfilter(true);

input : showsignals(true);

var : BBupper(0),BBlower(0),alpha(0),atrValue(0);

var : FollowLine(Nan),BBSignal(0),iTrend(0);


BBUpper = ma(close, BBperiod) + std(close, BBperiod) * BBdeviation;

BBLower = ma(close, BBperiod) - std(close, BBperiod) * BBdeviation;


alpha = 1 / ATRperiod ;

atrValue =  IFf(IsNan(atrValue[1]) == true, ma(TrueRange,ATRperiod) , alpha * TrueRange + (1 - alpha) * IFf(isnan(atrValue[1])==true,0,atrValue[1]));


if (close > BBUpper) Then

    BBSignal = 1;

else if (close < BBLower) Then

    BBSignal = -1;


if (BBSignal == 1)  Then

{

    if (UseATRfilter)  Then

      {

        FollowLine = low - atrValue;

      }

    else

      {

        FollowLine = low;

      }

    if (FollowLine < iff(IsNan(FollowLine[1])==true,0,FollowLine[1])) Then

      {

        FollowLine = iff(IsNan(FollowLine[1])==true,0,FollowLine[1]);

      }

}


if (BBSignal == -1) Then

{

    if (UseATRfilter) Then

      {

        FollowLine = high + atrValue;

      }

    else

      {

        FollowLine = high;

      }

    if (FollowLine > iff(IsNan(FollowLine[1])==true,0,FollowLine[1])) Then

      {

        FollowLine = iff(IsNan(FollowLine[1])==true,0,FollowLine[1]);

      }

}


if iff(IsNan(FollowLine)==true,0,FollowLine) > iff(IsNan(FollowLine[1])==true,0,FollowLine[1]) Then

    iTrend = 1;

else if iff(IsNan(FollowLine)==true,0,FollowLine) < iff(IsNan(FollowLine[1])==true,0,FollowLine[1]) Then

    iTrend = -1;


var : lineColor(0),B(0),S(0),tx(0);


lineColor = iff(iTrend > 0 , Gold , Blue);


if lineColor != lineColor[1] and lineColor == Blue Then

Buy();

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

예스스탁 예스스탁 답변

2026-03-16 12:26:16

안녕하세요 예스스탁입니다. 분할매수가 어떤 조건인지 불명확합니다. 동일조건으로 추가매수하는 것으로 보고 작성해 드립니다. 시스템 적용시 설정화면에서 피라미딩을 모든진입신호 허용으로 설정하고 적용하시면 됩니다. input : ATRperiod(14); input : BBperiod(20); input : BBdeviation(1.5); input : UseATRfilter(true); input : showsignals(true); input : 진입시작일(20160316),최대누적진입횟수(20); var : BBupper(0),BBlower(0),alpha(0),atrValue(0); var : FollowLine(Nan),BBSignal(0),iTrend(0); BBUpper = ma(close, BBperiod) + std(close, BBperiod) * BBdeviation; BBLower = ma(close, BBperiod) - std(close, BBperiod) * BBdeviation; alpha = 1 / ATRperiod ; atrValue =IFf(IsNan(atrValue[1]) == true, ma(TrueRange,ATRperiod) , alpha * TrueRange + (1 - alpha) * IFf(isnan(atrValue[1])==true,0,atrValue[1])); if (close > BBUpper) Then BBSignal = 1; else if (close < BBLower) Then BBSignal = -1; if (BBSignal == 1)Then { if (UseATRfilter)Then { FollowLine = low - atrValue; } else { FollowLine = low; } if (FollowLine < iff(IsNan(FollowLine[1])==true,0,FollowLine[1])) Then { FollowLine = iff(IsNan(FollowLine[1])==true,0,FollowLine[1]); } } if (BBSignal == -1) Then { if (UseATRfilter) Then { FollowLine = high + atrValue; } else { FollowLine = high; } if (FollowLine > iff(IsNan(FollowLine[1])==true,0,FollowLine[1])) Then { FollowLine = iff(IsNan(FollowLine[1])==true,0,FollowLine[1]); } } if iff(IsNan(FollowLine)==true,0,FollowLine) > iff(IsNan(FollowLine[1])==true,0,FollowLine[1]) Then iTrend = 1; else if iff(IsNan(FollowLine)==true,0,FollowLine) < iff(IsNan(FollowLine[1])==true,0,FollowLine[1]) Then iTrend = -1; var : lineColor(0),B(0),S(0),tx(0); lineColor = iff(iTrend > 0 , Gold , Blue); if lineColor != lineColor[1] and lineColor == Blue and sDate >= 진입시작일 and (MarketPosition == 0 or (MarketPosition == 1 and MaxEntries < 최대누적진입횟수)) Then Buy(); 즐거운 하루되세요