Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

the best/most secure procedure to manually stop running NinjaScript strategy

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

    the best/most secure procedure to manually stop running NinjaScript strategy

    Hi all,

    can you tell me pls what is the best/most secure procedure to manually stop running NinjaScript strategy with open positions?

    Most common situation for me is two or more running strategies with open positions and I need to stop one and be 100 % sure that all running/pending/OCO/ATM orders/positions are canceled/closed/flat for this one strategy while others will continue.

    From help seems to be enough to disable strategy first, then cancel orders in Control Center in tab Orders if any, and check/close positions in tab Positions if any related to closed strategy. Is this correct? What about any ATMs/OCOs etc.? Command Flatten Everything is not good option as it disables all NinjaScript strategies, right?

    For more easy way to cancel related orders automatically I have checked both 'Cancel entry orders when a strategy is disabled' and 'Cancel exit orders when a strategy is disabled' options in Settings, Strategies, NinjaScript.

    Thanks.

    #2
    Hello marada,

    Thanks for your post.

    When a NinjaScript strategy is stopped, it is possible for an open position and working orders to be left running. If they are left, these would need to be cancelled manually.

    You have already identified the 'Cancel entry/exit orders when a strategy is disabled' option to automatically cancel entry and exit orders including SetStopLoss/SetProfitTarget orders.

    If the strategy calls an Atm Strategy using the AtmStrategyMethods (such as AtmStrategyCreate()), these will not be cancelled with the 'Cancel entry/exit orders' option.


    You can write into the OnTermination(), part of the script to close your position, cancel any working orders, and close any working Atm Strategies that may have been invoked.

    Below is a link to the help guide on OnTermination().
    http://www.ninjatrader.com/support/h...ermination.htm
    Chelsea B.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by alifarahani, Today, 09:40 AM
    2 responses
    12 views
    0 likes
    Last Post alifarahani  
    Started by junkone, Today, 11:37 AM
    3 responses
    15 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by pickmyonlineclass, Today, 12:23 PM
    0 responses
    1 view
    0 likes
    Last Post pickmyonlineclass  
    Started by frankthearm, Yesterday, 09:08 AM
    12 responses
    44 views
    0 likes
    Last Post NinjaTrader_Clayton  
    Started by quantismo, 04-17-2024, 05:13 PM
    5 responses
    35 views
    0 likes
    Last Post NinjaTrader_Gaby  
    Working...
    X