Click here to Login





                                                   Williams%R trading strategy

  0

0
Michael Johnston
2012-11-08 21:58:57


Hi everyone, I am a rookie and trying to grasp the functionality of the backtest function. I am having a little trouble coding this strategy and would really like to test its
record.

I would like a buy order on a williams%R with a 72 period cross over of the -75 line in the previous day, and the sell order for that should be when will%R crosses the -20 line

I would like a short order on williams%R with a 72 period cross over of the -15 line in the previous day, and the cover order for that should be when will%R crosses the -80 line.

any help with this would be great.

Thank you very much.



QuantShare
2012-11-09 09:44:02

  0

Best Answer
Hi Michael,

Here is the formula to implement this strategy:
buy = cross(Willr(72), -72); // Willr crosses above -72. To get crosses below, just invert "Willr" and "-72"
sell = cross(Willr(72), -20);
short = cross(Willr(72), -15);
cover = cross(Willr(72), -80);

The default order is initiated at the open of tomorrow. If you want to reference the previous day in your formula, you can use the "ref" function.
Example:
a = ref(close, 1);




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
Trading Range Breakout - Long Strategy
Strategy Indicator - Percent winning trades for a trading rule
Pairs Trading Strategy
Trading Strategy based on the Sharpe Ratio Metric
Trading Strategy based on the Number of Buy Signals

How-to Lessons
How to create a trading system
How to add a metric in the trading system simulation report
How to generate buy/sell signals from a trading system
How to download a trading item from the Sharing Server
How to optimize the stop limit of a trading system

Related Forum Threads
Pair Trading Strategy would be nice!
Trading strategy over a socket connection
How to Turn any ordinary trading strategy into a profitable one
Trading strategy backtesting
Advice on building a trading simulator strategy

Blog Posts
Create a trading strategy using the money management tool - Part ...
Money Management: Scale-in Trading Strategy
6 techniques to improve the performance of your stock trading str...
How to turn any ordinary trading strategy into a very profitable ...
Optimize a trading strategy using the Sharpe ratio









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.