Click here to Login





                                                   Simulator

  0

0
Brian
2011-06-15 22:17:33


if I am running a simulation choosing from all US stocks, is there a way to ask something about another stock or the market as a whole.

For example, if the base script is to buy when the rsi is < 20. Can I make the buy criteria rsi < 20 and rsi (SPY) < 20, (where SPY is the general market).

Basically, instead of using "Rsi(5) " I would like to hard code in the symbol as "Rsi(SPY, 5)". I'm assuming I use the GetSeries function but not sure.

If I can do this, please provide an example.

Thank you



QuantShare
2011-06-16 05:37:39

  0

Best Answer
One way to do this is to use the "GetSeries" function.

Example:
spy = GetSeries("SPY", close);
buy = rsi(5) < 20 and rsi(spy, 5) < 20;



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
Output metric for each trading year
Disable or Enable your Stop Rules
Scale-in Trading Strategy
Stop Trading Based on Your Portfolio Equity Return
Connors Alvarez MDD MDU Strategy

How-to Lessons
How to optimize an indicator in your trading system
How to copy a trading item
How to create a formula
How to optimize the stop limit of a trading system
How to add a metric in the trading system simulation report

Related Forum Threads
Simulator algorithm change/option
Access the equity value of the portfolio from the simulator
Advice on building a trading simulator strategy
Create a Metric in Simulator Report
How to force simulator to close open positions when data ends?

Blog Posts
3 ways to rank stocks in a trading system - Simulator and Potfoli...
Limit and Market orders
The Ultimate Guide to Create Trading Systems in QuantShare
Backtesting a Strategy Based on Bond and Stock Index ETFs
How to create a trading system, screen and composite using earnin...









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.