#region Using declarations
using System;
using System.ComponentModel;
using System.Diagnostics;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Xml.Serialization;
using NinjaTrader.Cbi;
using NinjaTrader.Data;
using NinjaTrader.Indicator;
using NinjaTrader.Strategy;
#endregion
// 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")]
publicclass Yoram1 : Strategy
{
#region Variables
// Wizard generated variables
privateint 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>
protectedoverridevoid Initialize()
{
SetProfitTarget("", CalculationMode.Ticks, 9);
SetStopLoss("", CalculationMode.Ticks, 10, false);
CalculateOnBarClose = true;
}
///<summary>
/// Called on each bar update event (incoming tick)
///</summary>
protectedoverridevoid OnBarUpdate()
{
// Condition set 1
if (GetCurrentBid() + -10 * TickSize == Low[1])
{
EnterShort(2, "");
}
}
#region Properties
[Description("")]
[Category("Parameters")]
publicint MyInput0
{
get { return myInput0; }
set { myInput0 = Math.Max(1, value); }
}
#endregion
}
}

just to clear it) the price is at 61,23. That is grater then the high so it should enter a long position. If the price is at 54,80 then it would enter a short position. If the price is in between the high and low, there is no trade that day! The market closes at 4.30 PM. So the strategy should close any position at 4PM! Only one trade per day.
Comment