Input : 하락폭(16), 상승폭(70), 손절값(0);
input : StartTime(70000),EndTime(60000);
var : Tcond(false);
IF Endtime > starttime Then
SetStopEndofday(Endtime);
Else
{
if sDate != sDate[1] Then
SetStopEndofday(Endtime);
}
if (sdate != sdate[1] and stime >= EndTime) or
(sdate == sdate[1] and stime >= EndTime and stime[1] < EndTime) Then
Tcond = False;
if (sdate != sdate[1] and stime >= StartTime) or
(sdate == sdate[1] and stime >= StartTime and stime[1] < StartTime) Then
{
Tcond = true;
IF Endtime <= starttime Then
{
SetStopEndofday(0);
}
}
Var : Entry(0);
if Bdate != Bdate[1] Then
{
Entry = 0;
}
if (MarketPosition != 0 and MarketPosition != MarketPosition[1]) or
(MarketPosition == MarketPosition[1] and TotalTrades > TotalTrades[1]) Then
Entry = Entry + 2;
if MarketPosition == 0 and Entry < 2 Then
{
if Bdate != NextBarSdate Then
Buy("B1",AtLimit,NextBarOpen-(PriceScale*하락폭));
Else if Bdate == Bdate[1] Then
Buy("B2",AtLimit,DayOpen-(PriceScale*하락폭));
}
SetStopProfittarget(PriceScale*상승폭,PointStop);
SetStopLoss(PriceScale*손절값,PointStop);
위 수식어를 진입 2회로 부탁드립니다.
미리 감사드립니다.
답변 1
예스스탁
예스스탁 답변
2023-03-16 14:24:58
안녕하세요
예스스탁입니다.
Entry = Entry + 2;
진입발생시마다 2씩 증가가게 되어 있는데 1씩 증가하게 하시면 됩니다.
수정한 식입니다.
Input : 하락폭(16), 상승폭(70), 손절값(0);
input : StartTime(70000),EndTime(60000);
var : Tcond(false);
IF Endtime > starttime Then
SetStopEndofday(Endtime);
Else
{
if sDate != sDate[1] Then
SetStopEndofday(Endtime);
}
if (sdate != sdate[1] and stime >= EndTime) or
(sdate == sdate[1] and stime >= EndTime and stime[1] < EndTime) Then
Tcond = False;
if (sdate != sdate[1] and stime >= StartTime) or
(sdate == sdate[1] and stime >= StartTime and stime[1] < StartTime) Then
{
Tcond = true;
IF Endtime <= starttime Then
{
SetStopEndofday(0);
}
}
Var : Entry(0);
if Bdate != Bdate[1] Then
{
Entry = 0;
}
if (MarketPosition != 0 and MarketPosition != MarketPosition[1]) or
(MarketPosition == MarketPosition[1] and TotalTrades > TotalTrades[1]) Then
Entry = Entry + 1;
if MarketPosition == 0 and Entry < 2 Then
{
if Bdate != NextBarSdate Then
Buy("B1",AtLimit,NextBarOpen-(PriceScale*하락폭));
Else if Bdate == Bdate[1] Then
Buy("B2",AtLimit,DayOpen-(PriceScale*하락폭));
}
SetStopProfittarget(PriceScale*상승폭,PointStop);
SetStopLoss(PriceScale*손절값,PointStop);
즐거운 하루되세요
> 푸른 님이 쓴 글입니다.
> 제목 : 문의드립니다
> Input : 하락폭(16), 상승폭(70), 손절값(0);
input : StartTime(70000),EndTime(60000);
var : Tcond(false);
IF Endtime > starttime Then
SetStopEndofday(Endtime);
Else
{
if sDate != sDate[1] Then
SetStopEndofday(Endtime);
}
if (sdate != sdate[1] and stime >= EndTime) or
(sdate == sdate[1] and stime >= EndTime and stime[1] < EndTime) Then
Tcond = False;
if (sdate != sdate[1] and stime >= StartTime) or
(sdate == sdate[1] and stime >= StartTime and stime[1] < StartTime) Then
{
Tcond = true;
IF Endtime <= starttime Then
{
SetStopEndofday(0);
}
}
Var : Entry(0);
if Bdate != Bdate[1] Then
{
Entry = 0;
}
if (MarketPosition != 0 and MarketPosition != MarketPosition[1]) or
(MarketPosition == MarketPosition[1] and TotalTrades > TotalTrades[1]) Then
Entry = Entry + 2;
if MarketPosition == 0 and Entry < 2 Then
{
if Bdate != NextBarSdate Then
Buy("B1",AtLimit,NextBarOpen-(PriceScale*하락폭));
Else if Bdate == Bdate[1] Then
Buy("B2",AtLimit,DayOpen-(PriceScale*하락폭));
}
SetStopProfittarget(PriceScale*상승폭,PointStop);
SetStopLoss(PriceScale*손절값,PointStop);
위 수식어를 진입 2회로 부탁드립니다.
미리 감사드립니다.