data loaded was insufficient to calculate
Forums › ProRealTime English forum › ProOrder support › data loaded was insufficient to calculate
- This topic has 16 replies, 5 voices, and was last updated 2 years ago by GraHal.
-
-
09/01/2021 at 2:47 PM #176600DSRI/DEMA14/ATR/ADX_LONG12345678910111213141516171819202122232425262728293031323334353637// Definition of code parametersDEFPARAM CumulateOrders = False // Cumulating positions deactivatedDEFPARAM Preloadbars = 500000// The system will cancel all pending orders and close all positions at 0:00. No new ones will be allowed until after the "FLATBEFORE" time.DEFPARAM FLATBEFORE = 101000// Cancel all pending orders and close all positions at the "FLATAFTER" timeDEFPARAM FLATAFTER = 055000// Prevents the system from creating new orders to enter the market or increase position size before the specified timenoEntryBeforeTime = 101000timeEnterBefore = time >= noEntryBeforeTime// Prevents the system from placing new orders to enter the market or increase position size after the specified timenoEntryAfterTime = 055000timeEnterAfter = time < noEntryAfterTime// Prevents the system from placing new orders on specified days of the weekdaysForbiddenEntry = OpenDayOfWeek = 6 OR OpenDayOfWeek = 0timeframe (default)// Conditions to enter long positionsindicator1, indicator2, ignored, ignored = CALL "PRC_DynamicRSI"[0.1, 0.1, 14, 60]c1 = (indicator1 > indicator2)indicator3 = DEMA[14](close)indicator4 = CALL "PRC_Adaptive-ATR-ADX-Trend-V2"[14, 3.5, 1.75, 14, 30, 0, 1](close)c2 = (indicator3 CROSSES OVER indicator4)c3 = (indicator3 > indicator4)c4 = (indicator1 CROSSES OVER indicator2)IF (c1 AND c2) AND timeEnterBefore AND timeEnterAfter AND not daysForbiddenEntry THENBUY 1 CONTRACT AT MARKETENDIFIF (c3 AND c4) AND timeEnterBefore AND timeEnterAfter AND not daysForbiddenEntry THENBUY 1 CONTRACT AT MARKETENDIF// Stops and targetsSET TARGET pPROFIT 6QUIT09/01/2021 at 2:54 PM #17660209/01/2021 at 3:34 PM #176605
It maybe that your broker won’t allow you to preload 500k bars IG for instance only allows 200K
1 user thanked author for this post.
09/01/2021 at 4:38 PM #176613Forum is full of people with code not working, please describe with words what is your problem exactly and take the time to:
- Give your topic a meaningful title. Describe your question or your subject in your title. Do not use meaningless titles such as ‘Coding Help Needed’.
09/01/2021 at 4:42 PM #17661409/01/2021 at 4:55 PM #17661509/01/2021 at 5:41 PM #176618PreLoadBars are limited to 10K, no matter what you write in your code.
200K or more ar the bars that can be used for backtesting.
It appears that the problem is not DEFPARAM. Check what kind of indicators you re using and how many bars they require (a 5000-period Ema could exceed 10K bars for calculations).
You should post your code so that it can be tested (with details on TF used and instrument traded).
09/02/2021 at 12:13 AM #17662909/02/2021 at 8:18 AM #176634Code in text is good (as you have posted) but if you also post the .itf file then we not need to go looking for the Indicators and also we would have the .itf all set up with the same variable values as you are using.
I will then test on my Platform and see if I get the same error as you.
09/02/2021 at 8:19 AM #176635Code of indicators, this is what Roberto is talking about. The problem is surely located in that codes 🙂
1 user thanked author for this post.
09/02/2021 at 8:27 AM #176638The file is attached for your review.
09/02/2021 at 8:40 AM #17664109/02/2021 at 8:42 AM #17664209/02/2021 at 11:12 AM #17665209/02/2021 at 11:51 AM #176656I could only find out that the could be in the indicator “PRC_Adaptive-ATR-ADX-Trend-V2”, as replacing line 24 with this one:
1indicator4 = 1//CALL "PRC_Adaptive-ATR-ADX-Trend-V2"[14, 3.5, 1.75, 14, 30, 0, 1](close)got rid of any error message.
I could not spot the issue in the indicator, though.
1 user thanked author for this post.
-
AuthorPosts
Find exclusive trading pro-tools on