Click here to Login





                                                   Equity to Symbol - AMM / Script

  0

0
Alexander Horn
2014-01-08 01:38:06


Dear all,

two questions:

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.

Thanks,
Alex



Alexander Horn
2014-01-08 07:02:21

  0

Sorry,

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..

Thanks in advance,
Alex




QuantShare
2014-01-08 12:25:55

  0

Best Answer
Hi Alexander,

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.





Alexander Horn
2014-01-08 20:20:08

  0

Thks!

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?

Best,
Alex



QuantShare
2014-01-10 12:17:00

  0

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.




No more messages
0




Reply:

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"










QuantShare

Trading Items
Equity Data to Ticker Symbol
Equity Vs Benchmark
Equity and Date Export To Excel
Minimum Variance Optimization with Solver V1.1- AMM
Identify Spilts Screener Script

How-to Lessons
How to run a screen or a watchlist from a script
How to rename a ticker symbol
How to get stocks for a particular index using the global script
How to execute a script at regular intervals
How to quickly add a ticker symbol

Related Forum Threads
AMM ATS script
AMM script global variables do not appear to be thread safe
Accessing Symbol Info in Screener, Strategy script and in MM tool...
Adjust the Entry and exit prices of trades in AMM script
Allow AMM inputs to be set programmatically in script

Blog Posts
Update Chart Layout based on Active Ticker Symbol
QS Trading Software: Global Script
Trading the Strategy Equity Curve
Optimizing the Strategy Equity Curve
Backtesting Your Trading Systems: Symbol Segmentation









QuantShare
Product
QuantShare
Features
Create an account
Affiliate Program
Support
Contact Us
Trading Forum
How-to Lessons
Manual
Company
About Us
Privacy
Terms of Use

Copyright © 2024 QuantShare.com
Social Media
Follow us on Facebook
Twitter Follow us on Twitter
Google+
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.