답변완료
문의 드립니다
input : StartTime(210000),EndTime(50000),진입횟수(100);
input : 익절틱수(150),손절틱수(60);
Inputs: Length(1), Pval(0.01);
var : Tcond(False),entry(0);
Variables: Mom(0);
IF Endtime > starttime Then
SetStopEndofday(Endtime);
Else
{
if sDate != sDate[1] Then
SetStopEndofday(Endtime);
}
if (sdate != sdate[1] and stime >= StartTime) or
(sdate == sdate[1] and stime >= StartTime and stime[1] < StartTime) Then
{
Tcond = true;
entry = 0;
IF Endtime <= starttime Then
{
SetStopEndofday(0);
}
}
if (sdate != sdate[1] and stime >= EndTime) or
(sdate == sdate[1] and stime >= EndTime and stime[1] < EndTime) Then
{
Tcond = False;
}
if (MarketPosition != 0 and MarketPosition != MarketPosition[1]) or
(MarketPosition == MarketPosition[1] and TotalTrades > TotalTrades[1]) Then
entry = entry+1;
Mom = C- C[Length];
if Tcond == true and entry < 진입횟수 Then
{
If Mom > 0 AND Mom >= Mom[1] AND MarketPosition() <> 1 Then
Buy ("Mom_LE", AtStop, High + Pval);
If Mom < 0 AND Mom <= Mom[1] AND MarketPosition() <> -1 Then
ExitLong ("Mom_SE", AtStop, Low - Pval);
}
SetStopProfittarget(PriceScale*익절틱수,PointStop);
SetStopLoss(PriceScale*손절틱수,PointStop);
-----------------
당일 목표수익 200틱, 손절 100틱에 매매정지로 변경하고자 합니다.
늘 감사드립니다.
2023-09-05
732
글번호 172135
시스템