Click here to Login

                                                   Exporting optimized test data from trading report


2018-12-03 16:08:56

Hey All,
i am testing various entrance and exit methods over a time period with different optimizations and i wanted to ask if there was a nice easy way to export the optimized basic info from each entrance and exit method so that i could compare them in an excel file.
when i say the basic info i am meaning just the A. return, Drawdown, Sharpe, P.Winners and the optimization values for each different optimized test that is displayed in the report table in the top of the responses. i also wanted to ask if i was able to easily add additional tabs to this to display other aspects of the report more easily for instance to display the percent winners of long trades short trades and then total.
thank you in advance,

2018-12-04 03:50:20


You can display the optimization report by selecting "Tools -> Optimization Report" in the simulator manager.
If "Tools" is not present in the simulation manager toolbar then click on the "+" icon.

After that you can export the whole data by clicking on the "Export Data" button.

If you want to export more/advanced/custom fields then you need to use the money management tool for that.

2018-12-21 20:28:04


@quantshare can you list the different identifiers for the variables found in the Statistics page? i am trying to get them to display on the optimization report by using the money management script where as i would add the column in the on start simulation page with code such as
Event: onstartsimulation
Functions.AddReportMetric("long%Return", 0);
Functions.AddReportMetric("long%winners", 0);
Functions.AddReportMetric("Short%Return", 0);
Functions.AddReportMetric("Short%winners", 0);

//and things such as that you would fine in the statistics tab of each optimization once opened

i would assume i would be able to insert similar code into the
Event: onendsimulation
where as i would find and just pull the variable from the already calculated report in the statistics page.

Functions.AddReportMetric("long%Return", longpercentreturn);
Functions.AddReportMetric("long%winners", longpercentwinners);
Functions.AddReportMetric("Short%Return", shortpercentreturn);
Functions.AddReportMetric("Short%winners", shortpercentwinners);

Variables.SetVariable("long%Return", longpercentreturn);
Variables.SetVariable("long%winners", longpercentwinners);
Variables.SetVariable("Short%Return", shortpercentreturn);
Variables.SetVariable("Short%winners", shortpercentwinners);

i just don't know the proper language to get this done properly and i need some help.
thank you

2018-12-22 05:19:35


You cannot access these variables from the money management script. You should create a metric from the simulator manager and include this so it is displayed in the simulation and optimization reports.

Check this:

2018-12-23 13:04:07


All right, that makes sense. now using that feature if i wanted to display the double value and not perform an if statement with a bool output what would the language look like to display this? your example from this link dose not disclose this. for instance if i wanted to display net profit of the long trades and long percent gains what might this look like?
thank you,

2018-12-26 08:06:47


Best Answer
You need to assign any numeric value to the "Fitness" variable.

Fitness = SharpeRatio;

You can only one metric per script.

2018-12-26 18:33:16


ok so it seems like we are Almost there! i have found the Database of the Simulation metric members, the issue i am having now is that these only display the metrics of the entire system. what would the language be for this if i wanted to see the long or the short side?
i have tried things like
Fitness = NetProfitLong;
Fitness = LongNetProfit;
neither of which work, and become highlighted in blue showing that it is referencing a variable.
please help,
thank you,

2019-01-02 20:29:12


hey quantshare,
i am still looking to see what language would be used for looking at the outcome of the net profit of long trades and the net profit of short trades. please let me know what language would be used to get this output using the Fitness variable.

2019-01-03 19:24:09


this is what was displayed from Azouz,
Hi Matt,

After you type fitness =
use CTRL+SPACE shortcut to list all available variables/metrics that you can use. Only these can be used. For advanced/different metrics, you need to use the money management tool and create them from scratch.

the metrics that i am looking for are NOT listed in this list as i stated above. it also appears that based off of your earlier question that i am NOT able to create these metrics from scratch based off of your earlier comment. so how am i able to get these metrics to display the LONG and short side of the profitability as well as percent winners that are displayed under the statistics tab of the report. not exactly sure why it is so difficult to pull data out of the report or at least reference some cells that are being used to then copy that information to the tabs so it can be properly displayed on the optimization report.

2019-01-04 05:33:28


These variables are not available in the list of metrics.
I said "You cannot access these variables from the money management script" but you can create them from scratch.

For the NetProfitLong, for example, you need to use the "OnClosePosition" for example, track every closing position and update the variable accordingly.
Then display the metric using the "OnEndSimulation" event.

If you just want to export the data then there is an "Export data" button under the "Statistic" tab of the simulation report.

2019-01-04 12:24:59


Why would you think that the net long profit would not be a needed variable to output as it is something that is clearly needed. Why don%u2019t you show me exactly the code that is needed for NetProfitLong for example and show exactly how to track these since you don%u2019t include this clearly needed variable as a variable

2019-01-04 12:47:32


Why don%u2019t you do us all a favor and show us exactly the code needed so we know it will work and put this issue to bed and add it to the library since it is something that is clearly needed since others have tried to develop things like it and failed and had issues with it rather than just pointing to other submittions from other people that may or may not work and also need vast amounts of modification to even begin to look proper

2019-01-07 04:47:23



Please send an email to support with your exact need and we will send you a quote regarding this custom development.
Otherwise, you can also send an email to support and request to add these metrics in a future release.

No more messages


No html code. URLs turn into links automatically.

Type in the trading objects you want to include: - Add Objects
To add a trading object in your message, type in the object name, select it and then click on "Add Objects"


Trading Items
Insider Trading Data
Currency Trading News from Yahoo - Forex Market
Insider trading data
Lagged Data From a Custom Database
Market cap, ROE, ROA and Forward PE for U.S. Stocks - Fundamental...

How-to Lessons
How to import trading data from CSV files
How to hide a trading indicator from a particular time frame
How to generate buy/sell signals from a trading system
How to get trading orders from a portfolio programmatically
How to export trading data to a CSV file

Related Forum Threads
Exporting various data
Fundamental data from IB
Custom Plugin to get Live Market depth data from IQfeed
Simulator Trading System Report
Removing freak data from the database

Blog Posts
Reading and Exporting Data from QuantShare to Excel Programmatica...
Backtesting trading strategies using intraday data
Trading Forex with the commitments of traders report
Day Trading: A trading system that combines intraday and EOD data
How to create buy and sell trading rules based on News Data

Create an account
Affiliate Program
Contact Us
Trading Forum
How-to Lessons
About Us
Terms of Use

Copyright 2019
Social Media
Follow us on Facebook
Twitter Follow us on Twitter
Follow us on Google+
RSS Trading Items

Trading financial instruments, including foreign exchange on margin, carries a high level of risk and is not suitable for all investors. The high degree of leverage can work against you as well as for you. Before deciding to invest in financial instruments or foreign exchange you should carefully consider your investment objectives, level of experience, and risk appetite. The possibility exists that you could sustain a loss of some or all of your initial investment and therefore you should not invest money that you cannot afford to lose. You should be aware of all the risks associated with trading and seek advice from an independent financial advisor if you have any doubts.