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 Max238, Today, 01:28 AM
              1 response
              23 views
              0 likes
              Last Post CactusMan  
              Started by giulyko00, Yesterday, 12:03 PM
              2 responses
              10 views
              0 likes
              Last Post giulyko00  
              Started by r68cervera, Today, 05:29 AM
              0 responses
              4 views
              0 likes
              Last Post r68cervera  
              Started by geddyisodin, Today, 05:20 AM
              0 responses
              7 views
              0 likes
              Last Post geddyisodin  
              Started by JonesJoker, 04-22-2024, 12:23 PM
              6 responses
              38 views
              0 likes
              Last Post JonesJoker  
              Working...
              X