Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

Multi-Instruments Synchronization Problem

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

    Multi-Instruments Synchronization Problem

    Hi All,

    I'm running a 5 min strategy that load many instruments and trade only one of them.
    I use
    Code:
    CalculateOnBarClose = false;
    and I only run on the first tick for BIP==0
    Code:
    protected override void OnBarUpdate()
            {
                //Calculate only once.
                if (!FirstTickOfBar || BarsInProgress != 0) return;
    ...
    My problem is that I have different results when I'm running live and backtesting.
    From my investigation I think that the problem is when I'm trying to refer to the other instruments previous 5 minute close Closes[index][1] I'm getting different results in backtest and live.
    How can I refer to the previous close of for example BIP == 1 and getting the same result in live and backtesting?

    TX in advance for any assistance.

    #2
    freewind,

    There are known discrepancies in live trading vs. backtesting.



    Here is a link to a way to mitigate some of the backtesting discrepancies : http://www.ninjatrader.com/support/f...ead.php?t=6652

    Please let me know if I may assist further.
    Adam P.NinjaTrader Customer Service

    Comment


      #3
      Hi Adam,

      I'm aware of everything you mentioned but I found out that when I'm referring to Closes[index][1] in real time I'm getting identical tick and not the previous five minute close price!!!!

      I can send you privately real time logs that demonstrate the problem.

      Waiting for your reply.

      Comment


        #4
        NT Support,

        When I'm using the setup I mentioned in my first entry I get the following results:
        Close[0] ==> Current Tick
        Close[1] ==> 1 Tick backward
        Close[2] ==> 5 Min backward
        Close[3] ==> 10 Min backward

        If you need I can send you printouts of live connection.
        BTW I'm using NT 7.007 connected to eSignal.

        Comment


          #5
          freewind,

          Close[] is a data series that won't work as you expect without BarsInProgress filtering. Its better to use Closes[][] in multi-instrument or multi-timeframe strategies.

          Closes[0][X] is the primary data series, Closes[1][X] is the secondary, etc. I notice you are mentioning something about this in a prior post. How are you using this series?
          Adam P.NinjaTrader Customer Service

          Comment


            #6
            I know that.
            I just wrote it for the example I gave.
            I think there is a bug in NT when addressing Closes[0][1] when the system is set to CalculateOnBarClose=false.

            Comment


              #7
              freewind,

              If you would like me to check into this further,

              Please :

              1) Outline specifically the issue you are experiencing,
              2) List steps to reproduce the issue

              and/or 3) provide me with code that reproduces the issue.

              Unfortunately I am unable to replicate this with my own examples I have tried using information available in this thread.

              I look forward to helping you resolve your issue.
              Adam P.NinjaTrader Customer Service

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by trilliantrader, 04-18-2024, 08:16 AM
              5 responses
              22 views
              0 likes
              Last Post trilliantrader  
              Started by Davidtowleii, Today, 12:15 AM
              0 responses
              3 views
              0 likes
              Last Post Davidtowleii  
              Started by guillembm, Yesterday, 11:25 AM
              2 responses
              9 views
              0 likes
              Last Post guillembm  
              Started by junkone, 04-21-2024, 07:17 AM
              9 responses
              69 views
              0 likes
              Last Post jeronymite  
              Started by mgco4you, Yesterday, 09:46 PM
              1 response
              13 views
              0 likes
              Last Post NinjaTrader_Manfred  
              Working...
              X