Multi-timeframe SetScale/RestoreScale/Synchronize gives consistent index error
Author: kbellare
Creation Date: 1/15/2014 3:25 AM
profile picture

kbellare

#1
Am trying to convert several Daily strategies to Intra-day so i can insert intra-day Stop Losses. Can't figure out this Run-time error I keep getting when i run these strategy against 60 minute bars - index out-of-range, must be non-negative and within range - attached is exact wording of error message.

To simplify the code, i commented the for (bar) loop, but still run into this error, with these simple commands - SetScale(), RestoreScale(), Synchronize(); Same issue with 30minute bars as well - i tried with ETF, Stock and Future symbols.

Please advise how to fix this ..

CODE:
Please log in to see this code.
profile picture

Eugene

#2
Check out the QuickRef and the WealthScript Programming for the syntax and examples of using Synchronize(). You're using it incorrectly, like one would do with a void whereas Synchronize() returns a DataSeries and the result of its processing should be assigned back to the original DataSeries.
This website uses cookies to improve your experience. We'll assume you're ok with that, but you can opt-out if you wish (Read more).