protected override void OnBarUpdate()
{
// Condition set 1
if (Close[0] > Close[1])
{
EnterLongLimit(1, GetCurrentBid(), "Ofc Long");
}
// States that if position is profitable by 3 ticks at bid price, exit position at bid price
if (GetCurrentBid() >= Position.AvgPrice + 3 * Ticksize)
{
ExitLongLimit (GetCurrentBid(), "Profit Long");
}
// States that if bar following entry long closes against initial position, exit long and go flat.
if (Close[0] < Position.AvgPrice)
{
ExitLongLimit (GetCurrentBid(), "Ofc Long");
}
Thank You, Jamie Hendrix
Comment