• 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
            Vps by stooby
            Started by stooby, Today, 08:32 PM
            0 responses
            11 views
            0 likes
            Last Post stooby
            by stooby
             
            Started by FaaastEddy, Today, 08:25 PM
            0 responses
            3 views
            0 likes
            Last Post FaaastEddy  
            Started by YevhenShynkarenko, Yesterday, 01:22 AM
            2 responses
            39 views
            0 likes
            Last Post NinjaTrader_ChelseaB  
            Started by testingsarasa, 05-20-2018, 02:50 PM
            11 responses
            736 views
            0 likes
            Last Post NinjaTrader_ChelseaB  
            Started by martyn73, Today, 05:27 PM
            2 responses
            10 views
            0 likes
            Last Post martyn73  
            Working...
            X