"""Calculate RSI with an explicit flat-market convention.

This implementation returns 50 if both smoothed gains and losses are zero.
All inputs are synthetic teaching examples. Run: python 19_wilder-rsi.py
"""
from tv_math import *

v=rsi([10,11,12,13,12],3)
assert v[3]==100 and abs(v[4]-66.6666666667)<1e-9
print(v)
