Andrew Coles, David G. Hawkins Copyright © 2011 by Andrew Coles and David G. Hawkins.
Appendix C: TradeStation Code for the MIDAS Topfinder/Bottomfinder Curves ported to tradingview
This code is used to assist in adjusting D to intersect candle at a candle when using this script: Top Bottom Finder Public version- Jayy found here: The "n" number entered into the TB-F script is the topfinder/bottomfinder starting point or anchor
Be sure to enter the correct number in the "Topfinder bottomfinder initiation/anchor candle: 1 for CANDLE low - top finder, 2 for CANDLE high - bottom finder, 3 for CANDLE MIDPOINT ( hl2 ) dialogue box
The location of the match point of the candle is extremely important in the: "Match to CANDLE: use 1 for CANDLE low, 2 for midtail of the candle below the BODY, 3 for candle BODY low, 4 for CANDLE HIGH, 5 for midpoint of candletail above body, 6 for candle BODY high". Do not
confuse body high with candle high. The body low will either be the candle open or close. The body high will be either the open or close.
If you expect a trend up the candle is likely the low of the candle ie 1 (2 and 3 are alternatives).
In a trend down the high of the candle is often selected ie 4 (5 or 6 are alternatives)
If the candle body is aqua increase D if it is orange reduce D . Adjust iteratively until the candle body turns yellow. That will mean that the TB-F line passes through the candle at the selected point.
The Top Bottom Finder as seen in the upper panel is here:
I am not sure when I will find the time.
In true TradingView spirit, the author of this script has published it open-source, so traders can understand and verify it. Cheers to the author! You may use it for free, but reuse of this code in a publication is governed by House Rules. You can favorite it to use it on a chart.