Positive Integer error when using lowest

Forums ProRealTime English forum ProBuilder support Positive Integer error when using lowest

Viewing 9 posts - 1 through 9 (of 9 total)
  • #124300

    Hi,

    I am using the below code as a trailing stop on the US500 but keep getting a positive integer error. When I remove line 9 indicator i5, it seems to work but I dont understand why it doesnt when included.

    I think i have accounted for negatives and also used round() to account for decimals.

    Any help would be appreciated.

    Thanks

    Carter

     

    #124303

    Carter – Please always use the ‘Insert PRT Code’ button when posting code to make it more readable for others. I have tidied up your post. 🙂

    #124305

    Thanks, will do.

    #124309

    Try this at line 8:

    to make sure it’s not 0.

    #124312

    Hi Robert,

    Thanks for that but it seems to the same.

    #124314

    Just something else, it does seem to back test ok but when running on live orders the system SOMETIMES stops with the same error.

    Thanks

    #124315

    Try this:

     

    #124316

    Yes it seems to work, i had to change a couple of values though.

    I tried it with the barindex and with out and it didnt work with out, what is the thought process behind that. I dont understand.

    Thanks for your help

     

    #124321

    It is a common fix. When you first launch the indicator it checks the first bar and then tries to look for lows on the previous 9 bars that don’t exist. The error message I think is a little incorrect as to how it describes the problem. It is always a good idea to make sure there are enough bars on your chart to actually get a meaningful result.  However if the indicator is used in a strategy then it means that you have a pause at the start of every back test before trading can start.

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

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