This kind of lots unavoidable meets massive partial fills.
While testing on Historical Replay I found out that speed of [execution or rendering or internal handling or something else] is slow. It freezing the chart.
I moved from Set() managed approach to advanced Managed Approach and finally to Unmanaged.
Unmanaged is about 30% faster, but it still freezing the chart.
I tried to measure speed of OnBarUpdate(), OnOrderUpdate(), OnExecutionUpdate() methods, but I was unable to find the "speed leaks".
It is, even, more strange because speed of handling of 1 lot is extremely high.
Here is the video of the replay of the simplest strategy and the strategy source code.
It use market entries only.
Adding of protective orders - make strategy even more slow.
Is this expected behaviour? Can I do something to let big orders work faster?
What is the normal speed of order handling?
protected override void OnBarUpdate()
{
if( State != State.Realtime ) return;
if( Position.MarketPosition == MarketPosition.Flat )
{
SubmitOrderUnmanaged( 0, OrderAction.Buy, OrderType.Market, Lot );
return;
}
if( Position.MarketPosition == MarketPosition.Long && Position.Quantity == Lot )
{
SubmitOrderUnmanaged( 0, OrderAction.Sell, OrderType.Market, Lot*2 );
}
if( Position.MarketPosition == MarketPosition.Short && Position.Quantity == Lot )
{
SubmitOrderUnmanaged( 0, OrderAction.Buy, OrderType.Market, Lot*2 );
}
}
Comment