KiMA
The KiMA (Kimya Moving Average) is an adaptive moving average that is designed to follow the price volatility better while it still has a good memory of the past. One common problem of SMAs and EMAs is the trade-off between the memory of the moving average and its agility. In these moving averages, you have to sacrifice the memory for faster responses and you can not have them both simultaneously. KiMA is our solution to this problem. This indicator is designed based on the previous studies of John Euler, a famous mathematician in the 17's. This indicator analyzes the previous cycles of the market to fine-tune the size of its moving average window. Having an adaptive window size, this moving average is better in terms of trend detection and shows a more robust behavior as a support/resistance level. The function has three inputs:
Timeframes: the timeframes in which the function is applied.
Length (should be renamed to Window Length): the number of candles in the past that the indicator kooks into .
Column Name (should be renamed to Column Names) : the name of the columns in which the outputs are stored.
Note that this function has five output columns. This function returns mama and fama, the moving averages originally invented by John Euler. kima is the column associated with our proposed moving average. mesa max and mesa min contain the maximum and the minimum of mama and fama columns at each candle respectively.
To interpret the indicator, mama and fama must be used together and kima is independent. When mama is above fama, we are in a bullish and when fama is above mama we are in a bearish cycle. KiMA can be used exactly the way any other moving average is used. In fact, since it is a moving average, it inherits all the attributes and features of simple and weighted moving averages. Specifically, we would like to highlight that when the price is above KiMA, the market is bullish and when it's under KiMA, bears dominate the market. Last but not least, mesa min and mesa max could be considered as potential turning points