PDA

View Full Version : Cancel Strategy


ratherBgolfing
04-12-2006, 05:44 AM
I am running eSignal with NT's ATI and would like to be able to cancel a specific strategy under certain conditions.

For instance, if I am running 3 different strategies in the same account, how can I cancel one without affecting the others.

NTFlattenEverything not only flattens that account but all other accounts.

NTCancelOrder(orderID) cancels a specific order. Can I use this with my strategyID?

Thanks.

NinjaTrader_Ray
04-12-2006, 11:33 AM
Use NTCommand()

for the parameter command, pass in CLOSESTRATEGY and also pass in a strategy id of the strategy you want to close. Please check the Help Docs for accurracy.

ratherBgolfing
04-13-2006, 01:38 PM
Works fine. Thanks.

On occassion I get a message "unknown strategy" which I assume is because it has already been closed or maybe hit its stop?

NinjaTrader_Ray
04-14-2006, 12:36 AM
Means the strategy is closed.

ratherBgolfing
04-14-2006, 07:56 AM
got it....first I was passing the wrong strategyID

...then I was closing it just after the stops closed it....checking NTStrategyPosition(strategyID ) first now....works fine.