No announcement yet.

Partner 728x90


dumb question

  • Filter
  • Time
  • Show
Clear All
new posts

    dumb question

    I'm converting a script from NT7 to NT8

    in my testing Time[0].ToString() is not giving me what I expect from NT7....has it changed?

    If so, can you point me to the new Bar/Bars object in help?

    Also...I have more trouble finding things in the NT8 web based there a way to download it into a pc based help system? The searching does not return well, in my perspective.

    running in replay


      Hello vantojo,

      Thanks for your post.

      There would be no change in Time[0] from NT7 to NT8. Time[0] is the close time in date/time structure of the current bar.

      The help guide is online so that we can provide continuous updates to the information presented which is substantially more than was provided in NT7. You can download a PDF of the help guide although we do not recommend this because of the updates we perform.

      To download a pdf of the help guide:
      1) go to this link:
      2) On the help guides click "view more"
      3) Click on the link "NinjaTrader 8 Help Guide PDF"
      Paul H.NinjaTrader Customer Service


        Really strange, I'll have to debug more...thanks

        thanks for the PDF ... most things I want to search for are core the PDF should be alot easier...I don't know if it is just me, but the Search feature in the Online Ninja 8 documentation never seems to return (at the top of the list) what I'm looking for.


          Ok, I ran this in Visual Studio Debug....

          and the Time[0] is not correct

          BUT my code is unusual....I am using MSMQ to send the trade signal from an indicator to a background process running in the Strategy...which runs in a separate thread.

          that background process is a Listener and when it gets a signal it places a trade and the Strategy then manages the Trade

          works good, but I need to know Time[0] and perhaps this is why it is not correct

          perhaps I need Time[0] in a public variable


            Hello vantojo,

            Thanks for your reply.

            I could not help you with Visual studio or Microsoft Messaging Queing.

            I can tell you that Time[0] has not changed from NinjaTrader 7 to NinjaTrader 8 but it sounds like your use has.

            If in doubt you can always Print time from the OnBarUpdate() as a sanity check.
            Paul H.NinjaTrader Customer Service


              Yeah, I'm on my own with this one.

              Just using this to think out loud....

              The signal is passed back to the main process via BackgroundWorker the order submission and all else should be in the main thread

              I remember I had this working perfectly in NT7....but when I started the port to NT8 I removed the code from NT7 the task is to see if I can find an old copy

              In Visual Studio Debug it seems the Time[0] is always the time of the first bar in the Replay data that is loaded.... 1800 hours

              Perhaps the new threading in NT8 has changed something


                If I could find how to send the signal direct from an indicator to a strategy I would remove the MSMQ...that would probably solve the problem.

                Any C# gurus ....

                Here is the requirement:

                I wanted to decouple the Strategy from the trade signal source

                A strategy that is listening for trade signals from multiple indicator (all on same instrument)

                the Strategy can listen for signals from multiple source but once it has a signal it places an order and manages the trade...only one trade at a time

                Any takers?



                  Ok, now that I looked at this longer and worked in the debugger....the problem seems to be that when I access Time[0] it may be in a thread outside of Ninja's access....since I am using Background Worker and it starts a new thread (maybe another process??)

                  Because the Time[0] in OnBarUpdate is correct.

                  Time[0] in the other access seems to be the first bar of the data loaded.


                  Latest Posts


                  Topics Statistics Last Post
                  Started by robforee2, Today, 01:05 PM
                  1 response
                  Last Post NinjaTrader_Jesse  
                  Started by SpikeLGWG, Today, 12:35 PM
                  1 response
                  Last Post NinjaTrader_Jim  
                  Started by Kaalhus, Today, 12:47 PM
                  2 responses
                  Last Post Kaalhus
                  by Kaalhus
                  Started by Johnny, Today, 11:55 AM
                  3 responses
                  Last Post NinjaTrader_Spencer  
                  Started by MGHORBEL, Today, 10:48 AM
                  0 responses
                  Last Post MGHORBEL