Renko Automated trading
Forums › ProRealTime English forum › ProOrder support › Renko Automated trading
- This topic has 6 replies, 3 voices, and was last updated 1 month ago by robertogozzi.
-
-
11/14/2024 at 10:16 AM #240345
Hi everyone,
Wondered if anyone could help me fix an error in the following code? There seems to be an array index issue.
Many thanks
Jim
Renko Automated123456789101112131415161718192021// Definition of code parametersDEFPARAM CumulateOrders = False // Cumulating positions deactivated// Prevents the system from placing new orders on specified days of the weekdaysForbiddenEntry = OpenDayOfWeek = 6// Conditions to enter long positionsignored, ignored, ignored, indicator1 = CALL "[Hq_Renko]_v3"[5, 100, 150, 3, 1, 1, 1, 1, 1, 5, 0, 1, 1, 0, 0, 1, 1000, 0, 14, 1, 1, 7, 19, 0, 0.5, 1](close)c1 = (indicator1 = 1)IF c1 AND not daysForbiddenEntry THENBUY 2 PERPOINT AT MARKETENDIF// Conditions to enter short positionsignored, ignored, ignored, indicator2 = CALL "[Hq_Renko]_v3"[5, 100, 150, 3, 1, 1, 1, 1, 1, 5, 0, 1, 1, 0, 0, 1, 1000, 0, 14, 1, 1, 7, 19, 0, 0.5, 1](close)c2 = (indicator2 = -1)IF c2 AND not daysForbiddenEntry THENSELLSHORT 2 PERPOINT AT MARKETENDIF11/14/2024 at 11:29 AM #240357It can’t be an error related to arrays, as you are not using them.
It must be somthing else. Can you post a screenshot of the reported error?
11/14/2024 at 11:31 AM #240358Well… there might be an error in the indicator Hq_Renko, related to arrays, but we need the fully functional code to check it.
11/14/2024 at 12:15 PM #24036711/14/2024 at 12:48 PM #240369Thanks for the reply. The following error is reported: The trading system was stopped because an indicator called in the code tries to :
– define or access an invalid index in an array : Valid indexes are any strictly positive integer less than 1000000 : [1, 2 ,3, …, 1000000]
– or access an index that has not been previously set in the array : You can check if an index has previously been set using the “IsSet” function : “IsSet($MyArray[MyIndex])”Strangely, it all works in pro backtest.
Regards
Jim
11/14/2024 at 12:53 PM #24037011/14/2024 at 1:21 PM #240374 -
AuthorPosts
Find exclusive trading pro-tools on