public MAMA(DataSeries source, double FastLimit, double SlowLimit, string description) public static MAMA Series(DataSeries source, double fastLimit, double slowLimit)
using System; using System.Collections.Generic; using System.Text; using System.Drawing; using WealthLab; using WealthLab.Indicators;namespace WealthLab.Strategies { public class MyStrategy : WealthScript { protected override void Execute() { DataSeries hMA = MAMA.Series( Close, 0.5, 0.05 ); DataSeries hFA = FAMA.Series( Close, 0.5, 0.05 ); PlotSeries( PricePane, hMA, Color.Red, WealthLab.LineStyle.Solid, 1 ); PlotSeries( PricePane, hFA, Color.Blue, WealthLab.LineStyle.Solid, 1 ); for(int bar = hMA.FirstValidValue; bar < Bars.Count; bar++) { if( CrossOver( bar, hMA, hFA ) ) BuyAtMarket( bar+1 ); else if( CrossOver( bar, hFA, hMA ) ) SellAtMarket( bar+1, LastPosition ); } } } }