Is there a way to rank shares based on their simulation results?
For example running the simulation over all ASX stocks and displaying the top 10 based on their annual return.
Do you want to create a system that buys the top 10 stocks or do you want to simply display the top 10 stocks (based on annual return) for your simulation?
Actually just displaying the top 10 was what I had in mind. I am currently doing this one stock at a time, but I'm sure there's probably an easier way. I cannot put all the stocks into a list, since they interfere with each other.
However, now that you mention it, is there a way to use the simulation results to produce another system which would buy or sell based on these results? I believe this would require the simulator to be callable via a function or something in the script.
In the Simulation Report, you have the list of trades under the "Trades" tab.
Do you want to group the result by stock name? or calculate the annual return of each trade from the total performance?
You can create a trading system that buys the top 10 stocks based on any criteria by creating a long ranking system and setting the maximum number of positions to ten.
You can also create a trading system that buys and sells stocks depending on the last trade results of these stocks using the money management script.
Thank you for you prompt responses. You have been great so far.
I think there is a misunderstanding.
The trading system I have includes:
1. trading system via formula editor, where I have scripted a buy rule.
2. a complex advance money management script
The money management script takes into account the amount of equity available before allowing a trade etc.
Therefore when I do a simulation I only use 1 stock at a time, so that the stock would have access to the full equity during the simulation.
What I want to do is to compare the results of the simulation on each stock, and therefore give each stock a score based on how well it did on the simulation on its own.
For example, the procedure I am performing at the moment: stockA, stockB
- Update the trading system, setting symbols to stock A.
- Run the simulation, and note down the results (return, draw down etc).
- Update the trading system, setting symbols to stock B.
- Run the simulation, and note down the results (return, draw down etc).
And so on and so forth with other stocks.
I have not worked with ranking system yet, but I don't think I'll be able to write a criteria that matches exactly what 1. & 2. does under simulation. (If I'm wrong about this let me know :) ).
Therefore the question is whether there is quick way I can run the simulation on all the stocks in a given list (thereby producing a simulation report for each stock), instead of having to manually edit the symbols list for the trading system, after each simulation.
I hope that made it clearer as to what I am trying to achieve,
On the "OnStartSimulation" event, type:
Functions.SetTextInput("symbol", "A", "Symbol Name");
On the "OnNewPosition" event, type:
string symbol = (string)Variables.GetVariable("symbol");
symbol = symbol.ToUpperInvariant();
if(NewPosition.Symbol != symbol)
{
Functions.RejectPosition();
}
This will create a money management input (symbol).
Click on the PLUS icon next to optimize and then type your symbols: (Separated by a semicolon)
Example: A;AA;AAAGY
Finally, click on "Optimize". This will create a report for each symbol.
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.