커뮤니티

(문의) CRT 기준 03:00 시스템 가동 및 15:40 EndofDay되게하는 방법 건

프로필 이미지
green73
2017-01-23 23:13:05
109
글번호 106219
답변완료
안녕하세요. 매매 시간을 Current Real Time 기준(미국 CME) 03:00 ~ 15:40까지만 거래하고 싶은데 Simulation 차트 보니까 연속적으로 거래되어 집니다.. CRT 기준 03:00에 시스템이 가동되어 15:40에 EndofDay가 되게하려면 어떻게 해야하는지 도움을 부탁 드립니다. 아래는 작성한 Code 입니다. 그럼, 부탁 드리겠습니다. # 1. Definition for Variables Inputs : OP1(0.3), SL(60) ; Var1 = DayHigh(1) - DayLow(1) ; # 2. Conditions for Entering Position if stime >= 030000 Then { Buy("Long", AtStop, DayOpen(0) + Var1*OP1) ; Sell("Short", AtStop, DayOpen(0) - Var1*Op1) ; } # 3. Conditions for Settling Position if MarketPosition != 0 then { SetStopTrailing(35, 0.8, PercentStop) ; } # 4. Conditions for Loss Cut SetStopLoss(PriceScale*SL, PointStop) ; # 5. Daily Settlement If stime == 154000 Then { ExitLong("EL", AtMarket) ; ExitShort("ES", AtMarket) ; }
시스템
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2017-01-24 17:01:21

안녕하세요 예스스탁입니다. 진입식에 03시 이후면 진입이 집행되게 되어 있으므로 종료시간 조건도 같이 추가해 주셔야 합니다. # 1. Definition for Variables Inputs : OP1(0.3), SL(60) ; Var1 = DayHigh(1) - DayLow(1) ; # 2. Conditions for Entering Position if stime >= 030000 and stime < 154000 Then { Buy("Long", AtStop, DayOpen(0) + Var1*OP1) ; Sell("Short", AtStop, DayOpen(0) - Var1*Op1) ; } # 3. Conditions for Settling Position if MarketPosition != 0 then { SetStopTrailing(35, 0.8, PercentStop) ; } # 4. Conditions for Loss Cut SetStopLoss(PriceScale*SL, PointStop) ; # 5. Daily Settlement If stime == 154000 Then { ExitLong("EL", AtMarket) ; ExitShort("ES", AtMarket) ; } 즐거운 하루되세요 > green73 님이 쓴 글입니다. > 제목 : (문의) CRT 기준 03:00 시스템 가동 및 15:40 EndofDay되게하는 방법 건 > 안녕하세요. 매매 시간을 Current Real Time 기준(미국 CME) 03:00 ~ 15:40까지만 거래하고 싶은데 Simulation 차트 보니까 연속적으로 거래되어 집니다.. CRT 기준 03:00에 시스템이 가동되어 15:40에 EndofDay가 되게하려면 어떻게 해야하는지 도움을 부탁 드립니다. 아래는 작성한 Code 입니다. 그럼, 부탁 드리겠습니다. # 1. Definition for Variables Inputs : OP1(0.3), SL(60) ; Var1 = DayHigh(1) - DayLow(1) ; # 2. Conditions for Entering Position if stime >= 030000 Then { Buy("Long", AtStop, DayOpen(0) + Var1*OP1) ; Sell("Short", AtStop, DayOpen(0) - Var1*Op1) ; } # 3. Conditions for Settling Position if MarketPosition != 0 then { SetStopTrailing(35, 0.8, PercentStop) ; } # 4. Conditions for Loss Cut SetStopLoss(PriceScale*SL, PointStop) ; # 5. Daily Settlement If stime == 154000 Then { ExitLong("EL", AtMarket) ; ExitShort("ES", AtMarket) ; }