id like to be able to see the results sequence of trades against securities
Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Export to excel
Collapse
X
-
Originally posted by fiddy View PostWhen you run a strategy over multiple instruments, is it possible to export all trades against all securities without having to export each one individually.
id like to be able to see the results sequence of trades against securities
I do a lot of testing of Ninja strategies in Excel, via printing to the output window. This has proven extremely effective.
I've never worked with multiple instruments, but there should be no problems at all. It may depend on how advanced you are with Excel...
Say you're testing the ES and AAPL. Do your print statements something like this (if it's the ES, say)
Print ("ES");
Print ("Trade open = " + TradeOpen);
etc.,
Copy the output window results into Excel, next to a numbered column, and use the LOOKUP functions in Excel to differentiate between the different instruments. This will enable you to get one column for the ES results and another for AAPL.
Comment
-
thanks Arbuthnot
Is it possible to get print each trade data
what I would like is something like
Print ( Instrument name , Open Date , Open Price, Quantity, Close Date , Close Price)
Bertrand: are you able to assist if this is possible and where within the code this would need to be place
Comment
-
Fiddy, I would suggest taking a look at the Performance class for that idea.
You can for example add this snippet in your OnBarUpdate() for testing out accessing those stat collections.
Code:if (Performance.AllTrades.Count > 0) { Trade lastTrade = Performance.AllTrades[Performance.AllTrades.Count - 1]; Print(Instrument.FullName + " " + lastTrade.EntryExecution.Time + " " + lastTrade.EntryExecution.Price + " " + lastTrade.ExitExecution.Time + " " + lastTrade.ExitExecution.Price + " " + lastTrade.Quantity); }
BertrandNinjaTrader Customer Service
Comment
-
Thanks Bertrand and Arbuthnot for your assistance
I added a tradeno check to the code you provided so each trade only gets printed once in the output. This should be sufficient for other users until a cumulative export is provided
if (Performance.AllTrades.Count > 0
&& TradeNo != Performance.AllTrades.Count )
{
Trade lastTrade = Performance.AllTrades[Performance.AllTrades.Count - 1];
TradeNo = TradeNo+1;
Print(Instrument.FullName + " - " + lastTrade.EntryExecution.Time + " - " + lastTrade.EntryExecution.Price + " - " + lastTrade.ExitExecution.Time +
" - " + lastTrade.ExitExecution.Price + " - " + lastTrade.Quantity);
}
Comment
-
I would also vote for improved exporting of results from NinjaTrader.
It is very often used feature and current support for practical exporting is completely insuffiecient.
We also spend much time by iterating over all tabs of backtest result,
exporting each one, then merging them together. because such fundamental
thing for exporting whole backtest is not implemented.
Exporting backtest is really important feature for daily use, when one needs to transfer backtest
result a show/send it to another person.
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by Mestor, Today, 03:15 AM
|
0 responses
1 view
0 likes
|
Last Post
by Mestor
Today, 03:15 AM
|
||
Started by Mestor, 03-10-2023, 01:50 AM
|
11 responses
305 views
0 likes
|
Last Post
by z.franck
Today, 02:29 AM
|
||
Started by Padan, Today, 02:02 AM
|
0 responses
6 views
0 likes
|
Last Post
by Padan
Today, 02:02 AM
|
||
Started by bukowa, 11-09-2023, 06:07 PM
|
20 responses
407 views
0 likes
|
Last Post
by Adfra
Today, 01:36 AM
|
||
Started by yertle, Yesterday, 05:49 PM
|
2 responses
11 views
0 likes
|
Last Post
by yertle
Today, 12:12 AM
|
Comment