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

dumb question

Collapse
X
 
  • 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 help...is there a way to download it into a pc based help system? The searching does not return well, in my perspective.


    #2
    running in replay

    Comment


      #3
      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: https://ninjatrader.com/Help-Connection-Guides
      2) On the help guides click "view more"
      3) Click on the link "NinjaTrader 8 Help Guide PDF"
      Paul H.NinjaTrader Customer Service

      Comment


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

        thanks for the PDF ... most things I want to search for are core features....so 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.

        Comment


          #5
          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

          Comment


            #6
            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

            Comment


              #7
              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 ProgressChanged...so 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 .....now 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

              Comment


                #8
                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?

                :-)

                Comment


                  #9
                  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.

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by Radano, 06-10-2021, 01:40 AM
                  20 responses
                  615 views
                  0 likes
                  Last Post NinjaTrader_BrandonH  
                  Started by Mizzouman1, Today, 07:35 AM
                  0 responses
                  4 views
                  0 likes
                  Last Post Mizzouman1  
                  Started by i019945nj, 12-14-2023, 06:41 AM
                  6 responses
                  66 views
                  0 likes
                  Last Post i019945nj  
                  Started by aa731, Today, 02:54 AM
                  1 response
                  8 views
                  0 likes
                  Last Post NinjaTrader_BrandonH  
                  Started by BarzTrading, Today, 07:25 AM
                  0 responses
                  3 views
                  0 likes
                  Last Post BarzTrading  
                  Working...
                  X