Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Understanding ordering synchronization

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

    Understanding ordering synchronization

    My strategy uses only instrument[1]'s parameters to generate order on instrument[0].
    Note: On Initialize I have CalculateOnBarClose = true;

    Considering that I work with PeriodType.Minute,1 on instrument [1], and PeriodType.Tick,150on instrument[0], my question would be:

    Does the system will trade instrument[0] (instantenously, as soon as calculateOnBarClose-1 minute (intrument [1]) generates an order ), or
    Will it wait the Bar closing on Instrument[0] (CalculateOnBarClose (tick 150)) for complete the order ?

    #2
    Originally posted by dafonseca View Post
    My strategy uses only instrument[1]'s parameters to generate order on instrument[0].
    Note: On Initialize I have CalculateOnBarClose = true;

    Considering that I work with PeriodType.Minute,1 on instrument [1], and PeriodType.Tick,150on instrument[0], my question would be:

    Does the system will trade instrument[0] (instantenously, as soon as calculateOnBarClose-1 minute (intrument [1]) generates an order ), or
    Will it wait the Bar closing on Instrument[0] (CalculateOnBarClose (tick 150)) for complete the order ?
    My guess is the latter...

    This should be verifiable in market replay...

    Hopefully NT support clarifies... Im off to get some zzzz's..

    *sent from gtab 10.1

    Comment


      #3
      dafonseca, it would submit whenever the event triggered it - so it depend from which BarsInProgress you send the order. If you submit from the BIP = 1 event, it would then be send when this bar sees a close, it would not matter here where BIP = 0 is at.

      Comment


        #4
        It makes sense to me. But, why the P&L changes when I run the same strategy on the same asset but using different time frames? It is supposed to generate the same ordering pattern therefore same results.

        Is there any difference from market replay to backtest?

        Comment


          #5
          There would be several differences going from Market Replay to backtest, first of all the data source likely - which broker or datafeed are you normally working with in NT?

          Comment


            #6
            I am trying to understand synchroniztion further so i need to understand this:
            what would be the difference from backtesting and market replay?
            the fact is, my strategies even only considerinh instrument[1] parameters to generates order on inst [0] have different P&L when backtested with 1 minute time frama and tick 150. i can not understand why.

            Comment


              #7
              Which data and instrument are you using here? Would you work in Market Replay with CalculateOnBarClose set to false?

              Also on replay you trade against the simulation engine which can give you different fills (more realistic normally) than the historical fill simulation used.

              Comment


                #8
                what is the difference between Back test and Market replay??

                Comment


                  #9
                  I would first of all suggest reviewing this document for common discrepancies to be seen and expected in those environments - http://www.ninjatrader.com/support/h...ime_vs_bac.htm

                  Backtest will be simulating historical fills through the use of historical stored data knowning the OHLCV data of the series you're testing on only, while Market Replay is actually using recorded live Level 1 and Level 2 data and thus has access to the intrabar formation of the bars, giving you the chance to run studies with CalculateOnBarClose = false.

                  Comment


                    #10
                    Subtle but important difference,
                    Let me ask something:
                    Work with CalculateOnBarClose = false mean my strategy will not wait until a bar period closing in order to generate an order, Am I right?
                    Can we consider CalculateOnBarClose = false; a better parameter in case you trust your model??
                    Is there any visible advantage to use CalculateOnBarClose = true;??

                    Comment


                      #11
                      Originally posted by dafonseca View Post
                      Subtle but important difference,
                      Let me ask something:
                      Work with CalculateOnBarClose = false mean my strategy will not wait until a bar period closing in order to generate an order, Am I right?
                      Can we consider CalculateOnBarClose = false; a better parameter in case you trust your model??
                      Is there any visible advantage to use CalculateOnBarClose = true;??
                      That would depend on what your code is doing. In many cases, if you are generating signals based on comparisons or crossovers, the entry conditions may be changing multiple times intrabar, so if using a Stop&Reverse methodology, you will get whipsawed into "Broker Vigorish Hell" on the entry bar.

                      Comment

                      Latest Posts

                      Collapse

                      Topics Statistics Last Post
                      Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                      0 responses
                      649 views
                      0 likes
                      Last Post Geovanny Suaza  
                      Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                      0 responses
                      370 views
                      1 like
                      Last Post Geovanny Suaza  
                      Started by Mindset, 02-09-2026, 11:44 AM
                      0 responses
                      109 views
                      0 likes
                      Last Post Mindset
                      by Mindset
                       
                      Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                      0 responses
                      574 views
                      1 like
                      Last Post Geovanny Suaza  
                      Started by RFrosty, 01-28-2026, 06:49 PM
                      0 responses
                      576 views
                      1 like
                      Last Post RFrosty
                      by RFrosty
                       
                      Working...
                      X