CNE 거래시
아래식에서
매매시작시간과 종료시간을 설정하고 싶은데
도움 바랍니다.
input : N(10);
if NextBarSdate != sDate Then
{
      Buy("b1",AtStop,NextBarOpen+PriceScale*n);
      Sell("s1",AtStop,NextBarOpen-PriceScale*n);
}
Else
{
      if MarketPosition <= 0 or (MarketPosition == 1 and MaxEntries < 3 and h < DayOpen+PriceScale*10) Then
            Buy("b2",AtStop,DayOpen+PriceScale*n);
      if MarketPosition >= 0 or (MarketPosition == -1 and MaxEntries < 3 and L > DayOpen-PriceScale*10) Then
            Sell("s2",AtStop,DayOpen-PriceScale*n);
}
답변 1
예스스탁
예스스탁 답변
2022-11-15 11:06:20
안녕하세요
예스스탁입니다.
input : N(10);
input : StartTime(80000),EndTime(65000);
var : Tcond(false);
IF Endtime > starttime Then
SetStopEndofday(Endtime);
Else
{
if sDate != sDate[1] Then
SetStopEndofday(Endtime);
}
if (NextBarSdate != sdate and NextBarStime >= EndTime) or
(NextBarSdate == sdate and NextBarStime >= EndTime and stime < EndTime) Then
Tcond = False;
if (NextBarSdate != sdate and NextBarStime >= StartTime) or
(NextBarSdate == sdate and NextBarStime >= StartTime and stime < StartTime) Then
{
Tcond = true;
IF Endtime <= starttime Then
{
SetStopEndofday(0);
}
}
if (NextBarSdate != sdate and NextBarStime >= StartTime) or
(NextBarSdate == sdate and NextBarStime >= StartTime and stime < StartTime) Then
{
Buy("b1",AtStop,NextBarOpen+PriceScale*n);
Sell("s1",AtStop,NextBarOpen-PriceScale*n);
}
Else
{
if Tcond == true Then
{
if MarketPosition <= 0 or (MarketPosition == 1 and MaxEntries < 3 and h < DayOpen+PriceScale*10) Then
Buy("b2",AtStop,DayOpen+PriceScale*n);
if MarketPosition >= 0 or (MarketPosition == -1 and MaxEntries < 3 and L > DayOpen-PriceScale*10) Then
Sell("s2",AtStop,DayOpen-PriceScale*n);
}
}
즐거운 하루되세요
> 예스요 님이 쓴 글입니다.
> 제목 : 문의 드립니다.~~~~
> CNE 거래시
아래식에서
매매시작시간과 종료시간을 설정하고 싶은데
도움 바랍니다.
input : N(10);
if NextBarSdate != sDate Then
{
      Buy("b1",AtStop,NextBarOpen+PriceScale*n);
      Sell("s1",AtStop,NextBarOpen-PriceScale*n);
}
Else
{
      if MarketPosition <= 0 or (MarketPosition == 1 and MaxEntries < 3 and h < DayOpen+PriceScale*10) Then
            Buy("b2",AtStop,DayOpen+PriceScale*n);
      if MarketPosition >= 0 or (MarketPosition == -1 and MaxEntries < 3 and L > DayOpen-PriceScale*10) Then
            Sell("s2",AtStop,DayOpen-PriceScale*n);
}