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

Indicator in strategy display incorrectly over time

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

    Indicator in strategy display incorrectly over time

    Hi -

    When I add a self developed indicator to a strategy, it displays on the Strategy Analyzer Chart Display correctly at the right edge of the chart. However, as I scroll back in time, the indicator reports incorrect values. I manually add a second copy of the indicator to the Strategy Analyzer Chart Display it displays correctly over the complete time-span of the chart visually. While the visual appears incorrect, if I debug into the code, the values returned in the strategy appear to be correct.

    Please fine attached two screen captures illustrating this. The indicator in question is TradeSafe3UberTrend. The upper TradeSafe3UberTrend indicator is generated by the strategy and the lower TradeSafe3UberTrend indicator was manually added to the Strategy Analyzer Chart Display manually.

    Why should these displays diverge over time?



    Here is how I add the indicator to the chart in the OnStateChange handler:

    else if (State == State.DataLoaded)
    {
    AddChartIndicator(Swing(PullbackHelper.PullBackSwi ngStrength));
    AddChartIndicator(Stochastics(STOCHASTICSPERIODD, STOCHASTICSPERIODK, STOCHASTICSSMOOTHING));
    AddChartIndicator(ema = EMA(21));
    AddChartIndicator(uberTrend = TradeSafe3UberTrend());
    }


    Please Advise.

    Attached Files

    #2
    Hello kweiss,

    Does this also happen with indicators like the SMA?

    Can this also be reproduced on a chart?

    Does the indicator add any series internally?

    A thought I had was about the trading hours template which isn't set to <Use instrument settings>, but I think this is still using the default template..
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Hi -

      Thank you for you quick reply.

      This does not happen on the other indicators. They appear to display as expected. I tried this both the Stochastics and EMA.

      Our custom indicator, TradeSafe3UberTrend adds 5 different copies of the same custom trend indicator -- each for a different time period. We have taken care to specifically use the ETH on all time frames. We use the 1, 3, 9 minute and the 144, and 233 tick time frames. When displayed on a chart, our custom TradeSafe3UberTrend indicator displays correctly. In fact, when placed on a separate chart, the results match the copy of TradeSafe3UberTrend manually placed on the Strategy Analyzer Chart Display. Only the results generated automatically by the Strategy Analyzer Chart Display are incorrect.

      Thank you.


      Comment


        #4
        Hello kweiss,

        If this is not occurring with the SMA or other indicators, it may be an issue with the code in this specific indicator.

        Have you used prints to see if the input series data is changing or to see why the values calculated by the indicator are different?
        Chelsea B.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by f.saeidi, Today, 11:02 AM
        1 response
        2 views
        0 likes
        Last Post NinjaTrader_BrandonH  
        Started by geotrades1, Today, 10:02 AM
        4 responses
        12 views
        0 likes
        Last Post geotrades1  
        Started by rajendrasubedi2023, Today, 09:50 AM
        3 responses
        16 views
        0 likes
        Last Post NinjaTrader_BrandonH  
        Started by lorem, Today, 09:18 AM
        2 responses
        11 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by geddyisodin, Today, 05:20 AM
        4 responses
        30 views
        0 likes
        Last Post geddyisodin  
        Working...
        X