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

Exit on Session End Close As Entry

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

    #16
    Hi Brandon,

    Thanks for the reply and explanations.

    It seems the issue only affects Ninjatrader Strategy Tab but does not affect the Executions.
    So it seems I can leave it as is.
    I'll test it live and see how it fares. Thanks.

    About the Add On method:

    Can the AddOn method detect and cancel or change unmanaged automatically placed by the strategy orders?
    Or is it restricted to manually entered orders?
    If it does apply to unmanaged automatically placed by the strategy orders can you please refer the exact documentation?

    EDIT:

    What is the way to code the following into the strategy:

    After each closing order is filled, make the Strategy auto-disable itself and then immediately auto-reenable itself?
    Last edited by Cormick; 08-12-2021, 04:25 AM.

    Comment


      #17
      Hello Cormick,

      Thanks for your note.

      The AddOn approach can detect orders placed manually and orders place by a strategy.

      Please see the help guide documentation linked in post number 11 in regards to detecting trades and managing them programmatically. You would need to detect and track orders placed by the strategy the same way you would detect and track manually placed orders.
      1. Loops through the Account.Orders collection for the account to find active orders
      2. Subscribes to Account OrderUpdate events to look for any newly opened orders.
      3. Tracks these Orders in the script so they can be changed or canceled with Account.Change or Account.Cancel
      After each closing order is filled, make the Strategy auto-disable itself and then immediately auto-reenable itself?

      You would be able to disable the strategy when an order is filled by using CloseStrategy(). However, there are no documented or supported means for having a strategy re-enable itself. You would have to enable to strategy by clicking the 'enable' box on the Strategies tab or from a chart by checking the enable box in the Strategies window (Chart Toolbar > Strategies button).

      Let us know if we may assist further.
      Brandon H.NinjaTrader 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