I am a new member of this forum. I am trying to create a script based on Price Headley's %R method.
Here is the description of the method:
Williams %R is set to length = 30 days
When %R crosses above -20 that is considered a bullish setup bar.
The closing price of any one of the next five bars must close above the bullish setup bar's high. When that happens it is considered to be a favorable condition for a long entry.
Here is my script:
The line highlighted in red doesn't work for some reason. I can overcome this with brute force by adding the following statements (but I don't like it very much):
The brute force code results in multiple arrows appearing each time when a new bar makes a higher close in relation to the setup bar's high. I want the arrow to appear only once when that happens (be it on the 1st, 2nd ... 5th candle).
Please register on futures.io to view futures trading content such as post attachment(s), image(s), and screenshot(s).
Could anyone please help me with this? Thanks!
Last edited by ikholobayev; May 16th, 2013 at 04:17 PM.
I would do it like this.. it's not the optimum code but simple.. may inspire a different approach for you.. the entry level will be visually painted for you and you get a single arrow up (but for each new crossing though).