Eyl
New member
Found this script here https://usethinkscript.com/threads/volume-profile.11180/#post-130035 would like to modify it. If anyone can help.
Here is my idea -
The script below last part is where I tried too do my new conditions, no error has come up, but nothing is happening on the chart.
If the price is below POC1 and VALOW want it - Light red else color current
If the Price is above POC1 and VAHIGH1 want it - Light green else color current
Thank you.
Code:
input daysback = 1; def ymd = GetYYYYMMDD(); def candles = !IsNaN(close); def capture = candles and ymd != ymd[1]; def dayCount = CompoundValue(1, if capture then dayCount[1] + 1 else dayCount[1], 0); def thisDay = (HighestAll(dayCount) - dayCount); def poc = if thisDay == daysback then reference VolumeProfile("price per row height mode" = "TICKSIZE", "time per profile" = "DAY", "on expansion" = no) else poc[1]; def vahigh = if thisDay == daysback then reference VolumeProfile("price per row height mode" = "TICKSIZE", "time per profile" = "DAY", "on expansion" = no).VAHigh else vahigh[1]; def valow = if thisDay == daysback then reference VolumeProfile("price per row height mode" = "TICKSIZE", "time per profile" = "DAY", "on expansion" = no).VALow else valow[1]; plot poc1 = if thisDay > daysback then Double.NaN else poc; plot vahigh1 = if thisDay > daysback then Double.NaN else vahigh; plot valow1 = if thisDay > daysback then Double.NaN else valow; poc1.SetDefaultColor(Color.CYAN); vahigh1.SetDefaultColor(Color.GREEN); valow1.SetDefaultColor(Color.RED); input bubblemover = 3; def b = bubblemover; def b1 = b + 1; input showbubbles = yes; def decimalPlaces = 2; AddChartBubble(showbubbles and IsNaN(close[b]) and !IsNaN(close[b1]), poc1[b], +Round(poc1[b], decimalPlaces), Color.CYAN); AddChartBubble(showbubbles and IsNaN(close[b]) and !IsNaN(close[b1]), vahigh1[b], +Round(vahigh1[b], decimalPlaces), Color.GREEN); AddChartBubble(showbubbles and IsNaN(close[b]) and !IsNaN(close[b1]), valow1[b], +Round(valow1[b], decimalPlaces), Color.RED, no);
-----# Assign color based on price relationship
AddCloud(Close > POC1 and VAhigh1, Close > POC1 and VAlow1, Color.Light_GREEN, Color.Light_greeN);
AddCloud(Close < POC1 and VAhigh1, Close < POC1 and VAlow1, Color.Light_RED, Color.Light_RED);----