Slow order management automated trading 1 second timeframe

Forums ProRealTime English forum ProRealTime platform support Slow order management automated trading 1 second timeframe

Viewing 15 posts - 1 through 15 (of 26 total)
  • #226523

    Good day.

    I’m testing the responsiveness of the platform for automated trading with IG.

    I’m simply placing stop orders at specific times on the 1 second timeframe in the DAX to see how quickly they’re cancelled.

    E.g. If I place a stop order on the 1-second timeframe at time = 113000, I expect that order to be cancelled at 113001 if not filled.

    But, that is not the case at all. I’ve ran a few tests by now, and I notice that orders are deleted after 1 second maybe 30% of the time, while the rest may need 2-3 seconds before cancellation. A few times it even took 5 and 6 seconds, according to the order list.

    I’m seeing orders being filled 3 seconds after the order in fact should have been cancelled. In backtesting none of these orders are triggered, but in practice they very much are.

    Are these delays well known? And if so, is it due to PRT servers, IG or both?

    #226524

    Just to be sure this question : Is this Live (not Demo) ?

    #226526

    Sorry, should have mentioned … Both live and in demo.

     

    The one I’m referring to here was live, today. “I’m seeing orders being filled 3 seconds after the order in fact should have been cancelled”

    #226528

    Hmm … This is not something I recognize. But that does not tell anything. 🙂
    May we ask for a (consistent) sample code snippet so we can see what you actually attempt ?

    N.b.: I am used to “seconds” TF systems, but lately they are mere 1 minute systems. Still the responsiveness I see visually, looks immediate to me. For IG that is (IB is a bit of a different story). BUT … this is then about pending orders which move price. So this is not exactly what you are saying …

     

    #226538

    There is not much more to say, really …

    I’m placing stop orders completely randomly at random times to test the responsiveness of the platform. And what I’ve found is that you really need to keep in mind that on a 1-second timeframe (and perhaps other timeframes as well) orders might be placed even though your conditions are not true, because of what seems to be multiple second delays between PRT and IG.

    I’m using tests like the one below just to see how quickly the orders are cancelled.

     

     

     

    #226555

    Just ran another test, in demo.

    see the attached order list.

    System, as seen below, was supposed to place 40 orders with 15 second intervals, but only a total of 15 orders were placed. How this is even possible, I don’t know. Cancellations take multiple seconds, as before. Sometimes as much as 7-8 seconds, meaning backtests on lower timeframes cannot be trusted unless you can add an 8ish-second delay to your scripts. Scalping is also completely out of the question.

    Massive delays in order cancellation is one thing, but 35 missing orders?

     

    #226556

    For some reason I can’t upload the .png screenshot.

     

    https://pasteboard.co/2YadyXkfDe1J.png

    #226559

    just to be clear, all tests were run in 1-second time frame.

    Tested on a 5-second timeframe using 15 second intervals just now, and I’m not seeing any of these delays anymore. this may be an issue only with the lowest time frames like the 1-second and 2-second,.

    However, 25 out of 28 orders were placed, so there’s 3 missing. That’s worrying.

     

     

    #226575

    I was a bit too hasty in my last post. There were delays also in the 5-second timeframe test, but less.

    The reason why only 15 out of 40 pending stop orders on the 1-second test was actually placed, is likely to be delays when both opening and closing positions. Conditions to place an order is no longer true after 1 second, and more than 60% of the orders had at least 1 second delay. 2-3 seconds delay seems normal, and sometimes as bad as 6-8 seconds.

    As such, it’s only natural that the 5-second test had higher success rate of actual placed pending stop orders, as the order is pending for 5 seconds instead of 1 second, allowing for more delay. Still,  25 out of 28 orders were placed, meaning I had 3 incidents where delays were 5 seconds or more.

    I ran another test in DAX today (script below) on the 10-second timeframe, where I placed 40 pending stop orders with a 30 second interval, and had them cancelled at the open of the next candle. Just like before. This time 40 out of 40 orders were placed, meaning that we at least had no delay of more than 10 seconds. Nonetheless, more than 60% of the orders will have been placed somewhere between 1-8 seconds later than what you expect it to, and that’s just horrendously bad. At least for day traders. And you can forget about scalping.

    Order list screenshot: https://pasteboard.co/DGyOHVCC4CX7.png

     

     

     

     

    #226582

    Very good work / analysis you have done here pointofbrew … big thank you and also for sharing with us all.

    I’m hoping @PeterSt will have useful comments and observations on what you have highlighted!

    #226583

    For sure. No problem. I hope everyone who day trade takes notice, because their systems are most likely placing orders outside of system conditions.

    Sorry about the thread becoming a bit messy. I tested and wrote along the way, while in half sleep.

    I have done more testing, and have excluded the possibility that it might have had to do with my test intervals. The delays are there, whether it’s 1 single order or 100 consecutive orders in an interval.

     

    I guess my conclusion is that the delays I’m seeing in order cancellations, are there for when opening positions as well. Anywhere between 1-8 seconds delay, both for opening and cancelling an order. 2-16 seconds for a round trip.

    #226591

    Well, at least I am highly interested (thank you GraHal). But with this topic pinned to my screen, I seem to have too few time today (already yesterday). So it requires mimicking what you do, pob, and it seems that I will run into the weekend, when this can not be tested. 🙁

    So at this moment I rather start spouting somewhat … and if it doesn’t make much sense, then perhaps you can still take something from it (ideas) ?

    It will undoubtedly be my lack of concentration or focus, but I can’t grab the subject much. I see “entities” used, which are not conform the expressions you use. I am certainly not referring to a language problem of any sort (and otherwise always blame me) but merely to “phenomena” (entities) which do not fit. Allow me to give an hopefully justified example :

    The reason why only 15 out of 40 pending stop orders on the 1-second test was actually placed, is likely to be delays when both opening and closing positions. Conditions to place an order is no longer true after 1 second, and more than 60% of the orders had at least 1 second delay.

    In my book this conflicts. If you’d really still be talking about 1 second systems, then nothing can last more than one second, because PRT will have kicked you out. Explanation :
    The pending orders you use will need to be repeated each 1 second, or else they are discarded. I could also say : if the broker did not respond within that 1 second, PRT will see error and throw out your system.**
    but
    not in Demo.

    OR

    Or you quite explicitly don’t talk about your Pending ENTRY orders, which …
    I think are not correct because they should be Limit orders – not Stop orders.
    Or you do that on purpose, because it is perfectly allowed, if you only don’t think the will be filled at the price you want (they will act as Market Orders).
    … or I completely misunderstood up to don’t understand. 🙂 It could be your mechanism to test this, which I don’t grab yet (must first do it myself).
    But if I am right on this one, your orders being filled will be a coincidence because you may not know in advance whether the order is at the correct side of the price (for the Stop order to match). I see you using 3 and 20 points for it and while 20 points should be OK to always be on the wrong side, 3 may not be at all (for the DAX). Mind you, the order at the right side of the price will do what you want, which is almost never.
    It is also a bit in the lap of the Gods when you have Entry times at the whole minute and the half minute (or per 15 seconds which also includes the whole minute) while no single soul will ever trade on the 15 or 30 second, while many will on the whole minute. And oh, I could add to this that IG may be manipulating the prices exactly at those rarity points so you won’t notice (and just see the price changed at the whole minute). Yes, with me we can go everywhere. 😉

    **): This is crucial because something which can’t happen, will now not be noticed by you and instead you could run into different issues (PRT can’t calculate the gain correctly).
    On the other hand, you told that it happens in Live as well, which I don’t think you showed with screenshots and of which I may wonder how on earth you are testing *that*. Lose money ? (which exists – I do that too).


    I could undermine all of my ideas above with telling that I still don’t see those delays for broker (vs PRT) response which I could easily prove by something you see below (I wrote this before I looked it up for real – haha). So this is sorted on Entries and Market orders only. All spot on the whole minute.
    And to ensure I did not pick a few which coincidentally are at :00, I have a few of them (see 2nd picture) – these are just the last. Look for “Koop” (Buy) and “Bestens” (Market). Maybe I can do that for Exit as well …
    … yes I can. See third picture. So that is “Verkoop” (Sell) combined with “Positie sluiten” (Exit). These are Longs and I can’t find them readily for Shorts. I do find something else though;

    Picture #4 shows a mall list of erroneous trades. This is why I show the small losses as well. So, I *know* that these are failed orders, right when they started. Thus within … well, the seconds you see after the whole minute (1 or 2 or even 0 seconds). It almost looks like what you presented …
    Interesting that they are all on the same 2 dates (following each other, Dec. 11 and Dec. 12).
    Why this sometimes happens I could never find, but I think I have a video somewhere, testifying that because of a (too) fact price movement – while the 4 point distance which can be set by/in PRT to move with the price when a limit order is too close to the price – jumps into the too short distance after all, and the order Exits immediately. This too long sentence is to be read as : the Limit order ended up at the wrong side of the price and acts as a Market order and exits the order (because it now goes short with the same quantity while the order is long and therewith cancels the position).

    Over here we say : If you can make chocolate of this, then you’re a smart guy.
    (this is all too ad hoc reasoning and writing)

    Sorry for my English – you must be having a hard time understanding it.

    #226599

    while no single soul will ever trade on the 15 or 30 second,

    I do (5 sec time frame I manual trade) and you do as you often say your Algos trade on 1 sec TF.  I also have a few Algos that trade on 15 sec and 30 sec.

    Above does not need any answer or even a comment, just throwing it in … shows I read your post! 😉

    1 user thanked author for this post.
    #226604

    Haha, Yes. Manually surely !
    But this won’t move markets really (me thinks).

    And of course some crazies do with AutoTrading. That’s us. But that too won’t move markets (YET -:) 🙂  ).
    Offtopic : I use 3 seconds systems. Think of it. 😉

    1 user thanked author for this post.
    #226631

    It will undoubtedly be my lack of concentration or focus, but I can’t grab the subject much. I see “entities” used, which are not conform the expressions you use. I am certainly not referring to a language problem of any sort (and otherwise always blame me) but merely to “phenomena” (entities) which do not fit. Allow me to give an hopefully justified example :

    The reason why only 15 out of 40 pending stop orders on the 1-second test was actually placed, is likely to be delays when both opening and closing positions. Conditions to place an order is no longer true after 1 second, and more than 60% of the orders had at least 1 second delay.

    In my book this conflicts. If you’d really still be talking about 1 second systems, then nothing can last more than one second, because PRT will have kicked you out. Explanation :

    The pending orders you use will need to be repeated each 1 second, or else they are discarded. I could also say : if the broker did not respond within that 1 second, PRT will see error and throw out your system.**

    I’ll keep this short.

    There is indeed a language “problem”, and it’s hard for me to express myself well in english. But on the other hand, there’s nothing for me to prove here. I suggest you simply run similar tests yourself. I hardly doubt this is an issue to my account exclusively. For all I know, these delays are there on purpose, e.g. to prevent arbitrage opportunites. I’m saying this because if I place a datastream of ES directly from the exchange next a US500 chart from IG, there is notable delay between the two charts. Would have been to easy, right? As US500 is a derivative, It’s only natural that there is some delay, as IG have to process the real data and pass it on. They have to protect themselves in some way. And a natural soultion to that would be to add delay.

     

    “On the other hand, you told that it happens in Live as well, which I don’t think you showed with screenshots and of which I may wonder how on earth you are testing *that*. Lose money ? (which exists – I do that too).”

    Here’s the screenshot from that example, that I btw have reported to PRT, where an automated strategy executed an order on the 1-second timeframe 3 seconds after it should have been cancelled. In a live account.  I’m simply trying to trade the volatilty around the open in DAX on this one. Also notice how I was stopped by out 0.7 points. I had a 6 point stop loss in. I thought IG would not accept stop loss less than 5 points, and why on earth is my stop loss in DAX sometimes 0.6 points, and other times 6 points, using the exact same script? https://pasteboard.co/cLVX7qOUh9gL.png

    I began my testing because of it, and I find it fascinating that this is an unkown issue to the forum? It looks to me like you are backtesting this, except from the last couple of screenshots? You have to forward test it. Backtests will only show you what you want to see. These delays are pretty obvious. It does not matter whether you trade the 1 second or the 15 minute … Many will still experience orders being triggered when conditions are not true, and many will experience orders NOT being triggered, when conditions are in fact true. Especially those times delays are at 8 seconds, as I ‘ve seen in my tests.

     

    “Or you quite explicitly don’t talk about your Pending ENTRY orders, which …
    I think are not correct because they should be Limit orders – not Stop orders.”

    Why can’t I use pending stop orders as entry orders? Anyways, the point of this exercise is to identify speed of order execution only.

     

    ” I see you using 3 and 20 points for it and while 20 points should be OK to always be on the wrong side, 3 may not be at all (for the DAX). Mind you, the order at the right side of the price will do what you want, which is almost never.”

    I’ve ran multiple tests since using 20 points for all. There is no difference. Delays are still there.

     

    “while no single soul will ever trade on the 15 or 30 second,”

    You would be suprised to know how many traders actually trade these timeframes. Just from a top down approach, there’s probably quite a few. In fact I spoke with a british trader yesterday, who trades the 5-second timeframe algorithmically.

Viewing 15 posts - 1 through 15 (of 26 total)

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