Announcement

Collapse
No announcement yet.

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 b16_aln, Today, 10:18 AM
                  0 responses
                  1 view
                  0 likes
                  Last Post b16_aln
                  by b16_aln
                   
                  Started by luisjmh, Today, 10:14 AM
                  0 responses
                  1 view
                  0 likes
                  Last Post luisjmh
                  by luisjmh
                   
                  Started by bc24fl, Today, 09:57 AM
                  0 responses
                  5 views
                  0 likes
                  Last Post bc24fl
                  by bc24fl
                   
                  Started by sidlercom80, 11-30-2020, 11:52 AM
                  1 response
                  29 views
                  0 likes
                  Last Post bltdavid  
                  Started by Impeesa, Today, 09:52 AM
                  1 response
                  5 views
                  0 likes
                  Last Post NinjaTrader_Kate  
                  Working...
                  X