Lean
Lean copied to clipboard
Add Mesa Adaptive Moving Average indicator
Hi! :) I have a code and a tests of 2 technical indicators by John Ehlers. I want to push it into Lean. The indicators are described in original Ehlers paper
Expected Behavior
Mesa Adaptive Moving Average and Following Adaptive Moving Average indicators are implemented in Lean
Actual Behavior
Indicators aren't implemented
Potential Solution
Create a MesaAdaptiveMovingAverage and FollowingAdaptiveMovingAverage classes and put it into the QuantConnect.Indicators project. Also need add it to QCAlgorithm.Indicators.
Checklist
- [x] I have completely filled out this template
- [x] I have confirmed that this issue exists on the current
master
branch - [x] I have confirmed that this is not a duplicate issue by searching issues
Duplicated of https://github.com/QuantConnect/Lean/issues/83
There are 2 columns: (Time/Mesa Adaptive Moving Average/Following Adaptive Moving Average) spy_mama.csv
spy_mama.csv columns: "SPY close" "Mesa Adaptive Moving Average" "Following Adaptive Moving Average"
script:
import talib
import pandas as pd
history = pd.read_csv("https://github.com/QuantConnect/Lean/raw/master/Data/equity/usa/daily/spy.zip",
index_col=0, names=["open", "high", "low", "close", "volume"])
close = history.close
mama, fama = talib.MAMA(close)
mama = pd.concat([mama, fama], axis=1).dropna()
mama["spy close"] = close
mama = mama.iloc[:, [1, 2, 0]].dropna()
mama.to_csv("spy_mama.csv", header=False)