I'm monitoring all trades done by a strategy to process the data further into a DB...
Therefore I'm using the 'Trade' object.
Now, I encountered a funny behaviour in a "scale-in" strategy, where a full
position is build after several (long) trades.
By the way, in a normal strategy (without scaling) this all is working like a charme)
Let's take my current backtest as an example, lets imagine 6 buys, 1 every day, and on the 7th day a full liquidation.
Please have a look at the attached picture!
Ok I would expect this code
Trade t = Performance.AllTrades[Performance.AllTrades.Count-1];
Print(t.Entry.ToString());
Print(t.Exit.ToString());
But here is the result for the entry: It prints 6 entries but it takes the last 'buy' day
and the entry price of that day, which was 9010.
Execution='NT-00005' Instrument='FDAX 03-14' Account='Backtest' Name='Buy' Exchange=Default Price=9010 Quantity=1 Market position=Long Commission=0 Order='NT-00005' Time='16.12.2013 22:00:00'
Execution='NT-00005' Instrument='FDAX 03-14' Account='Backtest' Name='Buy' Exchange=Default Price=9010 Quantity=1 Market position=Long Commission=0 Order='NT-00005' Time='16.12.2013 22:00:00'
Execution='NT-00005' Instrument='FDAX 03-14' Account='Backtest' Name='Buy' Exchange=Default Price=9010 Quantity=1 Market position=Long Commission=0 Order='NT-00005' Time='16.12.2013 22:00:00'
Execution='NT-00005' Instrument='FDAX 03-14' Account='Backtest' Name='Buy' Exchange=Default Price=9010 Quantity=1 Market position=Long Commission=0 Order='NT-00005' Time='16.12.2013 22:00:00'
Execution='NT-00005' Instrument='FDAX 03-14' Account='Backtest' Name='Buy' Exchange=Default Price=9010 Quantity=1 Market position=Long Commission=0 Order='NT-00005' Time='16.12.2013 22:00:00'
Execution='NT-00005' Instrument='FDAX 03-14' Account='Backtest' Name='Buy' Exchange=Default Price=9010 Quantity=1 Market position=Long Commission=0 Order='NT-00005' Time='16.12.2013 22:00:00'
Execution='NT-00006' Instrument='FDAX 03-14' Account='Backtest' Name='Sell' Exchange=Default Price=9168.5 Quantity=6 Market position=Short Commission=0 Order='NT-00006' Time='17.12.2013 22:00:00'
Execution='NT-00006' Instrument='FDAX 03-14' Account='Backtest' Name='Sell' Exchange=Default Price=9168.5 Quantity=6 Market position=Short Commission=0 Order='NT-00006' Time='17.12.2013 22:00:00'
Execution='NT-00006' Instrument='FDAX 03-14' Account='Backtest' Name='Sell' Exchange=Default Price=9168.5 Quantity=6 Market position=Short Commission=0 Order='NT-00006' Time='17.12.2013 22:00:00'
Execution='NT-00006' Instrument='FDAX 03-14' Account='Backtest' Name='Sell' Exchange=Default Price=9168.5 Quantity=6 Market position=Short Commission=0 Order='NT-00006' Time='17.12.2013 22:00:00'
Execution='NT-00006' Instrument='FDAX 03-14' Account='Backtest' Name='Sell' Exchange=Default Price=9168.5 Quantity=6 Market position=Short Commission=0 Order='NT-00006' Time='17.12.2013 22:00:00'
Execution='NT-00006' Instrument='FDAX 03-14' Account='Backtest' Name='Sell' Exchange=Default Price=9168.5 Quantity=6 Market position=Short Commission=0 Order='NT-00006' Time='17.12.2013 22:00:00'
Object and could see the real entry prices, but not in the Trade object...
Am I missing someting? Any help welcome.
All the best

Comment