Indicator for setting previous day HLOC

Forums ProRealTime English forum ProBuilder support Indicator for setting previous day HLOC

Viewing 6 posts - 1 through 6 (of 6 total)
  • #182180

    Hi,

    Currently each morning I set previous day high (PDH), low (PDL), market open (PDMO) and market close (PDC) manually by adding lines to the chart. Since I am following 20+ markets and have custom alerts setup, it’s quite tedious to do this task every day. When the alert comes in, I check the relation between price/alert and the PD lines. Going through the code, I can see that I can add an indicator with DRAWHLINE and DRAWTEXT to achieve this, but I could not find a way to define a time frame for the code to look into, i.e. e.g. when looking at DAX I want the indicator to only look at the bars between 9:00-17:30. Since DAX is an index the data available is 24/6, but this is not what I want the Indicator to take into the consideration.

    I was thinking of using IF statement to check the bar data, such as time and date and compare it with the requirements, but unfortunately I cannot find an instruction or peace of code which could help me to verify the bar datetime value.

    If anyone has a better idea how to achieve the required I would be very grateful.

    Here is a view of the chart and lines I have currently setup manually.

    #182184

    Also to add, I would like the Indicator to use the calculation from specific time frame, e.g. 5 min time frame, so that if I change the time frame to 1 min, it is not recalculating the values. I just noticed, that if I use the example code provided in one of the articles, it will recalculate the values:

    #182185

    It will ALWAYS recalculates itself at any change, be it the TF, the number of units or any of its settings.

    This is the correct behavior.

    You will have to use IF…ENDIF to select the time window you are interested in.

    Use the correct forum, for indicators it’s ProBuilder. I moved it from General trading discussion.

    Thank you 🙂

    #182187

    Thank you, for your help on moving the topic to the correct group and for you reply.

    Can you please advise how to validate the time window in the IF ENDIF statement, i.e. could you please provide an example?

    #182197

    There you go:

    1 user thanked author for this post.
    #182508

    Thank you! This is a good start. Will tweak it a bit and post it here for others to use.

    1 user thanked author for this post.
Viewing 6 posts - 1 through 6 (of 6 total)

Create your free account now and post your request to benefit from the help of the community
Register or Login