No trade for 3 days after last one closed
Author: smurf77
Creation Date: 7/27/2011 8:29 PM
profile picture

smurf77

#1
Hi!

I try to program no trade for 3 days after the last one closed.
I have that: if (LastPosition.ExitBar > 3) but it doesn't work...

Do you have any suggestion?

Thanks

S
profile picture

smurf77

#2
I think the problem is to start the first position because this condition is never true with the first trade (no "lastposition". What do you think?
profile picture

Eugene

#3
You're right on the money.

But don't code what you can beg, borrow or steal:

CooledOff

Install Community Components from the Extensions section and restart WL6 before using.
profile picture

smurf77

#4
Thanks! I will do that...
I found a solution anyway: if (Positions.Count < 1||LastPosition.ExitBar > 3)
profile picture

smurf77

#5
I finally used cooledOff. Thank Eugene!
This website uses cookies to improve your experience. We'll assume you're ok with that, but you can opt-out if you wish (Read more).