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 NullPointStrategies, Yesterday, 05:17 AM
    0 responses
    64 views
    0 likes
    Last Post NullPointStrategies  
    Started by argusthome, 03-08-2026, 10:06 AM
    0 responses
    139 views
    0 likes
    Last Post argusthome  
    Started by NabilKhattabi, 03-06-2026, 11:18 AM
    0 responses
    75 views
    0 likes
    Last Post NabilKhattabi  
    Started by Deep42, 03-06-2026, 12:28 AM
    0 responses
    45 views
    0 likes
    Last Post Deep42
    by Deep42
     
    Started by TheRealMorford, 03-05-2026, 06:15 PM
    0 responses
    50 views
    0 likes
    Last Post TheRealMorford  
    Working...
    X