KennedyAdaptiveBaseline
FREE
Published:
23 May 2025
Current version:
1.41
Didn't find a suitable robot?
Order your own one
on Freelance
Go to Freelance
Order your own one
on Freelance
How to buy а trading robot or an indicator
Run your EA on
virtual hosting
virtual hosting
Test аn indicator/trading robot before buying
Want to earn in the Market?
How to present a product for a sell-through
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register

KAB v1.41
The indicator now runs with series indexing, has safer initialization, more robust parameter validation, and a much smarter volatility lock (hysteresis + optional timed release).
In other words, it's more efficient, more reliable, and smarter.
It also gains an option to operate strictly on closed bars to avoid repaint-style behavior on the forming bar.
Although, having said that, repainting is already avoided by a variety of functions:
1. Closed-bar policy
input bool useClosedOnly = false; // use bar-1 at bar 0
2. Use the previous closed bar’s index everywhere the “current” bar is referenced
int piStart = useClosedOnly ? MathMax(start,1) : start;
int pi = useClosedOnly ? MathMax(i,1) : i;
3. All state/price lookbacks use only prior closes
double sATR = CalcTR(high[piStart], low[piStart], close[piStart+1]);
double tr = CalcTR(high[pi], low[pi], close[pi+1]);
double unsm = prev + alpha * (close[pi] - prev);
4. Seed/recursion is strictly causal (each bar depends only on the previous output)
if(prev_calculated == 0) m_kabBuffer[start] = close[piStart];
double prev = (i==start ? m_kabBuffer[i] : m_kabBuffer[i+1]);
KAB is context-aware where traditional Moving Averages are static. When choosing a baseline, choose KAB.