• 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 tonynt, Today, 02:48 AM
        0 responses
        5 views
        0 likes
        Last Post tonynt
        by tonynt
         
        Started by cls71, Today, 02:11 AM
        1 response
        9 views
        0 likes
        Last Post bkool
        by bkool
         
        Started by RB104, Today, 01:52 AM
        0 responses
        4 views
        0 likes
        Last Post RB104
        by RB104
         
        Started by reks13, Today, 01:52 AM
        0 responses
        5 views
        0 likes
        Last Post reks13
        by reks13
         
        Started by raffu, Today, 01:35 AM
        1 response
        12 views
        0 likes
        Last Post raffu
        by raffu
         
        Working...
        X