Adaptive Mvoing Average Request

If you need an Indicator or Signal developed or translated from other language, please post all Indicator development REQUESTS to this section here.

Moderator: admin

Adaptive Mvoing Average Request

Postby DWetherell » Tue Nov 23, 2010 8:20 pm

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");
}
}
}
}
}
DWetherell
 
Posts: 61
Joined: Fri Jul 23, 2010 10:11 am


Re: Adaptive Mvoing Average Request

Postby DWetherell » Tue Nov 30, 2010 6:51 pm

Where am I in the Que? It has been almost a week now. Do you need more information?
DWetherell
 
Posts: 61
Joined: Fri Jul 23, 2010 10:11 am

Re: Adaptive Mvoing Average Request

Postby Alexander.Gettinger » Mon Feb 04, 2019 8:59 pm

Please try this indicator:
Adaptive_MA.lua
(2.38 KiB) Downloaded 428 times
Alexander.Gettinger
FXCodeBase: Confirmed User
 
Posts: 3785
Joined: Wed Mar 31, 2010 9:40 pm
Location: Russia, Omsk


Return to Indicator and Signal Requests

Who is online

Users browsing this forum: No registered users and 12 guests