Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

Access to ATM OnPositionUpdate events within strategy

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

    Access to ATM OnPositionUpdate events within strategy

    Working a strategy that creates ATM orders while in real-time mode.

    It is desirable to be able to access the callback events for things like OnPositionUpdate, OnOrderUpdate, etc to manage the logic and do some error handling.

    Normally these are not called back from an ATM execution, only from a normal managed order execution.

    states:
    "You will NOT receive position updates for manually placed orders, or orders managed by other strategies (including any ATM strategies) in OnPositionUpdate(). The Account class contains a pre-built event handler (PositionUpdate) which can be used to filter position updates on a specified account."


    It seems like these types of events are available for the entire account via PositionUpdate within the addon functionality?


    Is there a way to access this within the strategy?
    (I'm struggling especially with the other required code to manage the addon tab, maybe an example would be enough to get me there
    "// Other required NTTabPage members left out for demonstration purposes. Be sure to add them in your own code." )

    Thanks,
    John

    #2
    Welcome to the forums MKV17!

    Your understanding is correct. ATM strategies are started as separate strategies and would not be accessible in the NinjaScript strategy's OnPositionUpdate event method. You could use the AddOn Framework PositionUpdate event to get account level PositionUpdate events, and this would reflect the actual position updates that are happening on the account. This reflects the entire account however, and would not be specific for an ATM strategy.

    When monitoring and manipulating an ATM strategy through a NinjaScript strategy, the ATM Strategy methods should be used.



    If you are looking to wire in OnPositionUpdate events or similar, the ATM strategy would be better implemented directly in a NinjaScript strategy as opposed to being initiated through the ATM Strategy methods.

    Please let us know if you have any questions.
    JimNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by algospoke, Yesterday, 06:40 PM
    2 responses
    19 views
    0 likes
    Last Post algospoke  
    Started by ghoul, Today, 06:02 PM
    3 responses
    14 views
    0 likes
    Last Post NinjaTrader_Manfred  
    Started by jeronymite, 04-12-2024, 04:26 PM
    3 responses
    45 views
    0 likes
    Last Post jeronymite  
    Started by Barry Milan, Yesterday, 10:35 PM
    7 responses
    20 views
    0 likes
    Last Post NinjaTrader_Manfred  
    Started by AttiM, 02-14-2024, 05:20 PM
    10 responses
    181 views
    0 likes
    Last Post jeronymite  
    Working...
    X