Polar Sun

Acropolis => Scriptorium => Source Code => Topic started by: Pallas_Boreas on 2026-Aug-27, 04:07:10

Title: KFI MicroPython Scripts
Post by: Pallas_Boreas on 2026-Aug-27, 04:07:10
These scripts should work on any relatively recent device that has MicroPython of at least version 1.9.4, equivalent too Python 3.8, and maybe older since it uses only core features and simple logic with the standard math library being the only import. They will also work on the full Python.

I wanted a portable, quick, way to calculate the KFI on my calculator. It also serves as a reference on the steps involved.

kfi(.py) will ask for the necessary values and then output them and the derivatives Dv, Cr, and F where n=5 which is 5 candles/ticks look back. You will have too enter the High and Low of n=5 manually. Between 3 & 5 is optimal before lag starts to be introduced in the denominator Eta and D in the numerator, being more significant for Eta then D.

kfitwo(.py) does the same except n=x where you decide the look back period and have to enter that amount of Highs, Lows, and Closes but it does the rest of the calculations for you (i.e. min(Lows) and max(Highs) of D).

Included is a complimentary script that prints the information of m_divisor, asset class, and phase thresholds.
I wrote it on the Casio fx-CG100 graphing calculator, MicroPython 1.9.4. Also tested on Python 3.14.6, ipython 9.16.1 on Linux with Positron IDE.

For a zipped file and the possibility to tip they can also be downloaded at: https://ko-fi.com/s/216efb3532.