WOULD SOMEONE PLEASE HELP ME WITH THE CODE TO RETURN THE HIGH AND LOW, NET CHANGE, OF A CERTAIN BAR THAT FALLS WITH IN A SET PERIOD.
EXAMPLE,
I WANT THE DIFFERENCE BETWEEN THE HIGH AND THE LOW OF EACH BAR BUT ONLY IF THAT BAR HAS A HIGH>LOW AND THAT BAR IS WITHIN A CERTAIN TIME FRAME. SAY THAT TIME FRAME IS THE LAST 5 BARS I WANT THE NET CHANGE OF THOSE BARS.
I REALIZE THIS CODE IS NOT CORRECT BUT I MADE AND ATTEMPT TO DO THIS AND I HAVE HIT A BRICK WALL. A LITTLE HELP WOULD BE MUCH APPRECIATED.
PERIOD = BARSAGO(5);
DEF HH = HIGH(period = RANGE);
DEF LL = LOW(period = RANGE);
CONDITION = HIGH>LOW;
XXX = CONDITION AND PERIOD;
AVG_XXX = AVG(XXX);
ADDLABEL(YES, "CHG:" + (AVG_XXX), COLOR.YELLOW);
EXAMPLE,
I WANT THE DIFFERENCE BETWEEN THE HIGH AND THE LOW OF EACH BAR BUT ONLY IF THAT BAR HAS A HIGH>LOW AND THAT BAR IS WITHIN A CERTAIN TIME FRAME. SAY THAT TIME FRAME IS THE LAST 5 BARS I WANT THE NET CHANGE OF THOSE BARS.
I REALIZE THIS CODE IS NOT CORRECT BUT I MADE AND ATTEMPT TO DO THIS AND I HAVE HIT A BRICK WALL. A LITTLE HELP WOULD BE MUCH APPRECIATED.
PERIOD = BARSAGO(5);
DEF HH = HIGH(period = RANGE);
DEF LL = LOW(period = RANGE);
CONDITION = HIGH>LOW;
XXX = CONDITION AND PERIOD;
AVG_XXX = AVG(XXX);
ADDLABEL(YES, "CHG:" + (AVG_XXX), COLOR.YELLOW);