Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Mutli timeframe not working...

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

    Mutli timeframe not working...

    I have a simple strategy. I am doing:

    initialize() {
    Add(PeriodType.Minute, 1)
    }

    onbarupdate() {

    Print(Time[0] + " BarsInProgress " + BarsInProgress);

    if (BarsInProgress == 0) {

    Print(Time[0] + " BarsInProgress " + BarsInProgress);

    }

    No prints.

    I have a strategy running that was making trades before adding second timeframe. It now outputs nothing, not prints, nothing.

    I also have tried backtesting SampleIntrabarBacktest and it does not produce results and just hangs with downloading data.

    What could I be doing wrong?

    #2
    Hi RandyT,

    One of our NinjaScript technicians in training will respond later today. Thank you for your patience.
    Josh P.NinjaTrader Customer Service

    Comment


      #3
      Hello,

      When you right click>compile you do not get any errors right? You are missing ";" after your Add(). onBarUpDate should be capitialized so it reads OnBarUpdate.

      All of the other information in your code works and prints fine for me.
      Last edited by NinjaTrader_Ben; 10-17-2008, 12:57 PM.
      DenNinjaTrader Customer Service

      Comment


        #4
        That is just some quick "pseudo code"....

        My strategy as well as the multi-timeframe example you provide both compile and both fail to run or backtest.

        They are "running", but they never hit those prints to give me anything in the output window.

        Comment


          #5
          I am getting an error logged for SampleMultiTimeFrame.

          Error on calling 'OnBarUpdate' method for strategy 'SampleMultiTimeFrame': SMA[barsAgo]: bargsAgo out of valid range 0 through -1, was 0

          Comment


            #6
            Hello,


            I do not get this error when I run a backtest. I suggest shutting down and restarting NT and running the backtest again. Restarting NT resets the backtesting set up parameters. I believe this is where you are encountering issues.
            DenNinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by Geovanny Suaza, 02-11-2026, 06:32 PM
            0 responses
            591 views
            0 likes
            Last Post Geovanny Suaza  
            Started by Geovanny Suaza, 02-11-2026, 05:51 PM
            0 responses
            343 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
            556 views
            1 like
            Last Post Geovanny Suaza  
            Started by RFrosty, 01-28-2026, 06:49 PM
            0 responses
            553 views
            1 like
            Last Post RFrosty
            by RFrosty
             
            Working...
            X