Below is a portion of code to draw a horizontal line at the highest close and lowest close of the last 25 bars. This works correctly.
var xSeriesLow = lowest(25, close());
var xSeriesHigh = highest(25, close());
. . . . . .
if(sInterval == "5") {
if(getBarState() == BARSTATE_NEWBAR) {
removeLine(501);
}
drawLineRelative(-25, xSeriesHigh.getValue(-1), -1, xSeriesHigh5.getValue(-1), PS_SOLID, 3, Color.blue, 501);
if(getBarState() == BARSTATE_NEWBAR) {
removeLine(502);
}
drawLineRelative(-25, xSeriesLow.getValue(-1), -1, xSeriesLow5.getValue(-1), PS_SOLID, 3, Color.blue, 502);
}
Now, I would like to perform a task if the currently active bar is less than the xSeriesLow line or greater than the xSeriesHigh line.
What do I put in this IF statement to test the 'value' of xSeries?
if(close < ????) { /**xSeriesLow
and
if(close > ????) { /**xSeriesHigh
Thanks for the help.
Phil
var xSeriesLow = lowest(25, close());
var xSeriesHigh = highest(25, close());
. . . . . .
if(sInterval == "5") {
if(getBarState() == BARSTATE_NEWBAR) {
removeLine(501);
}
drawLineRelative(-25, xSeriesHigh.getValue(-1), -1, xSeriesHigh5.getValue(-1), PS_SOLID, 3, Color.blue, 501);
if(getBarState() == BARSTATE_NEWBAR) {
removeLine(502);
}
drawLineRelative(-25, xSeriesLow.getValue(-1), -1, xSeriesLow5.getValue(-1), PS_SOLID, 3, Color.blue, 502);
}
Now, I would like to perform a task if the currently active bar is less than the xSeriesLow line or greater than the xSeriesHigh line.
What do I put in this IF statement to test the 'value' of xSeries?
if(close < ????) { /**xSeriesLow
and
if(close > ????) { /**xSeriesHigh
Thanks for the help.
Phil
Comment