I have a strategy based on unmanaged approach to submit manual orders when certain conditions are met.
I would like to resume my historical orders via the strategy after any connection loss or PC restart.
I have the following options in State.SetDefaults:
Calculate = Calculate.OnEachTick;
EntriesPerDirection = 1;
EntryHandling = EntryHandling.AllEntries;
IsExitOnSessionCloseStrategy = true;
ExitOnSessionCloseSeconds = 30;
IsFillLimitOnTouch = false;
MaximumBarsLookBack = MaximumBarsLookBack.TwoHundredFiftySix;
OrderFillResolution = OrderFillResolution.Standard;
Slippage = 0;
StartBehavior = StartBehavior.ImmediatelySubmit;
TimeInForce = TimeInForce.Gtc;
TraceOrders = true;
RealtimeErrorHandling = RealtimeErrorHandling.IgnoreAllErrors;
StopTargetHandling = StopTargetHandling.PerEntryExecution;
BarsRequiredToTrade = 20;
IsUnmanaged = true;
IsAdoptAccountPositionAware = true;
ConnectionLossHandling = ConnectionLossHandling.KeepRunning;
// Disable this property for performance gains in Strategy Analyzer optimizations
// See the Help Guide for additional information
IsInstantiatedOnEachOptimizationIteration = true;
At the moment, I am not able to catch any previous existing order.
I place an order by using the strategy. Afterwards I disable the strategy and, as soon I re-enable it again, my orders are cancelled immediately.
I tried the same thing with Playback and IB paper account but I get the same result.
My strategy is based on UnmanagedTemplate_January2020 code.
What could be the problem? Do you have any example to share to do that?
Thanks & Regards
Comment