Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Is OnExecutionUpdate exlcusive for each strategy?

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

    Is OnExecutionUpdate exlcusive for each strategy?

    Hi,

    Does OnExecutionUpdate only run based on executions for that specific strategy? Or will it run if there is an execution for another strategy that I have simultaneously running? For example, if I have two strategies running on the same asset, and the first strategy takes an entry while the second strategy is flat. Let's say that this first strategy entry hits stop loss, will this stop loss execution cause for code pertaining to stop losses in OnExecutionUpdate in the second strategy to run?

    My main reason for asking is because if I have a rule in my second strategy that prevents entries in the same direction after the previous trade was a stop loss, I need to know if stop loss executions on the same asset will cause issues even if it is a completely different strategy with different code. Ideally, I would like for the OnExecutionUpdate to not interfere with eachother across strategies but I'm guessing there is a workaround if the OnExecutionUpdate does still run based on outside strategy executions.

    Thank you for your help on this!

    #2
    A different Strategy is a different object.

    Each Strategy object's methods are completely independent,
    and called independently, of every other Strategy object.

    Even if you start the same Strategy twice, the two different
    Strategy objects don't know about each other internally and
    never interfere with the calling of each other's methods.

    Any rules to 'prevent entries in the same direction' is specific
    to that Strategy object. Eg, the 2nd Strategy object can only
    know about the 1st Strategy object's rule 'has been
    engaged' if you write your own very specific logic to
    make each Strategy aware of the other.

    That is, by default, a Strategy object never talks to another
    Strategy object. I mean, each Strategy object is completely
    independent and unaware of any other Strategy objects,
    whether they running or disabled.

    Just my 2˘.

    Last edited by bltdavid; 01-23-2024, 03:24 PM. Reason: typo

    Comment


      #3
      Hello,

      bltdavid is correct.

      The OnExecutionUpdate() method called in one strategy will be independent and not affect OnExecutionUpdate() called in a different strategy.

      Please let us know if you have any further questions.
      Gaby V.NinjaTrader Customer Service

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by brucerobinson, Yesterday, 07:08 AM
      5 responses
      36 views
      0 likes
      Last Post brucerobinson  
      Started by dominikstiffel, Today, 03:56 AM
      0 responses
      8 views
      0 likes
      Last Post dominikstiffel  
      Started by gustavobp, Today, 02:50 AM
      0 responses
      7 views
      0 likes
      Last Post gustavobp  
      Started by fkronloff, Today, 12:25 AM
      0 responses
      7 views
      0 likes
      Last Post fkronloff  
      Started by Zadomani, Yesterday, 11:39 PM
      0 responses
      15 views
      0 likes
      Last Post Zadomani  
      Working...
      X