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 Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        670 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