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

Multi-threaded.. Key in dictionary: 'PnL'

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

    #31
    Brett,

    Yes, it is timer only related and still only testing with replay. Works fine without firing the CustomerTimerEvent(). I can't trap the error, and NT7 seems to die internally when it generates the **NT** errors, stops processing Order Transactions.

    My final application does a lot of Trailing Stop type functions in the OnMarketData(). But I don't think we need to complicate things that far. The same issue occurs in the demo code I uploaded and you can see it doesn't trap the error in that case, just orders stop being processes.

    Comment


      #32
      Ok so this is same issue then that we already covered.

      Do you see it happen in 1X reply mode?

      -Brett

      Comment


        #33
        I see it at different speeds, 50X, 100X and 500X. I just haven't had the patiences to test it at 1X, would need to setup a seperate computer to have that run for days.

        Comment


          #34
          Yea, the problem is it just doesn't make since to use a timer with sped up data.

          -Brett

          Comment


            #35
            I understand, the issue is people will use this tool in Replay and it will look like the tool is failing. It is nice to change the timing from 500X to 1X when you get near the event of interests, but if the system has failed, once you slow it to 1X it will not process Orders.

            I really just need to be able to Ignore the errors created internally and have NT7 gracefully fail, but not terminate Order processing. That way it can be sped up and slowed down, and others using the system will not experience fatal errors.

            Comment


              #36
              Only why to code it to work with replay is to take the timer out. Otherwise it wont give good results (And even causes exception and crashes)

              Publish two versions, one for replay and one for live if you have to have a replay version.

              -Brett

              Comment


                #37
                Hi Brett,

                This just isn't practical to test and go live, you would need to reload a different version and then confirm it is correctly loaded, etc. Lots of overhead for the user. I am not concerned about the errors during the fast periods as the goal is to move/scan for issues and slow down the stream for examination. Unfortunately, I can't control how others will use the software.

                This is for the LocalOrderManager (LOM) on BMT's site. So, I really don't want to release something that is going to cause more problems and concerns about NT7 processing trades properly. Again, if I can catch the error and ignore it, that would work. Or detect that I am in Sim mode and speed is faster than 1X. I need to come up with one of those two solutions.

                Comment


                  #38
                  What exactly are you using the timer for then? Maybe there is an outside the box solution I could recommend as bottom line is timers in replay don't mix and are not tested to do so. There is no supported method for the code to tell it is in replay and even if it could tell it was in replay, how would you solve the problem? Maybe we need to use this solution in the live code as well?

                  -Brett

                  Comment


                    #39
                    Highly unsupported however:

                    Bars.MarketData.Connection.Options.Provider == Cbi.Provider.Replay

                    Comment


                      #40
                      Hi Brett,

                      I found that one, thanks. I think there is a SIM flag as well, but I would disable the timer features while Replay is running at greater than 1X as I would want to test timing at 1:1 timing, but not above that ratio. So we are half-way there so far, just need to find out if the Replay is running faster than regular time.

                      Comment


                        #41
                        Hello,

                        I will check with another member of my team that gets in tomorrow to see if anything unsupported we can offer. However there is nothing I am aware of unsupported wise in this area.

                        -Brett

                        Comment


                          #42
                          Sorry nothing supported or unsupported there I could hint on and I checked with entire NinjaScript team.

                          Only thing I could hint on is adding a 1 minute or 1 second time frame and then checking to see if it takes shorter then 1 second for the bar to complete=you are in replay. Its untested and is a lot of overhead just to detect replay.

                          -Brett

                          Comment


                            #43
                            Originally posted by NinjaTrader_Brett View Post
                            Sorry nothing supported or unsupported there I could hint on and I checked with entire NinjaScript team.

                            Only thing I could hint on is adding a 1 minute or 1 second time frame and then checking to see if it takes shorter then 1 second for the bar to complete=you are in replay. Its untested and is a lot of overhead just to detect replay.

                            -Brett
                            Thanks,

                            That is where I was heading next, like you said, lots of overhead to detect time. If you could have the development team look to see if there is a graceful way to make the CustomerTimerEven() fail if it gets over run that would be very helpful. If it is a major project, I would rather you guys work on the next gen.

                            I will re-open this thread if I find it happens with Real-time or 1:1 Replay.

                            Regards,

                            Comment


                              #44
                              Hello,

                              Thanks, no graceful way to do this this time.

                              Please re-open if you have any further questions.

                              -Brett

                              Comment


                                #45
                                Originally posted by NinjaTrader_Brett View Post
                                Hello,

                                Thanks, no graceful way to do this this time.

                                Please re-open if you have any further questions.

                                -Brett
                                As you said,It wasn't graceful, but I can detect Replay and >1X now... Please make sure the next platform can detect this and handle the timer events (if not have it built in).

                                Comment

                                Latest Posts

                                Collapse

                                Topics Statistics Last Post
                                Started by The_Sec, Today, 02:29 PM
                                0 responses
                                1 view
                                0 likes
                                Last Post The_Sec
                                by The_Sec
                                 
                                Started by tsantospinto, 04-12-2024, 07:04 PM
                                4 responses
                                62 views
                                0 likes
                                Last Post aligator  
                                Started by michi08, 10-05-2018, 09:31 AM
                                3 responses
                                741 views
                                0 likes
                                Last Post NinjaTrader_ChelseaB  
                                Started by sightcareclickhere, Today, 01:55 PM
                                0 responses
                                1 view
                                0 likes
                                Last Post sightcareclickhere  
                                Started by Mindset, 05-06-2023, 09:03 PM
                                9 responses
                                259 views
                                0 likes
                                Last Post ender_wiggum  
                                Working...
                                X