I am currently trying to code for what would be similar to the simple strategy that monitors for a breakout but am having problems.
The scenario that i am looking for is when indicator X has been below a predefined level for a predefined period of time and then returns a value above that level a buy order is placed.
The order is currently being executed on the value set for "voAcDays" as opposed to when it braeks the voAc level.
Just wondering if anyone can help.
{
// Resets the vAHigh at the Start of every new session
if (Bars.FirstBarOfSession)
voAcHigh = VA().Plot0[0];
// Stores the vAHigh from the defined amount of period of time.
if (Bars.BarsSinceSession <= voAcDays && VA().Plot0[0] > voAcHigh)
voAcHigh = VA().Plot0[0];
if (VA().Plot0[0] >= voAcLevel && voAcHigh < voAcLevel);
{
// Entry Order used to generate Buy Orders
EnterLong(1, "VoAc - Signal");
}

Comment