• 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 that use an Indicator, how is the sync. between them?

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

    Strategy that use an Indicator, how is the sync. between them?

    Hi,

    I'm developing a strategy that gets it signals from an indicator.
    When the Strategy OnBarUpdate() is called, can I assume the indicator has already done its calculation and when the strategy will call the indicator, to gets its data, the OnBarUpdate() of the indicator was called?

    I tried to run it with a debugger and it doesn't look to be in sync.
    This mean that I have to put all the Indicator logic in the strategy?

    I'm a little confuse about it.

    Tx in advance!

    #2
    freewind, what are you trying to get from the indicator? A value / dataSeries it would plot or an exposed variable?

    http://www.ninjatrader.com/support/h...nt7/update.htm
    BertrandNinjaTrader Customer Service

    Comment


      #3
      Thanks Bertrand, I did know about the Update() method.

      In my design the indicator check if I should enter a position and the strategy handle the position.
      This is easier for me to break up the code.
      It is important for me that the indicator will have accurate data and will be sync. with the strategy series.
      If you have and more suggestions it will be great. In the mean time I'll play with the Update and see what results I'm getting.

      Tx!

      Comment


        #4
        Hello freewind, I do not see an sync issue per se, if you're working with multiple series it would be important to call the indicator value in the correct context - printing the value returned with the timestamp, BarsInProgress and CurrentBar would help understand the structure better.
        BertrandNinjaTrader Customer Service

        Comment


          #5
          I see that the strategy OnBarUpdate() is called first(When I debug, the strategy breakpoint hit first).
          So if I have calculations in the indicator OnBarUpdate() which the strategy use, can I trust they are in sync.? is there some magic happens behind the scene? otherwise I don't understand it.

          Comment


            #6
            Originally posted by freewind View Post
            I see that the strategy OnBarUpdate() is called first(When I debug, the strategy breakpoint hit first).
            So if I have calculations in the indicator OnBarUpdate() which the strategy use, can I trust they are in sync.? is there some magic happens behind the scene? otherwise I don't understand it.
            This is really not well explained concept also for me.

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by JellyRoll, Today, 06:57 PM
            1 response
            16 views
            0 likes
            Last Post bltdavid  
            Started by Dan_D_Trader, Today, 06:22 PM
            1 response
            3 views
            0 likes
            Last Post Emma1
            by Emma1
             
            Started by gemini42, Today, 01:53 AM
            1 response
            10 views
            0 likes
            Last Post NinjaTrader_ShawnB  
            Started by asmmbillah, Today, 04:42 PM
            4 responses
            27 views
            0 likes
            Last Post asmmbillah  
            Started by JAtrades, Today, 02:44 PM
            3 responses
            18 views
            0 likes
            Last Post NinjaTrader_ShawnB  
            Working...
            X