• 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

Strategy and indicators integration

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

    Strategy and indicators integration

    Hi,

    I have coded a simple indicator that uses an additional timeframe series and then calculates and plots 2 levels, and now I am in the process to code a strategy that make use of these levels to trade.
    Is it a better practice to reference the indicator from within the strategy (myIndicator.mylevel) or is it better to re-implement the indicator inside the strategy OnBarUpdate() method and make use of it locally?

    Thanks, bye
    Andrea

    #2
    Hello afoschini,

    Thank you for the post.

    This would really depend if you want to reuse the indicator in other scripts. Generally isolating parts of your overall logic into indicators can help in reducing the size of the strategy but this all comes down to your goals. If this will not be used anywhere else, it may be easier to just place it in the strategy.

    I look forward to being of further assistance.
    JesseNinjaTrader Customer Service

    Comment


      #3
      Thank you Jesse

      I was speculating about possible sync problems between calculation in the external indicators OnBarUpdate method and the strategy OnBar... method.If as I undersyand from your answer this is not the case, I will surely go for the flexible approach.

      Bye
      Andrea

      Comment


        #4
        Hello afoschini,

        Yes, the indicator being called should assume the host's properties or the strategy in this case. This should entail that the indicator is in sync with the strategy as it is called by the strategy. In both cases, you should be able to sync the calculation, either in an external indicator or directly in the strategy.

        I look forward to being of further assistance.
        JesseNinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by thomaspartyof10, Today, 02:33 AM
        1 response
        16 views
        0 likes
        Last Post NinjaTrader_Jesse  
        Started by manueldecastro, Yesterday, 12:57 AM
        1 response
        15 views
        0 likes
        Last Post NinjaTrader_ChrisL  
        Started by ArmKnuckle, Today, 01:59 AM
        1 response
        15 views
        0 likes
        Last Post NinjaTrader_PaulH  
        Started by seppyr, Today, 01:53 AM
        1 response
        17 views
        0 likes
        Last Post NinjaTrader_PaulH  
        Started by matthewbartlett, Today, 01:22 AM
        1 response
        10 views
        0 likes
        Last Post Emma1
        by Emma1
         
        Working...
        X