Thus A Strategy Is Born:
https://usethinkscript.com/threads/futures-strategy-wide-ranging-days.9767/
Please continue future discussion in the above link.
https://usethinkscript.com/threads/futures-strategy-wide-ranging-days.9767/
Please continue future discussion in the above link.
Hello everyone.
I am reading the book " A Complete Guide to the Futures Market Technical Analysis and Trading Systems, Fundamental Analysis, Options, Spreads, and Trading Principles" by Jack D. Schwager and Mark Etzkorn and it provides some strategies I would like to try, but I am lacking the ability to code them. One of the strategies is related to "Wide Ranging days". I will transcprit the part of the book which includes the strategy:
In my first attemp ever to write a ToS script I managed to code a study which signals wide-ranging days with a boolean arrow but that´s as far as I got. I am lacking the most important part: the buy and sell signals. What I find most difficult to code for is number three in the Daily Checklist. I couldn't find in ToS help or other scripts I've downloaded how to reference to the last wide-ranging day and how to redefine them as days go by and a new wide-ranging days appear. If anyone can provide a tip on how to do that it would be greatly appreciated. Also, if anyone has the ability and wants to have fun coding the whole strategy, please go aheadDefinitions
Wide-ranging day. A day on which the volatility ratio (VR) is greater than k (e.g., k = 2). The
VR is equal to today’s true range divided by the average true range of the past N-day period
(e.g., N = 10).
Price trigger range (PTR). The range defined by the highest true high and lowest true low in
the interval between N1 days before the most recent wide-ranging day to N2 days after. Note
that the PTR cannot be defined until N2 days after a wide-ranging day. (If N2 = 0, the PTR
would be defined as of the close of the wide-ranging day itself.) The PTR will be redefined each
time there is a new wide-ranging day (i.e., N2 days after such an event).
Trading Signals
Buy case. On a close above the high of the PTR, reverse from short to long.
Sell case. On a close below the low of the PTR, reverse from long to short.
Daily Checklist
To generate trading signals, perform the following steps each day:
1. If short and today’s close is above the high of the PTR, liquidate short and go long.
2. If long and today’s close is below the low of the PTR, liquidate long and go short.
3. Check whether exactly N2 days have elapsed since the most recent wide-ranging day. If this
condition is met, redefine the PTR.
Thanks for the help, I hope it can become useful to all the futures traders out there.
Last edited by a moderator: