Posted 3/12/2010 00:23:53
|
|
|
|
Hello,
I want to simulate fills on the close of the same bars on which a position is sent for execution in the RE paper trader. I looked at all the other threads that treated this issue, implemented the code and suggestions but still dont seem to be able to get where I want to. I use daily bar data and daily system frequency. I simply like to get the price on the fill of the same bar when the order was executed due to a signal that was triggered on the very same bar. With below code I get filled on the open of that bar which is very strange and would definitely mean I am forward looking. I just want to get filled on the close of the same bar as the signal and execution for both, new open and closing orders.
Could you please have a look and suggest what I may be doing wrong?
thanks a lot
Brian
SYSTEM CLASS:
public override void Startup()
{
SystemData.CreateTicksFromBars = true;
SystemData.EnableTradeOnClose = true;
SystemData.BarClosing += BarClosing;
}
public void BarClosing(object sender, NewBarEventArgs args)
{
foreach (Symbol symbol in args.Symbols)
{
SymbolScripts[symbol].BarClosing();
}
}
SYMBOL CLASS:
public void BarClosing()
{
//Trade Entries
TradeExecution.TradeEntry(SystemData, settings, Symbol, Bars, positionList);
}
Trade Entry is a function within I send a market order.
|
|
Posted 3/12/2010 09:04:43
|
|
|
|
| Per your previous thread, we're looking into this. Stand by.
|
|
Posted 3/23/2010 11:03:52
|
|
|
|
|
|
Posted 3/24/2010 00:37:31
|
|
|
|
There was a bug in the BarClosing logic which caused the whole bar to be reprocessed, instead of just the closing price. This would mean market orders would be filled at the open price instead of the close price. This will be fixed in the next build.
Thanks for bringing this to our attention,
Daniel
|
|
|
|