Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Indicator of Indicator

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

    Indicator of Indicator

    I have an indicator of an indicator showing on a chart just fine. When I add the same indicator of an indicator into a strategy it gives different results. Is there something I am missing or that must be done to use an indicator of another indicator in a strategy? Thanks!

    GT

    #2
    Hi GT,

    Indicators and strategies both work from bar objects, so you should generally expect the values to match up, provided everything is the same (session template, days to load, etc) between the chart and the strategy accessing the value.

    The best way to line these up is apply your strategy directly to the chart. You can add your nested indicator in the strategies Initialize() method, and then the visuals should be similar to if you added the indicator through the right click > indicators screen.

    If you're seeing a discrepancy, can you attach the indicator script you're working with? We can then give a run here and compare.
    Ryan M.NinjaTrader Customer Service

    Comment


      #3
      OK, when I add a ZeroLagTEMA of a custom indicator to the chart it is written as:
      Code:
      ZeroLagTEMA(myIndicator(5, Length).BuySignal, 50).ZeroTEMA[0]
      and works fine but when I attempt to add it to the strategy with that code I get error messages "overload method ... has some invalid arguments" and "cannot convert from 'double' to NinjaTrader.Indicator.IndicatorBase." Thoughts?

      GT

      Comment


        #4
        HI GT,

        See this forum post for help adding indicators to strategies.


        You can also build an expression with this indicator using the strategy wizard and then set the plot on chart selection > true. It then places correctly the Add statement needed in Initialize().
        Ryan M.NinjaTrader Customer Service

        Comment


          #5
          Thanks for your help. My broker was able to figure out the issue for me. It appears that I had calculate on bar close set to true in the strategy and once I changed that the values matched up perfect. A learning experience for me and others.

          GT

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by sjsj2732, Yesterday, 04:31 AM
          0 responses
          32 views
          0 likes
          Last Post sjsj2732  
          Started by NullPointStrategies, 03-13-2026, 05:17 AM
          0 responses
          286 views
          0 likes
          Last Post NullPointStrategies  
          Started by argusthome, 03-08-2026, 10:06 AM
          0 responses
          283 views
          0 likes
          Last Post argusthome  
          Started by NabilKhattabi, 03-06-2026, 11:18 AM
          0 responses
          133 views
          1 like
          Last Post NabilKhattabi  
          Started by Deep42, 03-06-2026, 12:28 AM
          0 responses
          91 views
          0 likes
          Last Post Deep42
          by Deep42
           
          Working...
          X