Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Why would Strategy work on a chart, but not in Strategy Analyzer?

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

    Why would Strategy work on a chart, but not in Strategy Analyzer?

    EDIT: Never Mind. I didn't have enough bars of data loaded.


    I'm trying to figure out what in my code to look for... it's really weird.

    I'm using NT 6.5 on a multi-timeframe strategy - 1 Day and 8 Day timeframes with Yahoo Historical data (about 4 months of backtest data).

    If I run the strategy on a chart, it appears to work just fine.

    If I put a Print() statement at the top of OnBarUpdate(), it's not getting called in the Strategy Analyzer.

    There are no errors in the logs, and Strategy Analyzer silently quits with $0.00 values.

    I tried the SampleMultiTimeFrame strategy, and got the same results.

    Any thoughts on what could be happening or what to check?


    Thanks

    Matt
    Last edited by tazatek; 04-06-2010, 10:03 AM.

    #2
    Ok, thanks for reporting back and great this is resolved for you.

    Comment


      #3
      I spoke too soon...

      it seems that I can get the backtest to work by having the right number of bars, but optimizing is running, but returning $0 values.

      I've increased the number of backbars required and the amount of data back 10 years (just so I'd have enough)

      I do see an error in my logs about an object reference not instantiated... I suspect that I'm still short in my number of bars ( or related)

      But I can't Print() because the print statements aren't printing anything from OnBarUpdate() .... I get them from Initialize() however.

      Any thoughts on printing in OnBarUpdate? It seems that C#/Ninja aren't flushing the buffers in time for them to get printed....

      I don't have VS available to me where I am so that option is out....

      Any other thoughts?

      Thansk

      MAtt

      Comment


        #4
        OK - I found the problem.

        I'm using unsupported code!!


        So What I need is a supported method to check if I'm being called from the strategy analyzer....

        I could set a param that could be set when optimizing, but would like to know if there's a slick way to see if I'm being called from a DOM, or Strategy Analyzer or Chart, etc

        Thanks

        Matt

        Comment


          #5
          Matt, unfortunately there is none for this task - try a user defined input you set where you're on a chart or in the SA then.

          Comment


            #6
            why doesn't Print() work within OnBarUpdate from within Strategy Analyzer?

            Originally posted by tazatek View Post
            But I can't Print() because the print statements aren't printing anything from OnBarUpdate() .... I get them from Initialize() however.
            Currently testing this with version 6.5.

            I'm also trying to get Print() to work from Strategy Analyzer today but no dice. Works great from normal strategy applied to chart. I'd like to get this to work as I'm doing some unit testing for a rare bug which doesn't always show itself in a given chart. It would help greatly to be able to run a strategy applied to sets of many symbols where the Print() statement was working properly from within OnBarUpdate within StrategyAnalyzer. But OnBarUpdate use of Print() appears neutered in Strategy Analyzer?! Any way to get this to work - what am I missing?

            If Print() is purposely being ignored when originating from within Strategy Analyzer, anyway to ease this restriction in enhancement update to Strategy Analyzer?

            JD

            Comment


              #7
              Just checked here, Prints works for me in the SA - please ensure to have the output window open before you backtest your strategy in the SA.

              Comment

              Latest Posts

              Collapse

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