HTF coding and preload bars

Forums ProRealTime English forum ProOrder support HTF coding and preload bars

Viewing 12 posts - 1 through 12 (of 12 total)
  • #222900

    This is more of a heads up when referencing HTFs in LTF codes.

    PRT tech support were no help with this issue whatsoever and dont seem to know the quirks of the system.

     

    I have a program running on 30 second chart referencing the 4hr trading signals generated within the code.

    The program was working and I didnt note any issues, but when I re-uploaded with some progression of amount coding I noted signals were not triggering the program, moreso because I didnt take note previously I think.

    Tech support stated there were no trades triggered, but they backtested with a small amount of units and I noted that more trades appeared when a longer period of time had passed, so if I backtested 6 months the last month would show trades, but if I backtested a month it would not.

    So now I figured that the 4hrly HTF would need a certain amount of data to run, and so wondered whether this was an issue. I preloaded 22000 bars and it has taken 1 month to trade the triggers generated.

    On backtesting if I change the preload bars to higher amounts the trades get triggered, but if using default 2000 they dont.

    So the conclusion is that if using LTF trigger charts referencing HTF triggers for the trade or reference material, it follows that you have to preload enough bars to allow the data to be present when the program is live.

    I’ve not clarified how much – but backtesting seems to allow program triggers with 66000 preloaded bars when backtesting for 1 month, but I haven’t tested this on a live prgram just backtesting. Using 22ooo preloaded bars I waited 1 month for the trigger to actually trigger a live trade on the program. this is reflected in backtesting too, and default 2000 reduces to what I experienced live, but the trades increase if I preload 66000 bars instead on backtesting.

    PRT tech support don’t get this at all, they never get teh anomalies I come up with to be honest as I see comparisons they dont see, and I have had uninformed support around it really from PRT support themselves not IG support

    Historically I’ve also had programs not triggered across different accounts where the program is the same, but someone elses account doesnt trigger while others do, I believe this is possibly latency PRT end.

    So this was on 30 second chart referencing 4hrly triggers. Go figure! It is what it is so work with that knowledge in-hand…

    #222902

    Hi there Phil,

    I could be regarded your “PRT support” as I too can not follow really what you all say. Still, you could investigate these possible misunderstandings (I imply them by mentioning “my” figures) :

    Default of PreLoadbars is 200, I think.

    Max of PreLoadBars is 10000.
    (don’t ask me what will be used when you claim 66000 etc.).
    Notice that there will be something going on with using several TimeFrames. Thus, the 10000 would count for 30 second bars, but also for 4h bars. This may even end up in drama because the base TF will be your 30s which may not allow to span (for) the 4h. Also see my little subject below, which implies something like 360 4h bars in 3 months of 20 trading days. It is even less when we see that no 24 hours continuous trading exists and it depends on the asset.

    With 30 seconds TimeFrame, you will get something like a theoretical 3 months, which is theoretical because a. it requires V12, b. it requires PRT-IB(KR) and c. it requires the Premium version of PRT. The latter you can obviously have, but still saying because of a. and b. which do not seem to match. But tell that you are on PRT-IB and V12 and all is fine.

    On the up side, you will be correct on your observation of the preloaded bars to be necessary in the first place. To many this is logic, but initially maybe not to you. But now it is, because you came up with it yourself, right ? 🙂
    And notice that it is not always clear to see how much data a certain indicator requires. If you have a specific indicator you can ask – some of the geeks will know (I don’t).

     

    Historically I’ve also had programs not triggered across different accounts where the program is the same, but someone elses account doesnt trigger while others do, I believe this is possibly latency PRT end.

    Nah, not so. But don’t underestimate what happens at the brokers (especially IG) if things get volatile (like with FED news) and their systems and they themselves can’t keep up (huge slippage or no entry). One account is fine (because first in order), the other is not (never gets its turn).
    And otherwise we still have the market’s workings. I buy at price X, so you will buy at price X+1 or not at all (Limit order).

    Etc. ?

    If I am wrong on some or everything, then apologies.
    Peter

    1 user thanked author for this post.
    #222903

    I confirm Peter’s reply: each time the question has come up in the forum over the past few years, as far as I can remember the answer given was  max preloadbars possible is 10000.

    If it has increased, I haven’t been made aware of it (and I can only assume Nicolas would have told us), and I am still using value 10000 in mine.

     

    So just did the following quick check we usually do to check latest before replying:

    1) adding as last line of a backtest :

    graph barindex as “barindex”

    and 2) trying in the first line any value higher than 10000 for defparam preloadbars=…

     

    And regardless of how much higher than 10000 is inserted for defparam preloadbars=… , the first “graphed” displayed barindex in the backtest variable window remains 10000, so bars 0 to 9999 have been preloaded, the 10000 limit hasn’t changed.

    #222904

    Default PreLoadbars is 2K.

     

     

    #222905

    Thaks for replies, but I think the point of the post has been missed…

    If you use less preload bars or units trades dont trigger, if u use more they do…. 10000 will still cause a month delay in a trade being triggered, so just allow time before trades are triggered if using HTF referencing…. Any specifics of minimum or max amounts is superfluous to the issue… it doesnt change the fact of needing to wait for data to build before trades are triggered properly… V11  premium, but Im not sure what difference that may make in the program trading servers as the version of PRT used there is independant of my version I would imagine rightly or wrongly

    #222906

    I thoiught it was, thanks for the clarification, but he issue remains really independant of what the program default or max loading is, it apears to take about a month to trade

    #222910

    Phil, I think all is perfectly clear;
    If you have a subscription to 1M bars (Premium) then you can’t look back further than 1M bars. For 30 seconds that would be my mentioned number of months (never mind my math is off). Now if you need extra bars for the indicators that is subtracted in the front of your data series. And you are left with less for the trading. So if you would need 10000 bars of 4 hours, that would be (x 4 x 2 (for 30 seconds)) 80000 bars of 30 seconds. Or in other words 40000 of 1 minute or 40000/1440 = 27 trading days (24 hour trading assumed).
    (again, my math could be wrong but it is about the idea)

    What you ask for is adding those extra 27 days to the data you already got for Premium, but it just is not there or not given. And thus it works the other way around – you would lose them for trading. Edit : Backtesting that is.

    #225436

    Hi,

    For IG PRT, what is the max PRELOADBARS?

    I am using below in my prorealcode autotrading.

    DEFPARAM PRELOADBARS = 40000

    and I’ve a IF condition like

    IF (BarIndex > 36000) and MyCondition

    I’ve not seen my algo triggering a position with this condition.

    If I remove “(BarIndex > 36000)”, then it does generate an order but with wrong values as calculation requires at least 36000 bars.

    ps. sorry if posted in the wrong thread.

     

    #225446

    10000
    🙂

    1 user thanked author for this post.
    #225447

    You can use the function button and search preloadbars but it really only tells you the minimum is 200.

    Cant say categorically, but for me a HTF program running on 30 seconds took about a month to accumulate enough data to start trading. So assuming your preloadbars is enough bars to allow the determination of signals then if its not working it may have to accumuilate the data live first.

    If your criteria is 36K bars then if the program cant initiate with 40K bars it will just run until there are 36Kbars and then maybe start to trigger, sometimes just try with a small amount live to see.

     

    The other point Id mention is that things like averages and other indicators will differ I think if there is insufficient data to form what you might see if there is sufficient data, so a particular criteria may not trigger as you expect until the historical data has caught up with itself on the live trading system. I see this on some programmed indicators at the start of charts, then eventually they display as they should…

    #225448

    With 1h its fine, but I need a year data and with 15m needs to load at least 36k bars. Decision making is better with 15m with closing trades on breakeven or a lesser loss.

    The problem is if the program gets stopped then you’re lost again. It has to start from scratch I guess.

     

    huh, what a bad news

    #225469

    The problem is if the program gets stopped then you’re lost again. It has to start from scratch I guess.

    I use “starting through” variables (Parameters) for similar. But where my application is relatively simple (it is for Money Management and when the system is thrown out), for you it would be more tedious because you would need to “prepare” averages by means of backtesting and have them as fixed “pre”-values in the code. They themselves must be integrated with the normal Average (etc. etc.) functions you use so all can progress over time.
    Not funny, but thus technically solvable.

    If I must restart a system with MM in there, it takes me 15-20 with shivering because of the mistakes and typos which can be made.

Viewing 12 posts - 1 through 12 (of 12 total)

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