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

Backtest screen blank when referencing BarsArray

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

    Backtest screen blank when referencing BarsArray

    The following code snipit complies in a strategy with out errors but then causes the Backtest pop-up dialog to come up empty - actually blank. Can you help me out here? Thanks.

    Add(PeriodType.Minute, 30);

    myWMA5 = WMA(BarsArray[1],5);
    myWMA5.Plots[0].Pen = new Pen(Color.DarkBlue,2);
    Add(myWMA5);

    Without the reference to BarsArray in the WMA declaration it works fine.
    Last edited by kgillis23; 05-24-2007, 04:08 PM.

    #2
    Yes, you have hit a limitation by where you can not assign a secondary series to an indicator method in the Initialize() method. If you check your log, I suspect you will see an error message regarding this.

    We do not support plotting indciators of a different series on the primary chart series that the strategy is running on.
    RayNinjaTrader Customer Service

    Comment


      #3
      Thanks,

      Ok, so while backtesting I want to plot multiple WMA on 30 minute bars while running a strategy based on 5 minute bars (i.e. I need to enter/exit on 5 minute intervals and not wait for the 30 minute bar to update).

      So, how can I plot on 30m when my enter/exit or on 5m?

      Or do I need to write my own WMA for the 30m?

      Comment


        #4
        See below.

        Originally posted by kgillis23 View Post
        Thanks,

        Ok, so while backtesting I want to plot multiple WMA on 30 minute bars while running a strategy based on 5 minute bars (i.e. I need to enter/exit on 5 minute intervals and not wait for the 30 minute bar to update).

        >>> You can not plot indicators using the 30 minute time frame if you backtesting primary series is done on a 5 minute bar.

        So, how can I plot on 30m when my enter/exit or on 5m?
        >>> You can't at this time, this is a limitation.

        Or do I need to write my own WMA for the 30m?
        RayNinjaTrader Customer Service

        Comment


          #5
          So, just so I understand, I can still use the value of a 30 minute WMA(5) in a strategy charting and running on 5 minutes, I just can't chart the 30 minute indiators. Is that right?

          Comment


            #6
            Your understanding is dead on.
            RayNinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by aussugardefender, Today, 01:07 AM
            0 responses
            3 views
            0 likes
            Last Post aussugardefender  
            Started by pvincent, 06-23-2022, 12:53 PM
            14 responses
            238 views
            0 likes
            Last Post Nyman
            by Nyman
             
            Started by TraderG23, 12-08-2023, 07:56 AM
            9 responses
            384 views
            1 like
            Last Post Gavini
            by Gavini
             
            Started by oviejo, Today, 12:28 AM
            0 responses
            4 views
            0 likes
            Last Post oviejo
            by oviejo
             
            Started by pechtri, 06-22-2023, 02:31 AM
            10 responses
            125 views
            0 likes
            Last Post Leeroy_Jenkins  
            Working...
            X