Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

multi timeframe and TSSuperTrend

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

    multi timeframe and TSSuperTrend

    I get the following error in my log and the reference to BarsArray[1] for TSSuperTrend is ignored. What may I be doing wrong. Is it because TSSuperTrend is returning a bool for the Bar object?

    Error on calling the "OnBarUpdate" method for indicator "TSSuperTrend on bar 1:Object reference not set to an instance of an object.

    Code snipet follows: THANK YOU, Howard

    protectedoverridevoid Initialize()
    {
    Add(PeriodType.Minute, Series2); // series 2 passed to strategy


    protectedoverridevoid OnBarUpdate()
    {
    if (BarsInProgress != 0)
    {
    return;
    }
    if (Position.MarketPosition == MarketPosition.Flat)
    {
    SetStopLoss(
    "", CalculationMode.Ticks, StopLoss, false);
    //stopTaken = false;
    entryPrice = 0.00;
    }

    // Condition set 1
    if (TSSuperTrend(14, TradingStudies.NinjaScript.Utility.MovingAverageTy pe.SMA, 2.618, 14, TradingStudies.NinjaScript.Utility.SuperTrendMode. ATR).Trend[0]
    && !TSSuperTrend(
    14, TradingStudies.NinjaScript.Utility.MovingAverageTy pe.SMA, 2.618, 14, TradingStudies.NinjaScript.Utility.SuperTrendMode. ATR).Trend[1]
    && Position.MarketPosition == MarketPosition.Flat
    && TSSuperTrend(BarsArray[
    1], 14, TradingStudies.NinjaScript.Utility.MovingAverageTy pe.SMA, 2.618, 14, TradingStudies.NinjaScript.Utility.SuperTrendMode. ATR).Trend[1]
    )

    #2
    um

    um... i made the changes based on the post that provided for "signal" bssignal data series and now it appears the error is no longer and it is respecting the use of TSsupertrend with multi timeframes. Unless someone else sees something amiss i do believe i've got it. (gollly)

    Comment


      #3
      um um

      disregard last um. Problem still exists. i get object reference not set to an instance of the object. HELP

      Comment


        #4
        ohowie, unfortunately we're not familiar with the addon indicator call you try to work into a multitimeframe environment - I would suggest contacting the original author to clarify.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by charlesugo_1, 05-26-2026, 05:03 PM
        0 responses
        67 views
        0 likes
        Last Post charlesugo_1  
        Started by DannyP96, 05-18-2026, 02:38 PM
        1 response
        150 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by CarlTrading, 05-11-2026, 05:56 AM
        0 responses
        162 views
        0 likes
        Last Post CarlTrading  
        Started by CarlTrading, 05-10-2026, 08:12 PM
        0 responses
        100 views
        0 likes
        Last Post CarlTrading  
        Started by Hwop38, 05-04-2026, 07:02 PM
        0 responses
        288 views
        0 likes
        Last Post Hwop38
        by Hwop38
         
        Working...
        X