How can dhigh(0) be re-calibrated to start at 08:00?

Forums ProRealTime English forum ProBuilder support How can dhigh(0) be re-calibrated to start at 08:00?

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

    I have developed an indicator that displays the % of the 5 day ATR that has been consumed during an intraday trading session. It works perfectly apart from one aspect, which is the time of day it starts to read data. The intention is for the indicator to only start measuring price movement against the 5 day ATR during cash trading hours (i.e. 08:00 -16:30 UK time for the DAX & FTSE). The flaw in my code is that the indicator starts measuring price movement from the start of the trading day i.e. midnight. I think the issue is that I have needed to use the dhigh(0) and dlow(0) variables, and this causes the indicator to start its calculations too early i.e. midnight instead of 08:00. I need some way of re-calibrating dhigh(0)/dlow(0) to start at 08:00.  The only way I have been able to see the indicator perform as intended has been to manually change the trading hours range to 08:00-16:30  in platform settings. Then the indicator works perfectly, but the problem is I cannot see any price action before 08:00, so I want to try and solve the problem through coding. I have attached the code and some screenshots of how the indicator should look compared to how it does look. I will be very grateful if someone can help.

    #40499
    AVT

    If your day is just from 8-5 you should define something like MyDayOpen to let the program know your days are shorter. Just an idea.

    #40501
    AVT

    I just insert your code here -> you click onto the <> button and can copy & paste your code, so people don’t have to download it. (Btw. I have a unix system and can’t open the other file)

    #40565

    Hi Neilla – I had similar issue a while back and yeh was going to say the same thing – only way I found was to change the trading hours

    I no longer use that indicator as it was very limiting for other strategies having the trading hours ‘crippled’ like that but if this is your main strategy perhaps setup your live PRT with the edited trading hours and the demo PRT with the default trading hours and have them open side by side so have one for viewing and one for trading

    Not great I know but that’s why I just took a different direction and moved away from further dev on the indicator as it was too limiting unfortunately

    #40574

    Thank you for the replies so far.

    The suggestion from AVT to “define something like MyDayOpen to let the program know your days are shorter” sound perfect, but I don’t know how to do it. If anyone knows how to write some lines of code that can achieve this objective, please could you post a response. I have checked all the ProRealtime manuals and I’m unable to find any solutions in there.

    I hope some can help because this is a really useful indicator for anyone who likes to trade during opening hours for the real cash markets. if the problem can be solved then the indicator can be shared.

    #40967

    I think the AVT’s idea is to set external variables for:

    startime1=080001
    endtime1= 163001
    Instead of having them in the code, set them as external variables in the indicator settings window.
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