We are attempting to develop a script that basically
says : If there was a RSI(C,2) cross of 25 level within the last 5 bars,
continue to conditions 2.
I have been attempting this with the BACKSET
command which compiles but does generate
any signals and shows NaN in the event window.
Any suggestions?
Thanks
Detect if a condition happened within last 5 bars
Moderator: Chris White
-
- Posts: 212
- Joined: Mon Nov 29, 2010 9:21 pm
Re: Detect if a condition happened within last 5 bars
You could use BARSSINCE. Here’s an example:
Code: Select all
rsicross: CROSS(RSI(C,2), 25);
bscross: BARSSINCE(rsicross);
cond1: bscross < 5;