Click here to Login





                                                   Buy conditioned by second ticker

  0

0
Peter Gum
2010-11-07 16:18:04


Whether a buy is triggered depends on whether QQQQ closes higher the same day than 2 days ago. I am not getting expected results with this code:
Rule1 = rsi(11)>80;
a=Ticker1("qqqq",3,close,LastData);
ra = a > ref(a,2);
buy = (Rule1 && ra);

My guess is I don't understand Ticker1 (or Ticker). Are the dates synchronized? What should I be using?
Thanks.
Pete



QuantShare
2010-11-08 04:37:05

  0

Best Answer
Ticker and Ticker1 are the same. The only difference is that Ticker1 allows you to specify a different timeframe.
In the example you provided me, you have set "3 days" as timeframe.
You should write instead:
Ticker1("qqqq",1,close,LastData)
OR
Ticker("qqqq",close,LastData);

The best way to see how functions work is to plot them on a chart.



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
Buy Sell Simulation Indicator
Buy & Hold of SPY or any Other Index/ETF on Profitable Months
LSS Pivotal Buy and Sell Numbers - Trend Reaction
Buy Indicator
Equity Data to Ticker Symbol

How-to Lessons
How to quickly add a ticker symbol
How to rename a ticker symbol
How to perform a basic quantitative analysis using the S&P 500
How to plot the ratio of two stocks
How to import your own list of stocks/symbols

Related Forum Threads
Random buy
Backtest, if number of buy is more than open positions, how QS se...
Buy stop at high
Continues Buy / Sell
How to define an alternate asset to buy when no positions are hel...

Blog Posts
Different Ticker Symbols for Each Data Source
How to Create a List of Ticker Symbols
Buy the best/top rated stocks or how to create powerful rank base...
How to get buy and sell orders for a portfolio based on a trading...
How to create buy and sell trading rules based on News Data









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.