I have tried to write my first strategy. The strategy is similar like the example "SampleMaCrossover" but instead of using two moving averages I use the MAMA indicator. Everytime the FAMA line crosses above the MAMA line it should go long. When the MAMA line crosses above the FAMA line it should go short.
However when i try to compile it I get the following error:
"No overload for method MAMA takes 1 arguments".
Here is the part of my code where it tells me the error message:
// Condition set 1
if (CrossAbove(MAMA(MAMAslow), MAMA(MAMAfast), 1))
EnterLong();
else if (CrossAbove(MAMA(MAMAfast), MAMA(MAMAslow), 1))
EnterShort();
I know there is something wrong with the syntax. Can somebody tell me how to fix it?
Here is some more code of the strategy:
private double mAMAfast = 0.5; // Default setting for MAMAfast
private double mAMAslow = 0.05; // Default setting for MAMAslow
// User defined variables (add any user defined variables below)
#endregion
/// <summary>
/// This method is used to configure the strategy and is called once before any strategy method is called.
/// </summary>
protected override void Initialize()
{
CalculateOnBarClose = true;
}
/// <summary>
/// Called on each bar update event (incoming tick)
/// </summary>
protected override void OnBarUpdate()
{
// Condition set 1
if (CrossAbove(MAMA(MAMAslow), MAMA(MAMAfast), 1))
EnterLong();
else if (CrossAbove(MAMA(MAMAfast), MAMA(MAMAslow), 1))
EnterShort();
}
#region Properties
[Description("MAMA fast indicator")]
[GridCategory("Parameters")]
public double MAMAfast
{
get { return mAMAfast; }
set { mAMAfast = Math.Max(0, value); }
}
[Description("MAMA slow indicator")]
[GridCategory("Parameters")]
public double MAMAslow
{
get { return mAMAslow; }
set { mAMAslow = Math.Max(0, value); }
}
#endregion
}
Markus

Comment