Skip to content

Commit

Permalink
Update formulas, details
Browse files Browse the repository at this point in the history
  • Loading branch information
JerBouma committed Jan 6, 2024
1 parent eb6c885 commit 7d81d0e
Showing 1 changed file with 42 additions and 42 deletions.
84 changes: 42 additions & 42 deletions financetoolkit/technical/technicals_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ def get_mcclellan_oscillator(
The formula is a follows:
McClellan Oscillator = EMA(Advancers) — EMA(Decliners)
- McClellan Oscillator = EMA(Advancers) — EMA(Decliners)
Args:
period (str, optional): The time period to consider for historical data.
Expand Down Expand Up @@ -374,7 +374,7 @@ def get_advancers_decliners(
The formula is a follows:
Advancers/Decliners = Advancers / Decliners
- Advancers/Decliners = Advancers / Decliners
Args:
period (str, optional): The time period to consider for historical data.
Expand Down Expand Up @@ -450,7 +450,7 @@ def get_on_balance_volume(
The formula is a follows:
OBV = Previous OBV + Current Volume if Close > Previous Close
- OBV = Previous OBV + Current Volume if Close > Previous Close
Args:
period (str, optional): The time period to consider for historical data.
Expand Down Expand Up @@ -526,7 +526,7 @@ def get_accumulation_distribution_line(
The formula is a follows:
ADL = Previous ADL + Current ADL
- ADL = Previous ADL + Current ADL
Args:
period (str, optional): The time period to consider for historical data.
Expand Down Expand Up @@ -617,7 +617,7 @@ def get_chaikin_oscillator(
The formula is a follows:
Chaikin Oscillator = EMA(short-window ADL) — EMA(long-window ADL)
- Chaikin Oscillator = EMA(short-window ADL) — EMA(long-window ADL)
Args:
period (str, optional): The time period to consider for historical data.
Expand Down Expand Up @@ -862,7 +862,7 @@ def get_money_flow_index(
The formula is a follows:
MFI = 100 - (100 / (1 + (positive_money_flow / negative_money_flow)))
- MFI = 100 - (100 / (1 + (positive_money_flow / negative_money_flow)))
Args:
period (str, optional): The time period to consider for historical data.
Expand Down Expand Up @@ -944,7 +944,7 @@ def get_williams_percent_r(
The formula is a follows:
Williams %R = (Highest High — Close) / (Highest High — Lowest Low) * —100
- Williams %R = (Highest High — Close) / (Highest High — Lowest Low) * —100
Args:
period (str, optional): The time period to consider for historical data.
Expand Down Expand Up @@ -1024,7 +1024,7 @@ def get_aroon_indicator(
The formula is a follows:
Aroon Up = ((Number of periods) — (Number of periods since highest high)) / (Number of periods) * 100
- Aroon Up = ((Number of periods) — (Number of periods since highest high)) / (Number of periods) * 100
Args:
period (str, optional): The time period to consider for historical data.
Expand Down Expand Up @@ -1113,7 +1113,7 @@ def get_commodity_channel_index(
The formula is a follows:
CCI = (Typical Price — SMA(Typical Price)) / (constant * Mean Deviation)
- CCI = (Typical Price — SMA(Typical Price)) / (constant * Mean Deviation)
Args:
period (str, optional): The time period to consider for historical data.
Expand Down Expand Up @@ -1206,7 +1206,7 @@ def get_relative_vigor_index(
The formula is a follows:
RVI = SMA(Upward Change) / (SMA(Upward Change) + SMA(Downward Change))
- RVI = SMA(Upward Change) / (SMA(Upward Change) + SMA(Downward Change))
Args:
period (str, optional): The time period to consider for historical data.
Expand Down Expand Up @@ -1286,7 +1286,7 @@ def get_force_index(
The formula is a follows:
Force Index = SMA(Periods) * (Close — Close(1))
- Force Index = SMA(Periods) * (Close — Close(1))
Args:
period (str, optional): The time period to consider for historical data.
Expand Down Expand Up @@ -1368,7 +1368,7 @@ def get_ultimate_oscillator(
The formula is a follows:
Ultimate Oscillator = 100 * ((4 * SMA(Periods)) / (SMA(Periods) + SMA(Periods) + SMA(Periods)))
- Ultimate Oscillator = 100 * ((4 * SMA(Periods)) / (SMA(Periods) + SMA(Periods) + SMA(Periods)))
Args:
period (str, optional): The time period to consider for historical data.
Expand Down Expand Up @@ -1461,7 +1461,7 @@ def get_percentage_price_oscillator(
The formula is a follows:
PPO = ((Long-term EMA — Short-term EMA) / Short—term EMA) * 100
- PPO = ((Long-term EMA — Short-term EMA) / Short—term EMA) * 100
Args:
period (str, optional): The time period to consider for historical data.
Expand Down Expand Up @@ -1546,7 +1546,7 @@ def get_detrended_price_oscillator(
The formula is a follows:
DPO = Close - SMA(Close, (Number of Periods / 2) + 1)
- DPO = Close - SMA(Close, (Number of Periods / 2) + 1)
Args:
period (str, optional): The time period to consider for historical data.
Expand Down Expand Up @@ -1627,7 +1627,7 @@ def get_average_directional_index(
The formula is a follows:
ADX = SMA(DMI) / (SMA(DMI) + SMA(DMI))
- ADX = SMA(DMI) / (SMA(DMI) + SMA(DMI))
Args:
period (str, optional): The time period to consider for historical data.
Expand Down Expand Up @@ -1717,7 +1717,7 @@ def get_chande_momentum_oscillator(
The formula is a follows:
CMO = ((Sum of Upward Change) — (Sum of Downward Change)) / ((Sum of Upward Change)
- CMO = ((Sum of Upward Change) — (Sum of Downward Change)) / ((Sum of Upward Change)
+ (Sum of Downward Change))
Args:
Expand Down Expand Up @@ -1801,7 +1801,7 @@ def get_ichimoku_cloud(
The formula is a follows:
Conversion Line = (Highest High + Lowest Low) / 2
- Conversion Line = (Highest High + Lowest Low) / 2
Args:
period (str, optional): The time period to consider for historical data.
Expand Down Expand Up @@ -1900,8 +1900,8 @@ def get_stochastic_oscillator(
The formula is a follows:
- %K = 100 * ((Close — Lowest Low) / (Highest High — Lowest Low))
- %D = SMA(%K)
- %K = 100 * ((Close — Lowest Low) / (Highest High — Lowest Low))
- %D = SMA(%K)
Args:
period (str, optional): The time period to consider for historical data.
Expand Down Expand Up @@ -2004,8 +2004,8 @@ def get_moving_average_convergence_divergence(
The formula is a follows:
- MACD Line = Short-term EMA — Long-term EMA
- Signal Line = SMA(MACD Line)
- MACD Line = Short-term EMA — Long-term EMA
- Signal Line = SMA(MACD Line)
Args:
period (str, optional): The time period to consider for historical data.
Expand Down Expand Up @@ -2103,7 +2103,7 @@ def get_relative_strength_index(
The formula is a follows:
RSI = 100 — (100 / (1 + RS))
- RSI = 100 — (100 / (1 + RS))
Args:
period (str, optional): The time period to consider for historical data.
Expand Down Expand Up @@ -2180,7 +2180,7 @@ def get_balance_of_power(
The formula is a follows:
BOP = (Close — Open) / (High — Low)
- BOP = (Close — Open) / (High — Low)
Args:
period (str, optional): The time period to consider for historical data.
Expand Down Expand Up @@ -2357,7 +2357,7 @@ def get_moving_average(
The formula is a follows:
MA = (Sum of Prices) / (Number of Prices)
- MA = (Sum of Prices) / (Number of Prices)
Args:
period (str, optional): The time period to consider for historical data.
Expand Down Expand Up @@ -2436,7 +2436,7 @@ def get_exponential_moving_average(
The formula is a follows:
EMA = (Close — Previous EMA) * (2 / (1 + Window)) + Previous EMA
- EMA = (Close — Previous EMA) * (2 / (1 + Window)) + Previous EMA
Args:
period (str, optional): The time period to consider for historical data.
Expand Down Expand Up @@ -2517,7 +2517,7 @@ def get_double_exponential_moving_average(
The formula is a follows:
EMA = (Close — Previous EMA) * (2 / (1 + Window)) + Previous EMA
- EMA = (Close — Previous EMA) * (2 / (1 + Window)) + Previous EMA
Args:
period (str, optional): The time period to consider for historical data.
Expand Down Expand Up @@ -2601,10 +2601,10 @@ def get_trix(
The formula is a follows:
- EMA1 = EMA(Close, Window)
- EMA2 = EMA(EMA1, Window)
- EMA3 = EMA(EMA2, Window)
- TRIX = 100 * ((EMA3 — EMA3[—1]) / EMA3[—1])
- EMA1 = EMA(Close, Window)
- EMA2 = EMA(EMA1, Window)
- EMA3 = EMA(EMA2, Window)
- TRIX = 100 * ((EMA3 — EMA3[—1]) / EMA3[—1])
Args:
period (str, optional): The time period to consider for historical data.
Expand Down Expand Up @@ -2686,9 +2686,9 @@ def get_bollinger_bands(
The formula is a follows:
- Middle Band = SMA(Close, Window)
- Upper Band = Middle Band + (Num Std Dev * Std Dev)
- Lower Band = Middle Band — (Num Std Dev * Std Dev)
- Middle Band = SMA(Close, Window)
- Upper Band = Middle Band + (Num Std Dev * Std Dev)
- Lower Band = Middle Band — (Num Std Dev * Std Dev)
Args:
period (str, optional): The time period to consider for historical data.
Expand Down Expand Up @@ -2780,7 +2780,7 @@ def get_triangular_moving_average(
The formula is a follows:
TMA = SMA(SMA(Close, Window), Window)
- TMA = SMA(SMA(Close, Window), Window)
Args:
period (str, optional): The time period to consider for historical data.
Expand Down Expand Up @@ -2959,7 +2959,7 @@ def get_true_range(
The formula is a follows:
TR = max(high — low, abs(high — previous_close), abs(low — previous_close))
- TR = max(high — low, abs(high — previous_close), abs(low — previous_close))
Args:
period (str, optional): The time period to consider for historical data.
Expand Down Expand Up @@ -3043,8 +3043,8 @@ def get_average_true_range(
The formula is a follows:
- TR = max(high — low, abs(high — previous_close), abs(low — previous_close))
- ATR = EMA(TR, Window)
- TR = max(high — low, abs(high — previous_close), abs(low — previous_close))
- ATR = EMA(TR, Window)
Args:
period (str): Period for which to calculate the ATR.
Expand Down Expand Up @@ -3137,11 +3137,11 @@ def get_keltner_channels(
The formula is a follows:
- EMA = (Close — Previous EMA) * (2 / (1 + Window)) + Previous EMA
- ATR = EMA(TR, ATR Window)
- Upper Channel Line = EMA(High, Window) + ATR * ATR Multiplier
- Middle Channel Line = EMA(Close, Window)
- Lower Channel Line = EMA(Low, Window) — ATR * ATR Multiplier
- EMA = (Close — Previous EMA) * (2 / (1 + Window)) + Previous EMA
- ATR = EMA(TR, ATR Window)
- Upper Channel Line = EMA(High, Window) + ATR * ATR Multiplier
- Middle Channel Line = EMA(Close, Window)
- Lower Channel Line = EMA(Low, Window) — ATR * ATR Multiplier
Args:
period (str, optional): The time period to consider for historical data.
Expand Down

0 comments on commit 7d81d0e

Please sign in to comment.