Error on Use of Highest Function

Forums ProRealTime English forum ProBuilder support Error on Use of Highest Function

Viewing 3 posts - 1 through 3 (of 3 total)
  • #144714

    Hello Forum,

    I am trying to write some code to display the 4 hour candles on the 5 minute chart. I have written some code and I receive and error that ‘a positive integer field is expected with the HIGHEST’. As I am trying to capture the current 4 hour data I cycle through the last candles up to 48 candles (48 * 5 mins = 4 hours) and then begin the new candle. So I am using a variable in the highest function called ‘currentBar’ which I expect to be the counted bars since the start of the current 4 hour candle. Is this error telling me I cannot use a variable in this location and can only use a written integer?

    Any help on correcting this error would be appreciated.

     

    PS – For now ignore how wide I am drawing the actual candlestick bodies, I had not reached that part of the project and had borrowed the candle drawing code from another indicator.

     

     

    #144721

    Try adding this at line 26:

    to make sure currentBar is at least 1.

    1 user thanked author for this post.
    #144819

    Thank you. That has done the trick.

Viewing 3 posts - 1 through 3 (of 3 total)

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