[Description("Enter the description of your strategy here")]
publicclass forex : Strategy
{
#region Variables
// Wizard generated variables
privateint length = 10; // Default setting for Length
privatedouble multiplier = 10; // Default setting for Multiplier
// 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>
protectedoverridevoid Initialize()
{
SetProfitTarget("10000", CalculationMode.Ticks, 0);
SetStopLoss("10000", CalculationMode.Ticks, 0, false);
CalculateOnBarClose = true;
}
///<summary>
/// Called on each bar update event (incoming tick)
///</summary>
protectedoverridevoid OnBarUpdate()
{
// Condition set 1
if (CrossAbove(Close, SuperTrend(Length, Multiplier).UpTrend, 1))
{
EnterLong(DefaultQuantity, "");
}
// Condition set 2
if (CrossBelow(Close, SuperTrend(Length, Multiplier).DownTrend, 1))
{
EnterShort(DefaultQuantity, "");
}

Comment