I am trading in 5 minutes time frame. In 5 minutes chart first candle time is 9:15. I want to calculate Rate of Change of close price from 1st candle of the day to which ever candle I am currently in the day. I wrote a code like below.
When I verify syntax, it is saying Error 52 Invalid Argument value for ROC(): range must be greater than zero (and not Null).
I am not able to figure out the mistake and also not sure how to achieve this. Please helpā¦
Also when I did Code check and profile, it says that I am referring future quotes. If I remove the plot line then future reference warning message is goneā¦
All help required is ALREADY in the error message:
Error 52 Invalid Argument value for ROC(): range must be greater than zero
In your code the range is LastValue(BarsSince(StartBar) and if you get the error it means that this value is zero. It may be zero in number of cases, including that ānowā is the 9:15, or that 9:15 bar does not exist in your data at all or is somewhere outside your viewed range (search for āQuickAFLā)
Again, you need to use these tools to improve understanding of your OWN code: How do I debug my formula?