Help needed to understand a basic concept

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #25500 quote
    Stefan Joubert
    Participant
    New

    Hello everyone,

    I am just starting with prorealtime and starting with coding.

    I have read the manual, but I am a little confused as to how to access the high and low of a particular bar.

    Let’s say I want to trade the DAX and at 11:35am I want to find the high and low of the 5 minute bar and then trade LONG if the market breaks above the 5 minute bar at 11:35am, how can I do this?

    My biggest question is how to access a particular 5 min bar at a particular time. How can I access this information?

     

    Any help will be GREATLY appreciated!

    Kindest regards,

    Stefan

    #25742 quote
    robertogozzi
    Moderator
    Master

    You may either:

    1) wait the time you want (within th 5-minute timeframe) and save both high and low values in two separate variables; of course the day you launch your strategy it’ll wait the next 11:35:00 candle which might be the nest day.

    2) being in a 5-minute timeframe you may access the required bar using brackets after high/low and computing the index based on the fact that an hour has 12 bars; you have to retrieve current time an then compute how many bars have elapsed since 11:35:00 and use that numer as an index (i.e. HIGH[32] and LOW[32] to access the values of the 32nd bar previous the current one). This calculation is not as straithforeward, but it allows not to have to wait the next day to retrieve desired data.

    Here is an example for option 1:

    ONCE HighestPrice = 0
    ONCE LowestPrice  = 0
       .
       .                     //Place here any further variable or piece of code
       .
    IF time = 113500 THEN    //These values will be updated each day at
       HighestPrice = high   //11:35:00
       LowestPrice  = low
    ENDIF
       .
       .                     //Place here any further piece of code or condition or Buy/Sell order
       .
    

    Hope it’s what you you were looking for.

    #25985 quote
    Stefan Joubert
    Participant
    New

    Hi Roberto – this really helps a lot!

    Thank you so much!

    Have a wonderful day ahead!

    robertogozzi thanked this post
Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.

Help needed to understand a basic concept


ProOrder: Automated Strategies & Backtesting

New Reply
Author
Summary

This topic contains 2 replies,
has 2 voices, and was last updated by Stefan Joubert
9 years ago.

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 02/18/2017
Status: Active
Attachments: No files
Logo Logo
Loading...