Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Playback / Timing / CreateOrder query

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Playback / Timing / CreateOrder query

    Good morning,

    I am using 'PlayBack' connector to backtest some live strategies (that run as indicators, not ninja strategies) running in chart windows. I have a timing query. If I am playing back data at max speed, sometimes it seems that my order gets entered a bit late, so I thought I would enquire if the method I am using would be poor usage with unreliable results under these circumstances?

    I am using playback at full speed
    I submit an order via an indicator with the following method at the appropriate time
    Code:
             myOrder = myAccount.CreateOrder(myInstrument,OrderAction.Buy,OrderType.Limit,OrderEntry.Manual,TimeInForce.Day,Q,convertedPrice,0,"",ordername,DateTime.MaxValue,null);
                                    NinjaTrader.NinjaS cript.AtmStrategy.StartAtmStrategy(ATM, myOrder);
                                    PPrint("Submitting  buy limit order with ATM " + ATM);
    My question is, does the playback engine pause and deal with that request in the subsequent ticks, or would there be a delay, i.e. would the data continue to be getting played back at full speed whilst ninja processes this request and places this order? I'm just needing to know if the sequence of events is likely to be the same in real-time as it is in full speed playback? If yes, then all good. if not, any recommendation on how to make this more reliable for testing purposes? Any further info regarding the order of events/timing background you can provide would be useful in boosting my understanding.

    Thank you.

    #2
    Hello pjsmith,

    I don't see any specific documentation on this topic surrounding using the addon account methods with playback at full speed. This method is generally intended for manual order entry tools however it is utilized in other areas like indicators for live order submission. I will research this and see what I can gather about this topic, once I have more information here I will post again.

    The only comment that I see which would relate here is the following however it also specifically mentions Straetgies so that may not apply to the addon order submission.

    When submitting orders to the Playback101 account, these orders are processed immediately and synchronously. This enables reproducible results for strategy developers that run a strategy on the playback connection. Playback101 and Sim101 work differently when executing, since simulated internet latency delay simulation is not present in playback.

    https://ninjatrader.com/support/help...ePlaybackWorks
    One item that I would like to make sure of is that you are using the Playback101 account, I believe you would get an error trying the Sim101 here but I just wanted to confirm that you have Playback101 used.

    Have you also tried using the same logic/conditions from an actual strategy to confirm that it does not have any delays? I am not sure if what you are doing is able to be tested in that situation, if not you may want to try creating a simple test using the existing SampleMACrossOver logic to see if that difference is still being seen.



    I look forward to being of further assistance.
    JesseNinjaTrader Customer Service

    Comment


      #3
      Hi,

      Thanks for the reply. Yes, using the playback account. I use the same strategy live and it works fine with just the usual latency you'd expect. I'm just trying to figure out if I can reliably test using playbacks, as it enables me to tweak, run a week of data in a few hours, etc. But, if the results back are going to be bad due to the delay between condition and order execution, then my results will be worthless. It'd be great if it does work! I could not find any specifics re this, so if it is possible to confirm, that would be great. I know then I would either continue testing or look at another approach. Thank

      Comment


        #4
        Hello

        I use the same strategy live and it works fine with just the usual latency you'd expect.
        Do you mean the same logic works when using a Strategy and strategy based orders in the playback? We can ignore live trading for now as the problem relates to playback, the method you are using is for live order submission so live trading should work normally. I would be more interested to know if you see any discrepancies when using a strategy versus using the addon account to submit orders here.

        I'm just trying to figure out if I can reliably test using playbacks, as it enables me to tweak, run a week of data in a few hours, etc. But, if the results back are going to be bad due to the delay between condition and order execution, then my results will be worthless. It'd be great if it does work! I could not find any specifics re this, so if it is possible to confirm, that would be great. I know then I would either continue testing or look at another approach. Thank
        Yeah there is no documentation for that use case, we would likely need to test it and see if you can compare the order submission from that to how a strategy would process. I can give that a test, if you can attach the image you used I will do that. I will also put in a question to product management to see if we can get further clarification for addon and manual order submission at fast speeds.








        I look forward to being of further assistance.
        JesseNinjaTrader Customer Service

        Comment


          #5
          Ah, sorry, no. I am confusing things! Due to the nature of the indicator, it will not work in a strategy, so I am unable to test it that way, hence my query. I've noticed what seemed to be the occasional gap between what appears to be the signal, and the order entry during playback, which I do not see live, again, hence my query. I would have to port a version of the indie for strategy use. Not impossible, but actually a lot of code and for things to remain the same as live, it all has to be done very carefully. I could of course avoid all that if playback results are indicative of live. Hopefully, this turns out to be the case - If not, I may have a lot of work to do Just for info, the reason it's a bit hard is the indie is integrated into charttrader and modifies it with extra buttons etc., I'd have to make it all backtest aware and strip all those parts etc.

          Comment


            #6
            Hello pjsmith,

            Thanks for the reply.

            I got clarification on this and it appears that the addon methods should work in the same manor as strategy methods in respect to timing. If you are able to create a sample that can show the difference here I could go ahead and get that reported.

            I would likely suggest to try and replicate the SampleMACrossOver logic in an indicator to see if you are able to get the difference in that use, that would be the most simple way to do so for a comparison between strategy/indicator. If you cannot reproduce it with that it could also be a result of some logic being used. If what you are doing is not easily moved to strategy I could suggest trying just the basic conditions used to trade or order type being used in the strategy to see if there are any differences in fills using that. The condition should equate the same in strategy or indicator, really the order would be what would be of interest here as there are two methods to submitting the order between addon and strategy.


            I look forward to being of further assistance.
            JesseNinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by Behungr101, Today, 02:16 AM
            1 response
            8 views
            0 likes
            Last Post NinjaTrader_Jason  
            Started by omermirza, Yesterday, 08:37 PM
            2 responses
            12 views
            0 likes
            Last Post NT-Roland  
            Started by aelagha, Today, 01:28 AM
            1 response
            11 views
            0 likes
            Last Post NinjaTrader_Jason  
            Started by Lowerlevel1, Today, 12:26 AM
            0 responses
            6 views
            0 likes
            Last Post Lowerlevel1  
            Started by omololu, Yesterday, 10:12 PM
            0 responses
            35 views
            0 likes
            Last Post omololu
            by omololu
             
            Working...
            X