Here's the code (via wizard) :// This namespace holds all strategies and is required. Do not change it.
namespace NinjaTrader.Strategy
{
/// <summary>
/// Enter the description of your strategy here
/// </summary>
[Description("Enter the description of your strategy here")]
public class MyMABounce : Strategy
{
#region Variables
// Wizard generated variables
private int mA1 = 233; // Default setting for MA1
private int mA2 = 89; // Default setting for MA2
private int mA3 = 50; // Default setting for MA3
private int mA4 = 20; // Default setting for MA4
// 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()
{
SetProfitTarget("8", CalculationMode.Ticks, 0);
CalculateOnBarClose = true;
}
/// <summary>
/// Called on each bar update event (incoming tick)
/// </summary>
protected override void OnBarUpdate()
{
// Condition set 1
if (CrossAbove(High, SMA(233), 1)
&& SMA(89)[0] < SMA(233)[0])
{
EnterShort(DefaultQuantity, "233Bounce");
}
}

Comment