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 < 1 Then
buy("b",atlimit,dayhigh-PriceScale*1200);
if MarketPosition == 1 Then
exitlong("bx",atlimit,lowest(L,BarsSinceEntry)+PriceScale*1000);
if MarketPosition >= 0 and entry < 1 Then
sell("s",atlimit,daylow+PriceScale*400);
if MarketPosition == -1 Then
ExitShort("sx",atlimit,Highest(H,BarsSinceEntry)-PriceScale*200);
if sdate != sdate[1] Then
SetStopEndofday(54000);
if bdate != bdate[1] Then
SetStopEndofday(0);
07시로 매매 시작시간을 넣고자 합니다
------------------------
아래 수식어를 부탁드립니다.
해외선물 매매시간 0900~ 익일0500
익절100 손절 100
매수 -100틱 +100틱
매도 +100틱 -100틱
답변 1
예스스탁
예스스탁 답변
2024-03-27 16:11:36
안녕하세요
예스스탁입니다.
input : StartTime(90000),EndTime(050000);
input : 익절틱수(100),손절틱수(100);
var : Tcond(False);
var : entry(0);
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;
entry = 0;
IF Endtime <= starttime Then
{
SetStopEndofday(0);
}
}
if (MarketPosition != 0 and MarketPosition != MarketPosition[1]) or
(MarketPosition == MarketPosition[1] and TotalTrades > TotalTrades[1]) Then
entry = entry+1;
if Tcond == true Then
{
if MarketPosition <= 0 and entry < 1 Then
buy("b",atlimit,dayhigh-PriceScale*1200);
if MarketPosition == 1 Then
exitlong("bx",atlimit,lowest(L,BarsSinceEntry)+PriceScale*1000);
if MarketPosition >= 0 and entry < 1 Then
sell("s",atlimit,daylow+PriceScale*400);
if MarketPosition == -1 Then
ExitShort("sx",atlimit,Highest(H,BarsSinceEntry)-PriceScale*200);
}
SetStopProfittarget(PriceScale*익절틱수,PointStop);
SetStopLoss(PriceScale*손절틱수,PointStop);
즐거운 하루되세요
> 푸른 님이 쓴 글입니다.
> 제목 : 문의 드립니다
> 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 < 1 Then
buy("b",atlimit,dayhigh-PriceScale*1200);
if MarketPosition == 1 Then
exitlong("bx",atlimit,lowest(L,BarsSinceEntry)+PriceScale*1000);
if MarketPosition >= 0 and entry < 1 Then
sell("s",atlimit,daylow+PriceScale*400);
if MarketPosition == -1 Then
ExitShort("sx",atlimit,Highest(H,BarsSinceEntry)-PriceScale*200);
if sdate != sdate[1] Then
SetStopEndofday(54000);
if bdate != bdate[1] Then
SetStopEndofday(0);
07시로 매매 시작시간을 넣고자 합니다
------------------------
아래 수식어를 부탁드립니다.
해외선물 매매시간 0900~ 익일0500
익절100 손절 100
매수 -100틱 +100틱
매도 +100틱 -100틱