Mr_Wheeler
Active member
I'm stuck on modifying it to let you select custom colors, but this script's concept has been on my chest for a while now.
https://tos.mx/DA9uwBy
https://tos.mx/DA9uwBy
Code:
input premarket_start = 700;
input premarket_end = 930;
def inZone1 = secondsTillTime(premarket_start) <= 0 and secondsTillTime(premarket_end) >= 0;
def highBar1 = if inZone1 then highestAll(high) else double.nan;
def lowBar1 = if inZone1 then lowestAll(low) else double.nan;
input after_market_start = 1600;
input after_market_end = 2000;
def inZone2 = secondsTillTime(after_market_start) <= 0 and secondsTillTime(after_market_end) >= 0;
def highBar2 = if inZone2 then highestAll(high) else double.nan;
def lowBar2 = if inZone2 then lowestAll(low) else double.nan;
addCloud(lowBar1, highBar1, color.green);
addCloud(lowBar2, highBar2, color.red);