I have tried custom logic to determine the # of bars using CurrentBar() and it wont work either.
What i want to do is enter my long position within the onbarupdate() method and my exits are triggered within the Onexecution() method. I need 1 bar delay (do not want orders entering and exiting on the same bar)
I have no compile errors but if i try to set a condition within onexecution() similar to below:
if (myBarsSinceEntry() > 1)
{
exitlimit = Submitorder()
}
with myBarsSinceEntry() =
{
CurrentBar-myEntryBar;
}
myEntryBar = CurrentBar is located within the entry order {} within the onbarupdate method.
Any help would be appreciated.
Comment