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.
//Script concept
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:
Darren, thank you for the follow-up as a result of the introduction of new functions with the latest release of Optuma. That is super effective in helping me keep my knowledge current. Really appreciated. Cheers, Dean