data loaded was insufficient to calculate

Viewing 15 posts - 1 through 15 (of 17 total)
  • Author
    Posts
  • #176600 quote
    efahmy
    Participant
    Average
    // Definition of code parameters
    DEFPARAM CumulateOrders = False // Cumulating positions deactivated
    DEFPARAM 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" time
    DEFPARAM FLATAFTER = 055000
    
    // Prevents the system from creating new orders to enter the market or increase position size before the specified time
    noEntryBeforeTime = 101000
    timeEnterBefore = time >= noEntryBeforeTime
    
    // Prevents the system from placing new orders to enter the market or increase position size after the specified time
    noEntryAfterTime = 055000
    timeEnterAfter = time < noEntryAfterTime
    // Prevents the system from placing new orders on specified days of the week
    daysForbiddenEntry = OpenDayOfWeek = 6 OR OpenDayOfWeek = 0
    
    timeframe (default)
    // Conditions to enter long positions
    indicator1, 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 THEN
    BUY 1 CONTRACT AT MARKET
    ENDIF
    IF (c3 AND c4) AND timeEnterBefore AND timeEnterAfter AND not daysForbiddenEntry THEN
    BUY 1 CONTRACT AT MARKET
    ENDIF
    
    // Stops and targets
    SET TARGET pPROFIT 6
    QUIT
    
    #176602 quote
    efahmy
    Participant
    Average
    #176605 quote
    Bob Harris
    Participant
    Average

    It maybe that your broker won’t allow you to preload 500k bars IG for instance only allows 200K

    efahmy thanked this post
    #176613 quote
    Nicolas
    Keymaster
    Master

    Forum 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’.
    #176614 quote
    efahmy
    Participant
    Average

    ok, Thanks

    #176615 quote
    efahmy
    Participant
    Average

    I have changed the preload to 200k, but still not working. I’m using the time frame 150 second may be that is the reason ??

    #176618 quote
    robertogozzi
    Moderator
    Master

    PreLoadBars 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).

    #176629 quote
    efahmy
    Participant
    Average

    The code is posted above.

    #176634 quote
    GraHal
    Participant
    Master

    Code 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.

    #176635 quote
    Nicolas
    Keymaster
    Master

    Code of indicators, this is what Roberto is talking about. The problem is surely located in that codes 🙂

    robertogozzi thanked this post
    #176638 quote
    efahmy
    Participant
    Average

    The file is attached for your review.

    [attachment file=”176639″]

    DSRIDEMA14ATRADX_LONG.itf
    #176641 quote
    GraHal
    Participant
    Master

    Instrument and Timeframe??  We need to have same set up as you.

    #176642 quote
    efahmy
    Participant
    Average

    Instrument: US500

    Time frame: 150Sec

    #176652 quote
    GraHal
    Participant
    Master

    Doesn’t take a single trade over 100k bars backtest … see attached … is that what you get?

    E.jpg E.jpg
    #176656 quote
    robertogozzi
    Moderator
    Master

    I could only find out that the could be in the indicator “PRC_Adaptive-ATR-ADX-Trend-V2”, as replacing line 24 with this one:

    indicator4 = 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.

    GraHal thanked this post
Viewing 15 posts - 1 through 15 (of 17 total)
  • You must be logged in to reply to this topic.

data loaded was insufficient to calculate


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
efahmy @efahmy Participant
Summary

This topic contains 16 replies,
has 5 voices, and was last updated by GraHal
4 years, 5 months ago.

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 09/01/2021
Status: Active
Attachments: 3 files
Logo Logo
Loading...