Intrinsic Knowledge
Member
Hi guys,
May I politely check if it is possible to record every single day for the regular trading hour (RTH) 's high, low and range and extended trading hour (ETH) 's high, low and range based on the below image?
For example, we can refer every single day RTH and ETH 's data for the past thirty (30) days or more. Thought that there might be other alternatives beside using the bubble charts.
As below the script which can only record label for one (1) day.
Much appreciated if anyone can share your advises.
May I politely check if it is possible to record every single day for the regular trading hour (RTH) 's high, low and range and extended trading hour (ETH) 's high, low and range based on the below image?
For example, we can refer every single day RTH and ETH 's data for the past thirty (30) days or more. Thought that there might be other alternatives beside using the bubble charts.
As below the script which can only record label for one (1) day.
Much appreciated if anyone can share your advises.
Code:
# Reg and after Market High Low Level
input afterMarket_Open = 1600; #EST
input afterMarket_Close = 0929; #EST
input afterMarket_Label = yes;
input afterMarket_Cloud = no;
input afterMarket_Line = yes;
input regMarket_Line = yes;
input regMarket_Label = yes;
Input marketOpen = 0930;
Input marketClose = 1559;
def afterMarketOpen = If(SecondsFromTime(afterMarket_Open) >= 0 or SecondsTillTime(afterMarket_Close) >= 0, 1, 0);
def afterMarketReset = if afterMarketOpen and !afterMarketOpen[1] then 1 else 0;
def afterMarketHigh = CompoundValue(1, If((high > afterMarketHigh[1] and afterMarketOpen) or afterMarketReset, high, afterMarketHigh[1]), high);
def afterMarketLow = CompoundValue(1, If((low < afterMarketLow[1] and afterMarketOpen) or afterMarketReset, low, afterMarketLow[1]), low);
def TradingDayStart= SecondsFromTime(marketOpen);
def TradingDayEnd = SecondsTillTime(marketClose);
def DayTrading = tradingDayStart >= 0 and tradingDayEnd >= 0;
def tradingMarketTimeRange = tradingDayStart >= 0 and tradingDayEnd >= 0;
def tradingMarket = tradingMarketTimeRange and !tradingMarketTimeRange[1];
def trading_Market_High = compoundValue(1, if((high > trading_Market_High[1] and tradingMarketTimeRange) or tradingMarket, high, trading_Market_High[1]), high);
def trading_Market_Low = compoundValue(1, if((low < trading_Market_Low[1] and tradingMarketTImeRange) or tradingMarket, low, trading_Market_Low[1]), low);
def regMarket_High = if regMarket_Line then trading_Market_High else Double.NaN ;
#regMarket_High.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
#regMarket_High.SetDefaultColor(Color.CYAN);
#regMarket_High.SetLineWeight(2);
def regMarket_low = if regMarket_Line then trading_Market_Low else Double.NaN ;
#regMarket_Low.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
#regMarket_Low.SetDefaultColor(Color.CYAN);
#regMarket_Low.SetLineWeight(2);
AddLabel(if regMarket_Label then 1 else 0, "RTH High " + "$ " + Round(regMarket_High, 2) + " ", Color.light_green);
AddLabel(if regMarket_Label then 1 else 0, "RTH Low " + "$ " + Round(regMarket_Low , 2) + " ", Color.light_red);
AddLabel(if regMarket_Label then 1 else 0, "" + AsPercent((regMarket_high - regMarket_Low)/regMarket_high) + " ", Color.gray);
AddLabel(if regMarket_Label then 1 else 0, "RTH Range " + "$ " + Round(regMarket_high - regMarket_Low , 2) + " ", Color.Yellow);
plot afterMarket_High = if afterMarket_Line then afterMarketHigh else Double.NaN ;
#afterMarket_high.SetStyle(curve.SHORT_DASH);
afterMarket_high.SetStyle(Curve.MEDIUM_DASH);
#afterMarket_High.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
afterMarket_High.SetDefaultColor(Color.CYAN);
afterMarket_High.SetLineWeight(2);
plot afterMarket_Low = if afterMarket_Line then afterMarketLow else Double.NaN ;
#afterMarket_Low.SetStyle(curve.SHORT_DASH);
afterMarket_Low.SetStyle(Curve.MEDIUM_DASH);
#afterMarket_Low.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
afterMarket_Low.SetDefaultColor(Color.ORANGE);
afterMarket_Low.SetLineWeight(2);
#AddLabel(if afterMarket_Label then 1 else 0, " ", color.black);
AddLabel(if afterMarket_Label then 1 else 0, "ETH High " + "$ " + Round(afterMarket_High, 2) + " ", Color.cyan);
AddLabel(if afterMarket_Label then 1 else 0, "ETH Low " + "$ " + Round(afterMarket_Low , 2) + " ", Color.ORANGE);
AddLabel(if afterMarket_Label then 1 else 0, "" + AsPercent((afterMarket_high - afterMarket_Low)/afterMarket_high) + " ", Color.gray);
AddLabel(if afterMarket_Label then 1 else 0, "ETH Range " + "$ " + Round(afterMarket_high - afterMarket_Low , 2) + " ", Color.Yellow);
AddCloud(if afterMarket_Cloud then afterMarket_High else Double.NaN, if afterMarket_Cloud then afterMarket_Low else Double.NaN, Color.LIGHT_GRAY, Color.LIGHT_GRAY);
########################################################################