///<summary>
/// Called on each bar update event (incoming tick)
///</summary>
protectedoverridevoid OnBarUpdate()
{
{
// recording the first highest high
if (ToTime(Time[0]) >= 93000 && ToTime(Time[0]) <= 94500)
{
if (High[0] > highestHigh)
highestHigh = High[0];
}
}
// Entry Condition: Submit a buy stop order two ticks above the highest high after 9:45am
if (ToTime(Time[0]) > 94500 && ToTime(Time[0]) <= 110000)
{
// Only allow entries if we have no current positions open
if (Position.MarketPosition == MarketPosition.Flat)
{
/* Enters long position.
*/
EnterLongStop(highestHigh + TickSize * 2);

Comment