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, 05-11-2026, 05:56 AM
    0 responses
    52 views
    0 likes
    Last Post CarlTrading  
    Started by CarlTrading, 05-10-2026, 08:12 PM
    0 responses
    30 views
    0 likes
    Last Post CarlTrading  
    Started by Hwop38, 05-04-2026, 07:02 PM
    0 responses
    194 views
    0 likes
    Last Post Hwop38
    by Hwop38
     
    Started by CaptainJack, 04-24-2026, 11:07 PM
    0 responses
    355 views
    0 likes
    Last Post CaptainJack  
    Started by Mindset, 04-21-2026, 06:46 AM
    0 responses
    274 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Working...
    X