Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Indicators on Multi Time Frame

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

    Indicators on Multi Time Frame

    I cannot seem to get this working properly. I am calculating an indicator off of the highs/lows of a second data series. I am using the following code...

    Code:
    LinearReg=LinReg(Highs[1],Length)[0];
    When I input Highs[1] it seems to be interpreting it as 1 bar ago instead of accessing my second data stream. Am I doing this correctly?

    #2
    I don't think it will work. You can only use BarsArray[1]. I recommend you just push this calculation over into BarsInProgress == 1 and do it via LinReg(High, Length)[0]. Then reference the value back in BarsInProgress == 0.
    Josh P.NinjaTrader Customer Service

    Comment


      #3
      I've done that and no joy. I noticed something interesting. The following code gives me a plot, but has a 1 bar lag.

      Code:
      If (BarsInProgress==1)
      LinearReg=LinReg(High,Length);
       
      StrategyPlot(0).Value.Set(LinearReg)
      The following code gives me no plot...

      Code:
      If (BarsInProgress==1)
      {
      LinearReg=LinReg(High,Length);
      StrategyPlot(0).Value.Set(LinearReg)
      }
      This may provide the explaination. Does StrategyPlot run on secondary datastream?

      Comment


        #4
        Remember that StrategyPlot is provided with limited functionality. This may be one of its limitations.

        I am surprised that this worked for you though: LinearReg=LinReg(High,Length);

        I would suspect LinearReg to be a double and that you would need to actually set a value to it instead of a DataSeries. If you are using them as DataSeries maybe try changing it to double and doing LinearReg=LinReg(High,Length)[0]; and then set it to the StrategyPlot that way.
        Josh P.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by charlesugo_1, 05-26-2026, 05:03 PM
        0 responses
        55 views
        0 likes
        Last Post charlesugo_1  
        Started by DannyP96, 05-18-2026, 02:38 PM
        1 response
        142 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by CarlTrading, 05-11-2026, 05:56 AM
        0 responses
        160 views
        0 likes
        Last Post CarlTrading  
        Started by CarlTrading, 05-10-2026, 08:12 PM
        0 responses
        96 views
        0 likes
        Last Post CarlTrading  
        Started by Hwop38, 05-04-2026, 07:02 PM
        0 responses
        276 views
        0 likes
        Last Post Hwop38
        by Hwop38
         
        Working...
        X