• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

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 catinabag, Today, 09:09 AM
        1 response
        2 views
        0 likes
        Last Post catinabag  
        Started by login_dejavu, Today, 09:03 AM
        0 responses
        1 view
        0 likes
        Last Post login_dejavu  
        Started by MavMoney, Today, 07:17 AM
        1 response
        5 views
        0 likes
        Last Post MavMoney  
        Started by jameslee001, Today, 08:09 AM
        0 responses
        5 views
        0 likes
        Last Post jameslee001  
        Started by bertochi, Today, 07:25 AM
        1 response
        2 views
        0 likes
        Last Post bertochi  
        Working...
        X