TradingView
twingall
Feb 11, 2023 4:27 AM

Price Legs: Time & Distance. Measuring moves in time & price 

E-mini S&P 500 FuturesCME

Description

-Tool to measure price legs in terms of both time and price; gives an idea of frequency of market movements and their typical extent and duration.
-Written for backtesting: seeing times of day where setups are most likely to unfold dynamically; getting an idea of typical and minimum sizes of small/large legs.
-Two sets of editable lookback numbers to measure both small and large legs independently.
-Works across timeframes and assets (units = mins/hours/days dependent on timeframe; units = '$' for indices & futures, 'pips' for FX).

~toggle on/off each set of bull/bear boxes.
~choose lookback/forward length for each set. Increase number for larger legs, decrease for smaller legs.

(for assets outside of the big Indices and FX, you may want to edit the multiplier, pMult, on lines 23-24)

small legs

large legs

Release Notes

-Added Toggle box for show / hide text in boxes. Default is ON (show)

Release Notes

-Fixed minor bug: Some boxes would very occasionally misprint and cut through/ ignore a pivot high or low. This is now fixed. All else remains the same.
Comments
danfly
great script, it is possibe to show the leg length in percentage rathen than absolute value
DrGladwin
Great script! Thank you
twingall
@DrGladwin, cheers!
ukmpits
@twingall Is there any future update Sir? Thanks mate
webcetdotin
Dear Twingall,
It seems my lucky date, I found your script. It's really really wonderful. Thanks alot for contribution.

Suggestion: If you display major repeated cycles or range of cycles, both big and small and check if the cycle was successful or not.

From the list note down the least cycle and display on a reversal bar. Say if least cycle is 6 days, on reversal bar show, "Could be 6 day cycle", even if trend continues then show next greater cycle number... That's alot useful.

Even it repaint as the trend continues, user has idea, till what time he can be in trade. Thank you.

Range of cycle means, say if a cycle is 60, another one 70, you can display it as 60-70cycles,Total 60, correct identified 50
luongxuanthu
@webcetdotin, I don't got this indicator ! Can you explain for me?
Elliott_wave_sniper
I like this indicator as a pre market analysis. I wish it would update to at least just leave the last leg without the measuring, and if more code could be added to fill all the spaces is not doing yet or measuring. it's almost complete. I'd like to see that. and would love to throw some money for your effort. I'd love to send you money on paypal. I'll check on how to do that during the day today with your username twingall
twingall
@Elliott_wave_sniper, briefly looked into this, ran into problems.. will update here if i ever find the time to get it figured out and working properly.. pls don't tip in the meantime; i may never get around to it!
Chrisdsgb
This would be perfect if you could remove the text and simply leave the ranges. Very nice though

Edit: I found I could use the fib one without the lines!! Thanks
twingall
@Chrisdsgb, updated this with option to show/hide text in box ranges
More