THE CODE IS THIS:
// 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 hh : Strategy
{
#region Variables
// Wizard generated variables
private double myInput0 = 1; // Default setting for MyInput0
// 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()
{
SetStopLoss("", CalculationMode.Ticks, 5, true);
SetProfitTarget("", CalculationMode.Ticks, 5);
CalculateOnBarClose = false;
}
/// <summary>
/// Called on each bar update event (incoming tick)
/// </summary>
protected override void OnBarUpdate()
{
// Condition set 1
if (GetCurrentBid() < Open[0])
{
EnterShort;
}
// Condition set 2
if (GetCurrentAsk() > Open[0])
{
EnterLong;
}
}
Comment