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

determine if in market replay or not

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

    determine if in market replay or not

    I have an indicator that processes every tick thus CalulateOnBarClose=False. In market replay mode, if FirstTickOfBar true, Close[0] and Open[0] seem to be defined by the prior bar. If on a live connection and FirstTickOfBar true, Close[0] and Open[0] based on the new bar and end up being equal to each other.

    Is this as expected or am I doing something stupid

    If this is how it is, how can I distinguish between being in market replay mode and not being in market replay mode from within the indicator?

    #2
    Hello tulanch,

    Market replay should simulate a real time feed, so you should generally expect the same results. Thanks for the report. We're currently looking into this behavior.
    Ryan M.NinjaTrader Customer Service

    Comment


      #3
      I was not able to see similar results. In the following test, it produced output where the Close is always equal to the Open, which would be expected.

      if (FirstTickOfBar && !Historical)
      Print(CurrentBar + " Time: " + Time[0] + " Close: " + Close[0] + " Open: " + Open[0]);

      Can you please clarify how you are checking for this and make sure you are using the latest 7.0.1000.4?
      Ryan M.NinjaTrader Customer Service

      Comment


        #4
        Please note this is with Market Replay and a Live Zenfire connection... I found Historical setting had no impact on this issue... I do make use of the Historical setting, but again it has no impact on this issue I am seeing.

        Try the following in MarketReplay mode and then in a live Zenfire mode...

        if (FirstTickOfBar )
        Print(CurrentBar + " Time: " + Time[0] + " Close: " + Close[0] + " Open: " + Open[0]);


        In my indicator if I am using MarketReplay data, the above will use print the prior bars values

        if I am connected via a live Zenfire feed, the above will have equal values.

        Comment


          #5
          That's essentially the same test I was doing and everything is working as expected. Adding !Historical means you are only evaluating bars that are playing back with market replay and not the historical bars. This makes the output easier to follow.

          If you're still seeing discrepancies here:
          Please let us know the version of NinjaTrader you're using. Check with Help > About.
          Which instrument are you playing back?
          What day?
          What interval?
          Is market replay recorded from your live feed or provided from NinjaTrader through a download?
          Last edited by NinjaTrader_RyanM1; 04-04-2011, 11:11 AM.
          Ryan M.NinjaTrader Customer Service

          Comment


            #6
            NinjaTrader 7.0.1000.4
            .Net 2.0.50727.4200
            replay is as captured/turned-on on my system - so assuming not from a server?
            ZB instrument
            Renko Bars 2 ticks
            4-1-11


            I will do more testing with replay later tonight...

            Comment


              #7
              Thanks. I didn't see any issues specific to ZB, renko and recorded market replay files. Below is some of the output when ran against today's files. If you are still seeing issues, let us know the code snippet used and exact steps to see it.


              224 Time: 4/4/2011 12:51:27 PM Close: 120.40625 Open: 120.40625
              225 Time: 4/4/2011 12:59:33 PM Close: 120.34375 Open: 120.34375
              226 Time: 4/4/2011 1:07:25 PM Close: 120.46875 Open: 120.46875
              227 Time: 4/4/2011 2:26:40 PM Close: 120.53125 Open: 120.53125
              Ryan M.NinjaTrader Customer Service

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by GussJ, 03-04-2020, 03:11 PM
              11 responses
              3,229 views
              0 likes
              Last Post xiinteractive  
              Started by andrewtrades, Today, 04:57 PM
              1 response
              14 views
              0 likes
              Last Post NinjaTrader_Manfred  
              Started by chbruno, Today, 04:10 PM
              0 responses
              7 views
              0 likes
              Last Post chbruno
              by chbruno
               
              Started by josh18955, 03-25-2023, 11:16 AM
              6 responses
              441 views
              0 likes
              Last Post Delerium  
              Started by FAQtrader, Today, 03:35 PM
              0 responses
              12 views
              0 likes
              Last Post FAQtrader  
              Working...
              X