TradingView
twingall
9 mag 2023 16:03

See inside Candles: Directionality %; Constituent Bars & Gaps 

S&P 500SP

Descrizione

See inside candles based on user-input LTF setting: get data on 'Directionality' of your candle; Gaps (total and Sum; UP and DOWN); Number of Bull or Bear constituent candles

//Features:
-DIRECTIONALITY: compare length of the 'zig-zag' random walk of lower time frame constituent candles, to the full height of the current candle. Resulting % I refer to as 'directionality'.
-GAPs: what i refer to as 'gaps' are also known as Volume imbalances: the gap between previous candles close and current candle's open (if there is one).
--Gaps total (up vs down gaps). Number of Up gaps printed above bar in green, down gaps printed below bar in red.
--Gaps Sum (total summed UP gap, total summed down gaps. Sum of Up gaps printed above bar in green, Sum of down gaps printed below bar in red.
-Candles Total: Numer of LTF up vs down candles within current timeframe candle. Number of up candles printed above bar in green, Number of down candles printed below bar in red.

//USAGE:
-Primary purpose in this was the Directionality aspect. Wanted to get a measure of how choppy vs how directional the internals of a candle were. Idea being that a candle with high % directionality (approaching 100) would imply trending conditions; while a candle which was large range and full bodies but had a low % directionality would imply the internals were back-and-forth and => rebalanced, potentially indicating price may not need to retrace back into it and rebalance further. All rather experimental, please treat it as such: have a play around with it.
-Number of gaps, Sums of up and down gaps, ratio of up and down constituent candles also intended to serve a similar purpose as the above.
-Set the input lower timeframe; this must obviously be lower then your current timeframe. You will significant differences in results depending on the ratio your timeframes (chart timeframe vs user-input timeframe).

//User Inputs:
-Lower timeframe input (setting child candle size within current chart parent candle).
-Choose function from the four listed above.
-typical formating options: Bull color/bear color txt for gaps functions.
-display % unit or not.
-display vertical or horizontal text.
-Set min / max directionality thresholds; and color code results.
-Toggle on/off 'hide results outside of threshold' to declutter the chart.
-choose label style.

//NOTES:
-Directionality thresholds can be set manually; Max and Min thresholds can be set to filter out 'non-extreme' readings.
-Note that directionality % can sometimes exceed 100%, in cases where price trends very strongly and gaps up continuously such that sum of constituent candles is less than total range of parent candle.
-Personally i like the idea of seeking bold, large-range, full bodied candles, with a lower than typical directionality %; indicating that a price move is both significant and it's already done it's rebalancing; I would see this as potentially favourable for continuation (obviously depending on context).

---- Showcase of the other functions beyond Directionality percentage ----

Candles Total (bull vs Bear). ES1! Hourly; ltf = 5min: Candles total: LTF up candles and LTF down candles making up the current HTF candle (constituent number of UP candles printed above in green, Down candles printed below in red):


Gaps SUM. SPX hourly, ltf = 5min. Sum of 'UP' gaps within candle printed above in green, sum of 'DOWN' gaps printed below in red:


Gaps TOTAL: SPX hourly, ltf = 1min. Simply the total of 'up' gaps vs 'down' gaps withing our candle; based on the user input constituent candles within:
Commenti
hundredtoamillion
Wow, this is incredible.
twingall
sebastinecc
Good work and a novel approach. A small suggestion. How about showing arrows only on the net higher side of candles. Let printing counts of lower time frame candles on both sides (up and down) continue, but arrow only to the net higher side. That will give an instant idea of direction without comparing number of candles up and down each time. And a special indication or style when number of candles falls to zero?
Altro