Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Strategy runs on historical basis, won't run real time

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

    Strategy runs on historical basis, won't run real time

    Hi-

    Very interesting behavior. I'm trying to run the same strategy across several asset classes. All of them are working fine, except for my "metals" group (GC, HG, SI). All are submitting sim trades as expected, but none of those three are.

    I suspected, perhaps, that it might be my session manager - so I went and ensured that all those instruments were using a session that were currently being used correctly (luckily those three share time sessions with NYMEX energy products). Didn't work.

    I removed the strategies, shut down, restarted, and re-added them. Didn't work.

    I ran a historical backtest, using the same strategies and sessions, on those instruments - that worked.

    So I opened up a debug session on those three instruments and strategies. On the historical load, the OnBarUpdate event was correctly triggered and evaluated for every security. However, when it came to real-time, no "OnBarUpdate" were called - for any of those metals.

    For good measure I turned on the same strategy for a different instrument, and it worked correctly in real-time (actually, 11 other instruments worked correctly in this case.)

    What would cause NT not to trigger the "OnBarUpdate", even when a new bar was visually confirmed on a few charts?

    I can send you a copy of the code I'm working but I'm highly confident that's not the problem. No number of sim account clearances, account changes, chart reloads, etc have been able to "fix" this issue today. Ideas?

    PS I attached a photo, where you'll see at the top right the charts of 3 metals with zero trades on them (though every other instrument, running every other chart, has a multitude of trades).

    PPS - I looked through the TRACE file and found this - perhaps you guys could shed some light on it:

    Code:
    2010-06-30 10:49:18:843 (DTN-IQ) Data.Bars.GetBarsNow: instrument='GC 08-10' from='2009-12-31' to='2010-06-30 23:59:59' period=1 Tick splitAdjusted=False dividendAdjusted=False bars=0 session='Nymex Metals / Energy ETH'
    2010-06-30 10:49:22:656 ERROR: IQFeed.Adapter.MessageLoopLookup msg='!ENDMSG!,': The process cannot access the file 'I:\Documents and Settings\Administrator\My Documents\NinjaTrader 7\db\tick\GC 08-10\201006301100.Last.ntd' because it is being used by another process.
    PPPS Based on the above, I went to the Historical Data Manager in order to attempt to download the GC data, but that caused a critical error necessitating shutdown.
    Attached Files
    Last edited by cgeorgan; 06-30-2010, 01:03 PM.

    #2
    To add insult to injury, *any* time now that I try to go to the Historical Data Manager and download data for GC causes a critical error - even if this is the first action I perform after a restart.

    Comment


      #3
      cgeorgan, that trace message most likely is due to virus/malware protection software holding the file "in limbo". Please exclude the My Documents/NinjaTrader 7 from any virus scanners, etc that you have installed on your computer.

      Could you please either post the code here or send it to us at support dot ninjatrader dot com attn 'austin - thread 30917, ticket 335841'? I would like to take a look at the code before I start making wild guesses about what could be going on here.

      The only thing I can think of that would stop an OnBarUpdate() from occuring even though a new bar has been painted is an error that stops the strategy. Anything in the logs?
      AustinNinjaTrader Customer Service

      Comment


        #4
        Hi there, we've received your files. I took a look at the trace and log files and didn't see anything specific to the issue here, but there was a lot of information to digest, so I may have missed something. I'd be happy to run the complete script to see what is going on, but unfortunately I will not be able to test the strategy in it's current state due to the stripped out portions.

        As such, I recommend going through the typical debug cycle. Print out everything, strip it down to the bare minimums, then start adding back your strategy one layer at a time until it breaks.

        Were you able to resolve the Historical Data Manager issues?
        AustinNinjaTrader Customer Service

        Comment


          #5
          Originally posted by NinjaTrader_Austin View Post
          Hi there, we've received your files. I took a look at the trace and log files and didn't see anything specific to the issue here, but there was a lot of information to digest, so I may have missed something. I'd be happy to run the complete script to see what is going on, but unfortunately I will not be able to test the strategy in it's current state due to the stripped out portions.

          As such, I recommend going through the typical debug cycle. Print out everything, strip it down to the bare minimums, then start adding back your strategy one layer at a time until it breaks.

          Were you able to resolve the Historical Data Manager issues?
          Hi-

          Thanks for looking into this. I have actually tried the traditional debug cycle...I can run the strategy while it's loading on any instrument. However, for those 3 in question, there are no "OnBarUpdates" - nothing to drive execution. So there's nowhere to set breaks once the strategy enters "live" mode, preventing any further debugging. I can see bars updating on charts on my screen; I can see the market updating live in a DOM; I can verify that the prices I'm seeing in Ninja match what I'm seeing on my Trading Technology broker screen. Yet no updates are coming.

          I deleted today's data in GC and re-loaded; that worked but did not lead to any OnBarUpdates being driven from the strategy. I'm going to let this run overnight with everything else to see if any trades populate overnight (there should be at least 1 for each instrument). If that doesn't work I'm somewhat dead in the water regarding those instruments...they've all worked in the past, and the strategy works fine on backtesting and all other live instruments.

          Comment


            #6
            How are you running the strategies? Have you tried bring up a real-time chart of the metal in question, made sure it is updating correctly, and then applying the strategy to the chart? What about setting min bars required to 0 for testing purposes?
            AustinNinjaTrader Customer Service

            Comment


              #7
              Originally posted by NinjaTrader_Austin View Post
              How are you running the strategies? Have you tried bring up a real-time chart of the metal in question, made sure it is updating correctly, and then applying the strategy to the chart? What about setting min bars required to 0 for testing purposes?
              Strange behavior continues; ran all those strategies overnight and had over 220 trades in the few instruments I traded...none in the 3 in question.

              I've loaded up GC with the same strategy here, except on this version I've specified historical trades to show up. I've also specified a different account. I've verified the trades are all real time (comparing them to my TT time and sales, etc), and I can see updating bars.

              What I can't get out of the debugger is any hint of "OnBarUpdate", from *only* these 3 instruments.

              Again, I want to stress I'm running the same strategy on something like 10 other instruments...ran them all night, no hiccups at all except for...these 3. NO idea why this won't update.

              EDIT - regarding the picture, the chart on top is the one linked to the "ChrisNEWSim" account, which ran overnight w/o any trades. The lower chart is the one I just brought up, added the strategy directly to the chart (as opposed to the strategy screen), and is liked to the Sim101 account. It shows historical trades but - just like the other GC - no real time trades. You can also see from the window that there are plenty of other strategies in positions.

              As a note, this strategy is guaranteed to produce at least 5-10 guaranteed market entries on any given day - there's no way around it.
              Attached Files

              Comment


                #8
                I can tell you now that the version of the GC strategy that I decided to run straight off a chart vs. the strategy tab (exact same settings, except for the account) is now producing trades, while the strategy run off the strategy tab is *not* producing any.

                Comment


                  #9
                  I suggest you add some printouts to your strategy to see what it is doing. Please only run one instance of the strategy on the particular instrument you are interested in to not overwhelm your output window with unnecessary and irrelevant printings from other strategy instances. You would also want to check your Control Center logs for errors.

                  Please also provide a screenshot of the settings used in Strategies tab and of the ones used on the chart. Thank you.
                  Josh P.NinjaTrader Customer Service

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                  0 responses
                  599 views
                  0 likes
                  Last Post Geovanny Suaza  
                  Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                  0 responses
                  345 views
                  1 like
                  Last Post Geovanny Suaza  
                  Started by Mindset, 02-09-2026, 11:44 AM
                  0 responses
                  103 views
                  0 likes
                  Last Post Mindset
                  by Mindset
                   
                  Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                  0 responses
                  558 views
                  1 like
                  Last Post Geovanny Suaza  
                  Started by RFrosty, 01-28-2026, 06:49 PM
                  0 responses
                  558 views
                  1 like
                  Last Post RFrosty
                  by RFrosty
                   
                  Working...
                  X