Since you are requesting a scan and NOT a chart strategy I have moved this post into the "Stock Scanners" topic. The topic you selected "Strategy Guide" is meant for chart strategies used to backtest trade setups.
I have also updated the title of your question because, once again, you are not asking for a chart strategy. So your original question title of "BOLLINGER BAND REVERSAL STRATEGY" did not describe you request at all. And FYI, there is never a need to use all caps in any question title.
Now that we have those corrections out of the way let's look at your specifications:
- The "body" of the candle consists of ONLY the open and close. So the close is always going to close at either 0% or 100% of the candle body. Perhaps you intended to state this differently? I am thinking you actually meant to say the close is more 50% of the High to Low range of the candle. That is possible. But you really need to explain this more clearly. "more than 50%" Does that mean the top 50% of the high to low range or the bottom 50% of the high to low range?
- This is already available as a built in filter for any scan.
- Same as item 2
- No are you speaking here of the built-in study named ATR? (Average True Range). Or did you truly intended to request a custom version that only measures the average range of each bar's high to low?
Final question. For the Bollinger band component, is that taking place on the daily time frame? Everything else seems to imply you want everything measured in same (daily) time frame. But we need to understand this before we can proceed.
After having to clarify all of this I am now left with 5 min to come up with a solution.
So in that time this is all I can offer. The following statement computes the percent of the close within the range of the high to low:
def percentOfRange = (close - low) / (high - low);
The output is a decimal value. A close at the very low of the candle will output a value of 0% and a close at the very high of the candle will out a value of 100%.
Ok, that's about all I have time for on this request. Sorry, out of time.