커뮤니티
수식 추가
2018-05-15 09:44:51
193
글번호 118900
아래는 선물에 사용하는 buy 수식입니다.
손절,익절,trailing stop이 시스템설정창에 있지만
시뮬레이션을 위해 수식을 input에 추가하고 싶습니다.
"손절,익절,최대수익대비하락은 설정기준이 %인지 pt인지 틱인지에 따라 수식이 다릅니다"
위와 같은 이유가 있으므로,
아래 수식에 대해 설정기준을 pt와 틱 2가지로 구분하여
손절,익절,trailing stop 수식을 input에 추가하여 주시기 바랍니다.
********************************************************************************
input : 진입시간(100000),진입제한시간(120000),트레이드종료시간(150000);
Inputs: DMILen(14), Consec(3), MinDiff(0);
Var : DMIDiff(0);
var : Tcond(false);
if (sdate != sdate[1] and stime >= 진입시간) or
(sdate == sdate[1] and stime >= 진입시간 and stime[1] < 진입시간) Then
Tcond = true;
if (sdate != sdate[1] and stime >= 진입제한시간) or
(sdate == sdate[1] and stime >= 진입제한시간 and stime[1] < 진입제한시간) Then
Tcond = false;
if (sdate != sdate[1] and stime >= 트레이드종료시간) or
(sdate == sdate[1] and stime >= 트레이드종료시간 and stime[1] < 트레이드종료시간) Then
exitlong();
DMIDiff = DIPlus(DMILen) - DIMinus(DMILen);
If DMIDiff[Consec] > 0 and Tcond == true Then Begin
If DMIDiff >= MinDiff AND CountIF(DMIDiff > DMIDiff[1], Consec) == Consec Then
Buy ("DMI");
End;
답변 1
예스스탁 예스스탁 답변
2018-05-15 13:39:43
안녕하세요
예스스탁입니다.
1.포인트
input : 진입시간(100000),진입제한시간(120000),트레이드종료시간(150000);
input : 손절포인트(1),수익포인트(3),수익감소포인트(1),최소수익포인트(2);
Inputs: DMILen(14), Consec(3), MinDiff(0);
Var : DMIDiff(0);
var : Tcond(false);
if (sdate != sdate[1] and stime >= 진입시간) or
(sdate == sdate[1] and stime >= 진입시간 and stime[1] < 진입시간) Then
Tcond = true;
if (sdate != sdate[1] and stime >= 진입제한시간) or
(sdate == sdate[1] and stime >= 진입제한시간 and stime[1] < 진입제한시간) Then
Tcond = false;
if (sdate != sdate[1] and stime >= 트레이드종료시간) or
(sdate == sdate[1] and stime >= 트레이드종료시간 and stime[1] < 트레이드종료시간) Then
exitlong();
DMIDiff = DIPlus(DMILen) - DIMinus(DMILen);
If DMIDiff[Consec] > 0 and Tcond == true Then Begin
If DMIDiff >= MinDiff AND CountIF(DMIDiff > DMIDiff[1], Consec) == Consec Then
Buy ("DMI");
End;
SetStopProfittarget(수익포인트,PointStop);
SetStopLoss(손절포인트,PointStop);
SetStopTrailing(수익감소포인트,최소수익포인트,PointStop);
2 틱수
input : 진입시간(100000),진입제한시간(120000),트레이드종료시간(150000);
input : 손절틱수(10),수익틱수(30),수익감소틱수(10),최소수익틱수(20);
Inputs: DMILen(14), Consec(3), MinDiff(0);
Var : DMIDiff(0);
var : Tcond(false);
if (sdate != sdate[1] and stime >= 진입시간) or
(sdate == sdate[1] and stime >= 진입시간 and stime[1] < 진입시간) Then
Tcond = true;
if (sdate != sdate[1] and stime >= 진입제한시간) or
(sdate == sdate[1] and stime >= 진입제한시간 and stime[1] < 진입제한시간) Then
Tcond = false;
if (sdate != sdate[1] and stime >= 트레이드종료시간) or
(sdate == sdate[1] and stime >= 트레이드종료시간 and stime[1] < 트레이드종료시간) Then
exitlong();
DMIDiff = DIPlus(DMILen) - DIMinus(DMILen);
If DMIDiff[Consec] > 0 and Tcond == true Then Begin
If DMIDiff >= MinDiff AND CountIF(DMIDiff > DMIDiff[1], Consec) == Consec Then
Buy ("DMI");
End;
SetStopProfittarget(수익틱수*PriceScale,PointStop);
SetStopLoss(손절틱수*PriceScale,PointStop);
SetStopTrailing(수익감소틱수*PriceScale,최소수익틱수*PriceScale,PointStop);
즐거운 하루되세요
> 목마와숙녀 님이 쓴 글입니다.
> 제목 : 수식 추가
> 아래는 선물에 사용하는 buy 수식입니다.
손절,익절,trailing stop이 시스템설정창에 있지만
시뮬레이션을 위해 수식을 input에 추가하고 싶습니다.
"손절,익절,최대수익대비하락은 설정기준이 %인지 pt인지 틱인지에 따라 수식이 다릅니다"
위와 같은 이유가 있으므로,
아래 수식에 대해 설정기준을 pt와 틱 2가지로 구분하여
손절,익절,trailing stop 수식을 input에 추가하여 주시기 바랍니다.
********************************************************************************
input : 진입시간(100000),진입제한시간(120000),트레이드종료시간(150000);
Inputs: DMILen(14), Consec(3), MinDiff(0);
Var : DMIDiff(0);
var : Tcond(false);
if (sdate != sdate[1] and stime >= 진입시간) or
(sdate == sdate[1] and stime >= 진입시간 and stime[1] < 진입시간) Then
Tcond = true;
if (sdate != sdate[1] and stime >= 진입제한시간) or
(sdate == sdate[1] and stime >= 진입제한시간 and stime[1] < 진입제한시간) Then
Tcond = false;
if (sdate != sdate[1] and stime >= 트레이드종료시간) or
(sdate == sdate[1] and stime >= 트레이드종료시간 and stime[1] < 트레이드종료시간) Then
exitlong();
DMIDiff = DIPlus(DMILen) - DIMinus(DMILen);
If DMIDiff[Consec] > 0 and Tcond == true Then Begin
If DMIDiff >= MinDiff AND CountIF(DMIDiff > DMIDiff[1], Consec) == Consec Then
Buy ("DMI");
End;
다음글
이전글