MultiTimeFrame PreLoadBars Error Message?

Forums ProRealTime English forum ProOrder support MultiTimeFrame PreLoadBars Error Message?

Viewing 10 posts - 1 through 10 (of 10 total)
  • #116596
    Ξ3

    Hi All,

    Please could someone assist in answering some questions on the PreLoadBars function when using MultiTimeFrame in ProOrder?

    I am attempting to automate a 1 hour system and run it in a significantly lower timeframe (read 1 minute or even 1 second). Back testing seems to be working well but when I try to run it live on IG’s ProRealTime version 10.3, I get the following error message: “This trading system was stopped because the historical data loaded was insufficient to calculate at least one indicator during the evaluation of the last candlestick.”

    My PreLoadBars are already set to the maximum of 10,000 so my questions are:

    1. Is there a way to create a dummy indicator in my code, purely to pass this test (to trick ProOrder somehow)? The idea is then to restrict trading until such time that enough candlesticks are available (built up over time) in order for there to be enough data available in the shorter MTF to satisfy the requirements of candlesticks in the longer MTF?
    2.  Can this historical data be built up over time or is there a hard limit of only looking back a maximum of 10,000 bars in the shorter MTF?
    3.  Does ProRealTime version 11 cater for a larger value for PreLoadBars for ProOrder in order to cater for MultiTimeFrame data requirements?

    Many thanks.

    #116622
    Ξ3

    Hi All,

    Perhaps the error message is misleading as I found the following link mentioning that a phantom bar may be causing a divide by zero error: https://www.prorealcode.com/topic/trading-system-automatically-stopped/

    I am now going through my code with a fine toothcomb trying to find a possible divide by zero exception.

    Strange that this is not a problem during back-testing?

    #116758

    Strange that this is not a problem during back-testing?

    I wrote a comment to above and then thought it would be more usefully posted in the Forum on the link below

    https://www.prorealcode.com/topic/centralization-of-queries-and-suggestions-on-prorealtime/page/20/#post-116756

     

     

     

    1 user thanked author for this post.
    avatar Ξ3
    #116769
    Ξ3

    Hi GraHal,

    Thanks for the link, I fully agree with your sentiments! I have spent the last day debugging my code and running it live (stopping and restarting the strategy each time I make a debug change) line by line until it starts failing.

    I finally tracked it down to the following lines in my code which seem to be failing due to the longer MultiTimeFrame not having sufficient data for the shorter MTF check. I have tried coding around this by checking for “undefined” and/or other “if” statements but so far to no avail, which brings me back to my questions above. This part of my code gets executed in a 1 hour block of a 1 second MTF strategy.

    If you can think of a way around this problem, don’t hesitate to share your thoughts 😉

    #116783

    Have you tried the shorter TF at 5 seconds?

    1 second TF may just not be long enough to read all your code and execute a trade (esp if many lines and complex?) and then start reading again on the next second?

    Worth a try anyway?

    #116815
    Ξ3

    Thanks GraHal,

    I will give that a try but my hopes are tempered as I think I tried a 1 min, 5 min and 30 min timeframe at one stage without success.

    #116842
    Ξ3

    Hi All,

    At least my story ends well as I have managed to get the automated trading code running stable again.

    Just a warning to anyone reading this thread: You should not always trust the exception messages that ProOrder returns upon failure. Sometimes “This trading system was stopped because the historical data loaded was insufficient to calculate at least one indicator during the evaluation of the last candlestick” means exactly what it says. Other times it may mean that there is a divide by zero error or a phantom bar causing the problem, as highlighted by GraHal in another thread. In my case, as far as I can tell, ProOrder sometimes doesn’t handle MultiTimeFrame strategies as expected. On this note also just a reminder that the BarIndex in various portions of a MTF strategy will be different depending on the time block that you are in. Anyway, what finally fixed my issue was changing my code above to: (Basically forcing an initialisation of some variables)

    Good trading to all and once again thanks to GraHal for the support!

    2 users thanked author for this post.
    #116843

    my hopes are tempered as I think I tried a 1 min, 5 min and 30 min timeframe at one stage without success.

    Your current short TF is 1 sec so I was suggesting try 5 seconds TF … so I guess above you meant to say 1 sec, 5 sec and 30 sec??

     

    #116844
    Ξ3

    Actually, I did mean the longer timeframes I mentioned (1, 5 & 30min) just to give the 1 hour timeframe enough bars to calculate my indicators considering the PreLoadBars maximum of 10,000. But your times frames (1, 5 & 30 secs) now also works even if I have to run it for a little while to provide the 1 hour timeframe with enough bars to start calculating the indicators correctly 😉

    As IG currently only provides ProRealTime version 10.3, I still have one last open question on ProRealTime version 11, especially considering that I read somewhere that the “new” back-testing now caters for a 1 million bar lookback…

    Does ProRealTime version 11 cater for a larger value for PreLoadBars for ProOrder in order to cater for MultiTimeFrame data requirements?

    1 user thanked author for this post.
    #116868

    When using MTF in a strategy, the Preloadbars will load maximum 10k bars for all timeframes declared in the code. But, bear in mind that calculation will start at the first bar of the default timeframe (the shorter one).

    However, even with 1M bars, as that it will be possible with v11, I don’t think that it is necessary to get more than 10k bars preloaded, the principle of testing strategy will be the same as now, despite the fact that we will have more history available.

     

    1 user thanked author for this post.
    avatar Ξ3
Viewing 10 posts - 1 through 10 (of 10 total)

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