Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Start strategy form script

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

    Start strategy form script

    Hello,

    Is it possible to start or close (enable\disable) strategy from NT script and not from control center or chart?

    Sincerely, Kobi



    #2
    Hello Kobi,

    Thanks for your post.

    There is not a way to programmatically enable strategies, but strategies can be programmatically disabled by looping through the Account.Strategies collection and calling CloseStrategy for each strategy in the collection. For example:

    Code:
    Account myAccount;
    
    lock (Account.All)
        myAccount = Account.All.FirstOrDefault(a => a.Name == "Sim101");
    
    foreach(StrategyBase strat in myAccount.Strategies)
        strat.CloseStrategy("Close Strategy");
    Account.Strategies - https://ninjatrader.com/support/help...es_account.htm

    CloseStrategy - https://ninjatrader.com/support/help...sestrategy.htm

    We look forward to assisting.

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Mindset, 04-21-2026, 06:46 AM
    0 responses
    88 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by M4ndoo, 04-20-2026, 05:21 PM
    0 responses
    134 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Started by M4ndoo, 04-19-2026, 05:54 PM
    0 responses
    68 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Started by cmoran13, 04-16-2026, 01:02 PM
    0 responses
    119 views
    0 likes
    Last Post cmoran13  
    Started by PaulMohn, 04-10-2026, 11:11 AM
    0 responses
    67 views
    0 likes
    Last Post PaulMohn  
    Working...
    X