Lean icon indicating copy to clipboard operation
Lean copied to clipboard

Add Mesa Adaptive Moving Average indicator

Open madnesspie opened this issue 5 years ago • 3 comments

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

madnesspie avatar Mar 07 '19 12:03 madnesspie

Duplicated of https://github.com/QuantConnect/Lean/issues/83

Martin-Molinero avatar Dec 17 '21 17:12 Martin-Molinero

There are 2 columns: (Time/Mesa Adaptive Moving Average/Following Adaptive Moving Average) spy_mama.csv

LouisSzeto avatar Feb 24 '23 10:02 LouisSzeto

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)

LouisSzeto avatar Oct 24 '23 12:10 LouisSzeto