Anyone know if it is possible to stop a signal from firing in a script if the signal falls within a certain date range? e.g. want to find every time LOW() is less than lower Bollinger Band, except between the dates 01-01-2015 and 31-12-2016.
Signal = LOW() < BB(BARS=20, DEFAULT=LowerLine);
RangeStart = BARDATE(01-01-2015);
RangeEnd = BARDATE(31-12-2016);
Signal and ((BARDATE(CLOSE()) < RangeStart) or (BARDATE(CLOSE()) > RangeEnd));
For entire years you can use the YEARNUM() function, so in your example you could use the following:
V1 = LOW() < BB(DEFAULT=LowerLine, BARS=20); V1 and (YEARNUM() < 2015 or YEARNUM() > 2016)
For specific dates you can use the BARDATE() function, but you would need to know the value which we specify for each date. The best way to see this value for each bar is to add a custom label to your tool tip label – see video here:
The cookie settings on this website are set to "allow cookies" to give you the best browsing experience possible. If you continue to use this website without changing your cookie settings or you click "Accept" below then you are consenting to this.