- Topics: 5
- Replies: 430
- Posts: 435
Based on your screen shot the following script should provide the result you are after:
V1 = CLOSE() < MA(BARS=50, CALC=Close) ;
V1a = ACC(V1, RANGE=Look Back Period, BARS=2) == 2;
V2 = CLOSE() > MA(BARS=50, CALC=Close) ;
V2a = ACC(V2, RANGE=Look Back Period, BARS=2) == 2;
The switch function will swap between 1 (True) and 0 (False) when the last 2 closes cross below a MA or above the MA.
The shaded green zone shows where the script returns a true result…
- This reply was modified 2 years ago by Matthew.