1. long entry on touch of the previous swing high, short entry on touch of previous swing low. I'm not sure what is look back period related in the wizard, are those look back bars? I input it on 100 value.
2. Enter long or enter short on touch of Prior High or Prior Low or Prior close, depends from what direction the price approaching those lines from under(short) or over(long). I tried to create the first part of the strategy(entries on swings), but it does not seems to work at all.
// <summary>
/// Trade swings
/// </summary>
[Description("Trade swings")]
public class SWings : Strategy
{
#region Variables
// Wizard generated variables
private int high = 1; // Default setting for High
private int low = 1; // Default setting for Low
// 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()
{
Add(Swing(5));
Add(Swing(5));
CalculateOnBarClose = true;
}
/// <summary>
/// Called on each bar update event (incoming tick)
/// </summary>
protected override void OnBarUpdate()
{
// Condition set 1
if (CrossAbove(GetCurrentBid(), Swing(5).SwingLow, 100)
&& Position.MarketPosition == MarketPosition.Flat)
{
EnterShort(DefaultQuantity, "short");
}
// Condition set 2
if (Position.MarketPosition == MarketPosition.Flat
&& CrossBelow(GetCurrentBid(), Swing(5).SwingHigh, 100))
{
EnterShort(DefaultQuantity, "short");
}
}
#region Properties
[Description("Swing high")]
[GridCategory("Parameters")]
public int High
{
get { return high; }
set { high = Math.Max(1, value); }
}
[Description("Swing low")]
[GridCategory("Parameters")]
public int Low
{
get { return low; }
set { low = Math.Max(1, value); }
}
#endregion
}

You have described what you want to do. For what are you asking for help.
Comment