@MerryDay, thank you for the post.
Below I will explain what I am trying to achieve , then place the Scripts I have toward this & explain what is the problem with the Script.
I am looking for price to be at an extreme. Using Bollinger Bands & Liner Regression Channel. If price has closed outside of these two, then price is at an extreme. I.E, if Closed below BB & LRC then a move to upside is "expected" & if Closed above BB & LRC a move to downside is "expected."
I am adding an additional requisite , that is shape of the bar (I am mainly working with daily charts). I don't want to call the bar a Shooting Star or a Hammer. Think using these terms will limit the search scan. I describe the Shape of Daily Candle.
For a long trade, If daily bar closes below BB & LRC, I am looking for a T shape or a cross shape candle where open & close of the day are very near the top of the candle has a long tail (shadow), color of body is not important, having a wick is not important.
For a short trade, the opposite positions. If daily bar closes above BB & LRC, I am looking for a Inverted T or Inverted cross shape candle where open & close of the day are very near the bottom of the candle has a long tail (shadow), color of body is not important, having a wick is not important.
Here is the scripts I have
For Buy Side:
(LinearRegChVar("width of channel" = 50.0, length = 100, "full range" = No).LowerLR is greater than close) and
( BollingerBands()."LowerBand" is greater than close )
and AbsValue(close - low ) > 6 * AbsValue ( open - close )
and AbsValue(close - open ) < .1 * AbsValue ( high - low )
For Sale Side:
(LinearRegChVar("width of channel" = 50.0, length = 100, "full range" = No).UpperLR is less than close) and
( BollingerBands().UpperBand is less than close )
and AbsValue(close - high ) > 6 * AbsValue ( open - close )
and AbsValue(close - open ) < .1 * AbsValue ( high - low )
Here is a picture of candle on the Buy Side: & then I will explain problem I have with this script
This image is result of buy side scan on 4-8 & 4-9 & at that time the price was below & outside BB & LRC.
For most parts I think the first part of script is working fine. i.e for long side below BB & LRC.
The problem I have is with second part trying to describe the candle bar. issues that I see
1. On the candle describes a shadow length to body length of 6/1. This is very limiting. How can we change that Shadow length to Body Length of > 2/1, this way it covers any Shadow/body length grater than 2 to 1.
2. this happens both on buy side & sell side. On buy side I only want upright T candles or upright crosses. search brings some inverted Ts & crosses on the buy side & opposite happens on the sell Side. I want only Inverted Ts & crosses , but search produces upright Ts & crosses.
Any help is appreciated.