• 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 Johnny Santiago, Today, 12:30 PM
        7 responses
        22 views
        0 likes
        Last Post Johnny Santiago  
        Started by ttodua, Today, 12:26 PM
        1 response
        5 views
        0 likes
        Last Post NinjaTrader_PatrickG  
        Started by dastaan, 06-26-2020, 04:33 AM
        6 responses
        108 views
        0 likes
        Last Post NinjaTrader_Jim  
        Started by RumHam, Today, 12:14 PM
        1 response
        11 views
        0 likes
        Last Post NinjaTrader_Zachary  
        Started by Lancer, Today, 12:12 PM
        2 responses
        13 views
        0 likes
        Last Post Lancer
        by Lancer
         
        Working...
        X