1) Is it possible to create a symbol from a simulattion/backtest by C# code in either AMM or function-script? Similar to pressing "Equity to Symbol" button in simulator, but in code to specify symbol properties and use in other scripts.?
2) Is it possible to assign symbols to be used in simulator by code? TradingSystemSettings.Symbols seems to be read only, and if setting no rule in "Symbols & Dates" but a filter rule in QS then the simulator runs through all symbols, thus slowing down simulation.
Have been looking for a way using available methods, but could not find one.
let me add one more as this has kept me busy whole afternoon:
3) How can I smartly use the Combination element from lex index (see link below) AND ranking by comp() function together in the simulator?
Currently I have like:
Rule1: FirstDOM
Rule2: in Combination element from lex index (5 out of total of 50 symbols)
Rule3: comp(something,"rank")
buy =Rule1 and Rule2 and (Rule3<= max nbPositions)
Sell = Rule1 and (Rule3 > max nbPositions(=5))
This worked fine without Rule2, but I guess Rule 3 with the comp() functions runs over ALL symbols selected in (Symbols & Dates), while the actual list is limited to 5 by Rule2 --> so the <= or > max nb asset rule does not work anymore....
Especially the sell rule is important, as I need to kick-out the symbols that are not in the Top5 anymore..
1/ Currently, the easiest way is to save new symbols data in files using "System.IO.File.WriteAllText", then creating these symbols by importing the data using "Data -> ASCII Import".
2/ "Symbols" cannot be defined programmatically because the MM script is executed only after reading quotes and parsing QS formula.
3/ For this you must use the filter parameter of the "comp" function. Example:
a = comp(something, "rank", 1, Rule2);
In this case, only symbols that passe "Rule2" are ranked.
Do you have an example code for putting simulator equity into new symbol by code? Have been looking ín forum to save some time, maybe there is something already done.
Eg. get equity vector from simulator, create symbo in dbl, create symbol quotes in db?
There is no single instruction to do this. As I said, you can save equity data on a file then run the ASCII Import tool (manually) to import the data and create a new symbol but in this case it is much easier to create the equity symbol manually directly from the simulator report.
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.