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

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 GussJ, 03-04-2020, 03:11 PM
        11 responses
        3,221 views
        0 likes
        Last Post xiinteractive  
        Started by andrewtrades, Today, 04:57 PM
        1 response
        10 views
        0 likes
        Last Post NinjaTrader_Manfred  
        Started by chbruno, Today, 04:10 PM
        0 responses
        6 views
        0 likes
        Last Post chbruno
        by chbruno
         
        Started by josh18955, 03-25-2023, 11:16 AM
        6 responses
        437 views
        0 likes
        Last Post Delerium  
        Started by FAQtrader, Today, 03:35 PM
        0 responses
        9 views
        0 likes
        Last Post FAQtrader  
        Working...
        X