ie: I'm trading equities (SPY) and have a limit order of 1000 shares but it gets filled in small quantities of 120 shares, 127 shares, 25 shares ...etc. all the way until my 1000 total. even though the stock is very liquid and I'm sure my 1000 shares would get filled fully in one shot. this occurs for all the trades whether its an entry or stop or target.
Also here is my code (it seems to work as planned in market replay...except for the above mentioned problem). Will this work if I go live or do I need to use Iorder and stuff (I'm not an advanced programmer and programming this seemed way to easy...so I'm assuming I need to add stuff for error checking and stuff)
Here is the jist of it:
protectedoverridevoid Initialize()
{
CalculateOnBarClose = false;
TraceOrders =true;
}
protectedoverridevoid OnBarUpdate()
{
if (something is true)
{
EnterLongLimit(1000, (High[1]+ 0.02), "");
SetProfitTarget(CalculationMode.Price, (High[1] + (2*(High[1]-Low[2]))));
SetStopLoss(CalculationMode.Price, (Low[2]- 0.03));
}
if (something is true)
{
EnterShortLimit(1000, (Low[1]- 0.02), "");
SetProfitTarget(CalculationMode.Price, (Low[1] - ((High[2]-Low[1]))));
SetStopLoss(CalculationMode.Price, (High[2]+ 0.03));
}
}
Comment