In my NinjaScripts, I'm using the methods such as EnterLong(), ExitLong(), EnterLongLimit() etc. This is the Managed approach, correct me if I'm wrong. In the Options dialog, I have set the Strategies NinjaScript tab, I chose
- 'Wait until flat before executing live' in the 'On Starting' panel
- false for 'Cancel entry orders when strategy disabled' in 'Order Handling'
- false for 'Cancel exit orders when strategy disabled' - 'Recalculate' for 'On Connection Loss - Handling'
- when loading the Strategy, I set the 'Sync account position' to false.
Please can you correct me if I'm wrong, but this is what I want (and assume) to be the case with this configuration:
(1) if my account is flat, no strategies are running, and I have deleted all existing orders, then when I start up a strategy, the strategy will not fire any exit orders for positions that would have been in place from beforehand.
(2) if my account is not flat because a strategy has a position on, but I had to reboot my PC or some such situation, I restart my strategy and delete orders and flatten positions (or leave them) appropriately so the account is where it should be in accordance with the strategy, i.e. I manuallly manage the trading until the strategy goes flat.
(3) because I use 'recalculate' for connection loss handling, when the strategies are interrupted and then reconnected automatically, with this config, the trading will resume according to plan with some execution price 'slippage' caused by the connection loss under some circumstances.
I have run strategies for 2 days, changing the settings as I learn what they really mean - or what I think they mean. In the Help, there is a section on the 'Sync account position' property which states:
Thanks

Comment