Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

How to harmonize external events and an automated strategy ?

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

    How to harmonize external events and an automated strategy ?

    Scenario:.
    1) Entered 1 x long /ES contract at 5000, bracket orders at 5005 and 4995.
    2) Broker daily loss limit: $100 more to go
    3) Price goes to 4998, account is down $100 and hit the daily loss limit. Broker issues a cancel all orders and flatten. Account goes into liquidation mode (unable to trade anymore).
    4) To the Ninjascript strategy, the position size is still 1 x long when the actual value should be 0. Events from #3 does not update this value within the strategy.

    What is a good way to deal with this discrepancy ? Should I try to listen to event from #3 and exit my strategy straight away ? The broker I am using is Tradovate if that is helpful.
    Last edited by elirion; 05-09-2024, 09:34 PM.

    #2
    Hello elirion,

    Any orders that are not made by the strategy instance will not be seen by the strategy and will not effect the strategy position.

    If the strategy and account are long, and the account has a sell order, this would make the strategy position and account position no longer in sync.

    You can place manual orders to the account so that the account position will match the strategy position.

    Or you can disable the strategy, flatten the account, and re-enable the strategy using the Wait Until Flat Start Behavior.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Thanks for your advice Chelsea.

      I guess there is no way to automatically manage this part without human intervention.
      Last edited by elirion; 05-10-2024, 07:29 AM.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by argusthome, 03-08-2026, 10:06 AM
      0 responses
      116 views
      0 likes
      Last Post argusthome  
      Started by NabilKhattabi, 03-06-2026, 11:18 AM
      0 responses
      61 views
      0 likes
      Last Post NabilKhattabi  
      Started by Deep42, 03-06-2026, 12:28 AM
      0 responses
      40 views
      0 likes
      Last Post Deep42
      by Deep42
       
      Started by TheRealMorford, 03-05-2026, 06:15 PM
      0 responses
      43 views
      0 likes
      Last Post TheRealMorford  
      Started by Mindset, 02-28-2026, 06:16 AM
      0 responses
      82 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Working...
      X