Click here to Login

                                                   Williams%R trading strategy


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

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.

2012-11-09 09:44:02


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.
a = ref(close, 1);

No more messages


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"


Trading Items
Strategy Indicator - Percent winning trades for a trading rule
Scale-in Trading Strategy
Hull Moving Average Strategy - Multi Time Frame Trading System
Trading Range Breakout - Long Strategy
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 optimize the stop limit of a trading system
How to backup your databases (EOD, Intraday, Tick and Custom) and...

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
Trading the Strategy Equity Curve
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

Create an account
Affiliate Program
Contact Us
Trading Forum
How-to Lessons
About Us
Terms of Use

Copyright 2024
Social Media
Follow us on Facebook
Twitter Follow us on Twitter
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.