Tni
calculation of the trend normality indicator for market regime filtering
This branch adds the calculation the trend normality indicator, as introduced by @tasciccac (see link below). It uses the ichimoku components and puts them into a relation to find out if a market is trending, not trending and even if overbought/ oversold.
The tni uses the infrastructure created for the ADX based market regime filter, so no database change is needed (the indicator is a binary/boolean one that is stored in indicators_daily as regime_filter- just as the ADX based filter).
the indicator is calculated as follows: tn = (tenkan-kijun) / (senkouA - senkouB)
if tn < 0 current trend is reversing -> do not trade if tn > 1 current trend is oversold/overbought
0 <= tn <= 1 healthy trend
to use it as a market filter, values < 0 and > 1 will set tni to "1" (filter true), values between 0 and 1 will set the filter to 0 (filter false/off)
@See https://twitter.com/tasciccac/status/867392176296210432
You can turn on the filter by configuring SIGNAL_REGIME_FILTER = TNI
under signal execution settings in the config file