Time Zone Code

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #121786 quote
    Alfred
    Participant
    Average

    Hi,

    I have some confused, when I need to amend the code? And how to amend to align with my time zone. Such as follows.

    May I know the time 000000 to 200000, if my time zone is GMT+8. The code any update? thanks.

    //ctime = time >= 000000 and time <= 220000
    
    Horaire = time >= 000000 and time <= 200000

    Thanks!

    #121794 quote
    robertogozzi
    Moderator
    Master

    >> For clarity of messages on ProRealCode’s forums, please use the “insert code PRT” button to separate the text of the code part! Thank you! << 🙂

    #121795 quote
    robertogozzi
    Moderator
    Master

    You need to set dates in this range:

    Horaire = time >= 080000 and time <= 040000  //would be 280000 arithmetically

    since the starting time is greater than the ending time, it’s a bit more complicated:

    //Horaire = time >= 080000 and time <= 040000
    Horaire = (time >= 080000) or (time >= 000000 and time <= 040000)

    (not tested)

    #121798 quote
    Alfred
    Participant
    Average

    Thanks! robertogozzi

    I have one more question on the time zone code

    defparam flatbefore=090000
    defparam flatafter=173000

    If GMT+8, it will be

    defparam flatbefore=170000 
    defparam flatafter=253000

    Right? thanks.

    #121801 quote
    robertogozzi
    Moderator
    Master

    No, I think you’d better not use DEFPARAM FlatBefore and FlatAfter, because 253000 is 013000 and it would conflict with FlatBefore which comes after.

    You’d better use TIME to select the range of time you want to trade, such as:

    TradingTime = (time >= 170000) OR ((time >= 000000) AND (time < 013000))

    and also use TIME to close open trades at 013000:

    IF time = 013000 THEN  //close ALL open trades, if any,
       SELL AT MARKET      //no matter whether Long
       EXITSHORT AT MARKET //or Short ones
    ENDIF
Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.

Time Zone Code


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
Alfred @kin08180213 Participant
Summary

This topic contains 4 replies,
has 2 voices, and was last updated by robertogozzi
5 years, 11 months ago.

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 03/11/2020
Status: Active
Attachments: No files
Logo Logo
Loading...