Hello,
I'm creating a 3 moving averages system.
MA1 fastest
MA2 slower
MA3 the slowest
It opens new position when MA1 crosses both MA2 & MA3 (order
doesn't matter) and exits when crosses one of them again (from above or
below depending on position).
Problem appears after exiting from position. The situation:
MA1 crosses MA2 & MA3 from below.Long position is opened. After
some period MA1 crosses MA2 from above and position is closes. Couple
bars later MA1 crosses MA2 again from below. I do not want to open Long
position again. It first needs to cross 2 other MAs.
Summaring:
1. There can't be new long position opened after exiting from previous
L.
(the same for S)
2. New position is opened when MA1 crosses MA2 & MA3 (order doesn't
matter)
3. Position is closes when MA1 crosses MA2 or MA3.
That's a part of my system but I can't go further without it.
I know it can be done with exrem() or flip() but I don't understand
these functions.
Please help,
Thanks!