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 CarlTrading, 03-31-2026, 09:41 PM
    1 response
    80 views
    1 like
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 04-01-2026, 02:41 AM
    0 responses
    40 views
    0 likes
    Last Post CarlTrading  
    Started by CaptainJack, 03-31-2026, 11:44 PM
    0 responses
    64 views
    2 likes
    Last Post CaptainJack  
    Started by CarlTrading, 03-30-2026, 11:51 AM
    0 responses
    64 views
    0 likes
    Last Post CarlTrading  
    Started by CarlTrading, 03-30-2026, 11:48 AM
    0 responses
    54 views
    0 likes
    Last Post CarlTrading  
    Working...
    X