Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

So Many Indicator

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

    So Many Indicator

    Hello,

    I have a system and this system contains 6 indicators. Some indicators uses price values for input but at the same time needs other indicator output for the current bar. For clearify suppose we have an X indicator and X uses Y indicator like this Y[0] at BarUpdate method.
    So i added Y indicator via Add command at X's initialize method. Also Y indicator is adding to chart stand alone too.

    Here is my question. How Ninja interpret this situation? I mean, It is first calculate Y[0] and then draw it on chart and send same result to X and draw X output chart too. Or calculate Y[0] and draw it on the chart then calculate Y[0] again but this time for X.

    I'm interesting this, because i don't want to face any performans penalty at the future.

    Regards.

    #2
    aytacasan,

    You can't Add() another indicator into an indicator. I assume you did the Add() from a strategy.

    What happens when you Add() from a strategy it creates an instance of that indicator on the chart. This same instance is used for your strategy's accessing of the indicator. There will be no penalty hit.
    Josh P.NinjaTrader Customer Service

    Comment


      #3
      Hello again,

      I don't know before that we don't use indicator into other indicator via add method. Thaks for your warning. My question is not related strategy. But yet we use indicator into other indicator like this:

      Y indicators OnBarUpdate()
      X x = new X();
      Y[0] = X[0] * 2; (If there is an most effective way for this please inform me)

      Suppose we added both of X and Y indicators to chart. What is the Ninja's behavier this situation. I mean Ninja calculate X two times for draw X indicator to chart and for draw Y indicator? Or Ninja calculate X value current bar one time and use this value two times?

      Thanks.
      Last edited by aytacasan; 11-12-2010, 05:19 PM.

      Comment


        #4
        Two separate instances; it will be ran twice under such a scenario.
        Josh P.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by cmoran13, 04-16-2026, 01:02 PM
        0 responses
        43 views
        0 likes
        Last Post cmoran13  
        Started by PaulMohn, 04-10-2026, 11:11 AM
        0 responses
        25 views
        0 likes
        Last Post PaulMohn  
        Started by CarlTrading, 03-31-2026, 09:41 PM
        1 response
        163 views
        1 like
        Last Post NinjaTrader_ChelseaB  
        Started by CarlTrading, 04-01-2026, 02:41 AM
        0 responses
        98 views
        1 like
        Last Post CarlTrading  
        Started by CaptainJack, 03-31-2026, 11:44 PM
        0 responses
        158 views
        2 likes
        Last Post CaptainJack  
        Working...
        X