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 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 frankthearm, Yesterday, 09:08 AM
          13 responses
          45 views
          0 likes
          Last Post frankthearm  
          Started by PaulMohn, Today, 12:36 PM
          2 responses
          16 views
          0 likes
          Last Post PaulMohn  
          Started by Conceptzx, 10-11-2022, 06:38 AM
          2 responses
          53 views
          0 likes
          Last Post PhillT
          by PhillT
           
          Started by Kaledus, Today, 01:29 PM
          1 response
          4 views
          0 likes
          Last Post NinjaTrader_Jesse  
          Started by yertle, Yesterday, 08:38 AM
          8 responses
          37 views
          0 likes
          Last Post ryjoga
          by ryjoga
           
          Working...
          X