There is an indicator on FXCM Strategy Trader under the name "Adaptive Moving Average". I searched this forum for the indicator and could not find it here. It has 3 components to calculate this version of the AMA...
effratiolength (Make default = 10)
fastavelength (Make default = 5)
slowavelength (Make default = 15)
If you are already familiar with this indicator, could you create it in the Lua language? If you are not familiar with it, here is a copy of the code from Strategy trader...
using System;
using System.Drawing;
using Broker.StrategyLanguage.Function;
namespace Broker.StrategyLanguage.Indicator
{
public class MovingAvgAdaptive : BaseIndicator
{
private ISeries<Double> m_price;
private int m_effratiolength = 10;
private int m_fastavglength = 2;
private int m_slowavglength = 30;
private AdaptiveMovAvg m_adaptivemovavg1;
private SeriesVar<Double> m_maa;
private IPlot Plot1;
public MovingAvgAdaptive(object ctx) :
base(ctx) {}
private ISeries<Double> price{
get { return m_price; }
}
[Input]
public int effratiolength{
get { return m_effratiolength; }
set { m_effratiolength = value; }
}
[Input]
public int fastavglength{
get { return m_fastavglength; }
set { m_fastavglength = value; }
}
[Input]
public int slowavglength{
get { return m_slowavglength; }
set { m_slowavglength = value; }
}
protected override void Construct(){
m_adaptivemovavg1 = new AdaptiveMovAvg(this);
m_maa = new SeriesVar<Double>(this);
Plot1 =
AddPlot(new PlotInfo("MAA", ((0)), ColorTranslator.FromWin32(((65535))),
ColorTranslator.FromWin32(((0))), 0, 0, true));
}
protected override void Initialize(){
m_price = Bars.Close;
m_adaptivemovavg1.price = price;
m_adaptivemovavg1.effratiolength = new SeriesExpression<Int32>(delegate { return effratiolength; });
m_adaptivemovavg1.fastavglength = new SeriesExpression<Int32>(delegate { return fastavglength; });
m_adaptivemovavg1.slowavglength = new SeriesExpression<Int32>(delegate { return slowavglength; });
m_maa.DefaultValue = 0;
}
protected override void Destroy() {}
protected override void Execute(){
m_maa.Value = m_adaptivemovavg1[0];
Plot1.Set(0, m_maa.Value);
if (Functions.CrossesOver(this, price, m_maa)){
Alerts.Alert("Bullish alert");
}
else{
if (Functions.CrossesUnder(this, price, m_maa)){
Alerts.Alert("Bearish alert");
}
}
}
}
}