POC indicator with a twist.

ILIKESTOCKS

Member
Greetings, to all who have the magical gift of coding! I would like an indicator that follows the current days POC. When the price is above the POC the label turns green and displays current price percentage above, and when the price is below the POC it displays the current price percentage below, and turns red. If price is at the money it stays white. Also next to these labels I would like the POC displayed with price range. Id like it to work on an intraday chart for any time up to 15 minutes. I only would like a line on the chart representing current POC and that is all. Is this possible?
 
Solution
Greetings, to all who have the magical gift of coding! I would like an indicator that follows the current days POC. When the price is above the POC the label turns green and displays current price percentage above, and when the price is below the POC it displays the current price percentage below, and turns red. If price is at the money it stays white. Also next to these labels I would like the POC displayed with price range. Id like it to work on an intraday chart for any time up to 15 minutes. I only would like a line on the chart representing current POC and that is all. Is this possible?

This should provide volumeprofile POC/Close comparison data, except POC price range. TOS does not provide POC data on a bar by bar basis...
Greetings, to all who have the magical gift of coding! I would like an indicator that follows the current days POC. When the price is above the POC the label turns green and displays current price percentage above, and when the price is below the POC it displays the current price percentage below, and turns red. If price is at the money it stays white. Also next to these labels I would like the POC displayed with price range. Id like it to work on an intraday chart for any time up to 15 minutes. I only would like a line on the chart representing current POC and that is all. Is this possible?

This should provide volumeprofile POC/Close comparison data, except POC price range. TOS does not provide POC data on a bar by bar basis to determine the range.

Ruby:
def yyyymmdd = GetYYYYMMDD();
def period = CountTradingDays(Min(First(yyyymmdd), yyyymmdd), yyyymmdd) - 1;;
def cond = 0 < period - period[1];
profile vol = VolumeProfile("startNewProfile" = cond, "onExpansion" = no, numberOfProfiles = 1, "value area percent" = 0.0, pricePerRow = PricePerRow.TICKSIZE);

plot b = vol.GetPointOfControl();

input showlabel = yes;
AddLabel(showlabel, "Close: " + AsText(close) + " POC: " + AsText(b) + " %Var: " + AsPercent((close - b) / b), if close > b then Color.GREEN else if close < b then Color.RED else Color.WHITE);
 
Solution
Thank you very much either that was a simple task for you or you made it look simple. Ill go with the latter. It is much appreciated.
This will help me with a few ideas I have rolling around in my head. Very clean code (IMO) which I imagine is the goal of the coding world.
Again thank you for addressing this question.
 
This should provide volumeprofile POC/Close comparison data, except POC price range. TOS does not provide POC data on a bar by bar basis to determine the range.
This works fantastic thank you! I realize some the following requests are within other indicators, Im not sure if this a cut and paste sort of thing.

Questions:

1) Could I have a cloud follow the candles current price, green above/red below POC but it would only turn green or red if the current candle didn't touch the POC including the wick?

2) In addition the candle would have a line that would follow current price and when there is a reversal it would leave a line there, but not the cloud, the cloud would be fluid and wouldn't trail behind only current and forward.

3) When the POC moves from its current position is it possible to leave a ghost image or some kind of mark that would record that position?

4) Can all these functions be turned on and off within settings of the indicator.
 
Last edited by a moderator:
This works fantastic thank you! I realize some the following requests are within other indicators, Im not sure if this a cut and paste sort of thing.

Questions:

1) Could I have a cloud follow the candles current price, green above/red below POC but it would only turn green or red if the current candle didn't touch the POC including the wick?

2) In addition the candle would have a line that would follow current price and when there is a reversal it would leave a line there, but not the cloud, the cloud would be fluid and wouldn't trail behind only current and forward.

3) When the POC moves from its current position is it possible to leave a ghost image or some kind of mark that would record that position?

4) Can all these functions be turned on and off within settings of the indicator.

Im certainly willing to make a donation for this to be facilitated.

1/2) See if the following image script is close to what you expected.

3) When the POC moves from its current position is it possible to leave a ghost image or some kind of mark that would record that position?
TOS does not provide a way to track the POC on a bar by bar basis to be able to do this
4) Can all these functions be turned on and off within settings of the indicator.
Yes

Capture.jpg
Ruby:
def yyyymmdd = GetYYYYMMDD();
def period   = CountTradingDays(Min(First(yyyymmdd), yyyymmdd), yyyymmdd) - 1;;
def cond     = 0 < period - period[1];
profile vol  = VolumeProfile("startNewProfile" = cond, "onExpansion" = no, numberOfProfiles = 1, "value area percent" = 0.0, pricePerRow = PricePerRow.TICKSIZE);

plot b = vol.GetPointOfControl();

input showlabel = yes;
AddLabel(showlabel, "Close: " + AsText(close) + " POC: " + AsText(b) + " %Var: " + AsPercent((close - b) / b), if close > b then Color.GREEN else if close < b then Color.RED else Color.WHITE);

input showcloud = yes;
def bn      = barnumber();
def crossbn = if close crosses b then bn else double.nan;
def touch   = between(b,low,high);
addcloud(if showcloud and !touch and bn>=highestall(crossbn) then close else double.nan, b, color.green, color.red);

input showvertical = yes;
addverticalLine(showvertical and close crosses b, "", if close crosses above b then color.green else color.red);
 
1/2) See if the following image script is close to what you expected.

3) When the POC moves from its current position is it possible to leave a ghost image or some kind of mark that would record that position?
TOS does not provide a way to track the POC on a bar by bar basis to be able to do this
4) Can all these functions be turned on and off within settings of the indicator.
Yes
Okay Im still digesting this. Thank you!!!
1) cloud idea is good
2) vertical line is not what I expected I was thinking horizontal line plotting. That being said, I see that would be confusing, I understand the vertical lines are better and do reveal time pockets spent at POC or away. So that is useful data. QUESTION: Are the vertical lines ignoring the wick and only using the body of the candle? I see on a bar chart the cloud is where it closes correct?
3) Ok Im now understanding that the POC is information that is given from TOS and cannot be manipulated in anyway, thank you. I will have to track manually but the cloud will help me see this quickly when it moves.
4) Thank you
5) QUESTION: What is your favorite buying/selling pressure indicator?
 
TPO count is that a separate indicator Iknow there is a TPO profile are we talking the same thing?
TPO count is where you take the POC and count total units above and total units below then compare the ratio.

If TPO is a measure of time at a place then it can tell you where there is absorption of price happening and aggression. If there is less time spent in that area, then look to see what happens is price aggressively moving back into the POC area or aggressively pulling away. On the flipside in the dense area, if there is resistance to stay in that portion of the curve then a lot of time bigger players are absorbing positions.
 
TPO count is where you take the POC and count total units above and total units below then compare the ratio.

If TPO is a measure of time at a place then it can tell you where there is absorption of price happening and aggression. If there is less time spent in that area, then look to see what happens is price aggressively moving back into the POC area or aggressively pulling away. On the flipside in the dense area, if there is resistance to stay in that portion of the curve then a lot of time bigger players are absorbing positions.
How do I comprise this TPO count? Is there an indicator?
 
thats the question.. you gotta count the total above and total below the POC. Not sure what unit, but I imagine it would be good as a label

There is a TPOprofile indicator. As with the Volumeprofile and Monkeybars, regrettably we do not have access to data used in thinkscript nor a bar by bar tracking of the 'POCs'.
 
1/2) See if the following image script is close to what you expected.

3) When the POC moves from its current position is it possible to leave a ghost image or some kind of mark that would record that position?
TOS does not provide a way to track the POC on a bar by bar basis to be able to do this
4) Can all these functions be turned on and off within settings of the indicator.
Yes
Is it possible to integrate a cumulative volume delta indicator within the candles? Maybe they can paint? IDK Like this code:
declare lower;



input length = 10;



def O = open;

def H = high;

def C = close;

def L = low;

def V = volume;

def Buying = V * (C - L) / (H - L);

def Selling = V * (H - C) / (H - L);

def Delt = buying - selling;



plot Delta = Delt;

Delta.AssignValueColor(if Delta > 0 then Color.GREEN else Color.RED);

Delta.SetPaintingStrategy(PaintingStrategy.HISTOGRAM);

Delta.hide();



plot zero = 0;

zero.setDefaultColor(Color.BLUE);



plot CumulativeVolumeDelta = sum(Delta,length);

CumulativeVolumeDelta.AssignValueColor(if CumulativeVolumeDelta > 0 then Color.GREEN else Color.RED);

CumulativeVolumeDelta.SetPaintingStrategy(PaintingStrategy.HISTOGRAM);
 
Okay Im still digesting this. Thank you!!!
1) cloud idea is good
2) vertical line is not what I expected I was thinking horizontal line plotting. That being said, I see that would be confusing, I understand the vertical lines are better and do reveal time pockets spent at POC or away. So that is useful data. QUESTION: Are the vertical lines ignoring the wick and only using the body of the candle? I see on a bar chart the cloud is where it closes correct?
3) Ok Im now understanding that the POC is information that is given from TOS and cannot be manipulated in anyway, thank you. I will have to track manually but the cloud will help me see this quickly when it moves.
4) Thank you
5) QUESTION: What is your favorite buying/selling pressure indicator?
Okay Im still digesting this. Thank you!!!
1) cloud idea is good
2) vertical line is not what I expected I was thinking horizontal line plotting. That being said, I see that would be confusing, I understand the vertical lines are better and do reveal time pockets spent at POC or away. So that is useful data. QUESTION: Are the vertical lines ignoring the wick and only using the body of the candle? I see on a bar chart the cloud is where it closes correct?
3) Ok Im now understanding that the POC is information that is given from TOS and cannot be manipulated in anyway, thank you. I will have to track manually but the cloud will help me see this quickly when it moves.
4) Thank you
5) QUESTION: What is your favorite buying/selling pressure indicator?
Back testing the cloud you wrote, I thought at first it wasn't working but I see it was working behind the scenes. Even though the candle or bar was showing it was above the POC it wouldn't form until the candle was closed or confirmed after like 2 bars. I like it. Im trying to get just one simple indicator that I think works. Im confirming the move with the cumulative volume delta. Im always learning I tried looking at code but its tough...
 
Is it possible to integrate a cumulative volume delta indicator within the candles? Maybe they can paint? IDK Like this code:
declare lower;



input length = 10;



def O = open;

def H = high;

def C = close;

def L = low;

def V = volume;

def Buying = V * (C - L) / (H - L);

def Selling = V * (H - C) / (H - L);

def Delt = buying - selling;



plot Delta = Delt;

Delta.AssignValueColor(if Delta > 0 then Color.GREEN else Color.RED);

Delta.SetPaintingStrategy(PaintingStrategy.HISTOGRAM);

Delta.hide();



plot zero = 0;

zero.setDefaultColor(Color.BLUE);



plot CumulativeVolumeDelta = sum(Delta,length);

CumulativeVolumeDelta.AssignValueColor(if CumulativeVolumeDelta > 0 then Color.GREEN else Color.RED);

CumulativeVolumeDelta.SetPaintingStrategy(PaintingStrategy.HISTOGRAM);

Here is the pricecolor option based upon the cumulativevolume delta. In response to your earlier questions, 'touch' includes the wick and the cloud uses 'close'

.
Ruby:
input pricecolor = yes;

def yyyymmdd = GetYYYYMMDD();
def period   = CountTradingDays(Min(First(yyyymmdd), yyyymmdd), yyyymmdd) - 1;;
def cond     = 0 < period - period[1];
profile vol  = VolumeProfile("startNewProfile" = cond, "onExpansion" = no, numberOfProfiles = 1, "value area percent" = 0.0, pricePerRow = PricePerRow.TICKSIZE);

plot b = vol.GetPointOfControl();

input showlabel = yes;
AddLabel(showlabel, "Close: " + AsText(close) + " POC: " + AsText(b) + " %Var: " + AsPercent((close - b) / b), if close > b then Color.GREEN else if close < b then Color.RED else Color.WHITE);

input showcloud = yes;
def bn      = barnumber();
def crossbn = if close crosses b then bn else double.nan;
def touch   = between(b,low,high);
addcloud(if showcloud and !touch and bn>=highestall(crossbn) then close else double.nan, b, color.green, color.red);

input showvertical = yes;
addverticalLine(showvertical and close crosses b, "", if close crosses above b then color.green else color.red);


input length = 10;



def O = open;

def H = high;

def C = close;

def L = low;

def V = volume;

def Buying = V * (C - L) / (H - L);

def Selling = V * (H - C) / (H - L);

def Delt = buying - selling;



def Delta = Delt;

#Delta.AssignValueColor(if Delta > 0 then Color.GREEN else Color.RED);

#Delta.SetPaintingStrategy(PaintingStrategy.HISTOGRAM);

#Delta.hide();



def zero = 0;

#zero.setDefaultColor(Color.BLUE);



def CumulativeVolumeDelta = sum(Delta,length);

assignpriceColor(if !pricecolor then color.current else if CumulativeVolumeDelta > 0 then Color.GREEN else Color.RED);

#CumulativeVolumeDelta.AssignValueColor(if CumulativeVolumeDelta > 0 then Color.GREEN else Color.RED);

#CumulativeVolumeDelta.SetPaintingStrategy(PaintingStrategy.HISTOGRAM);
 
Here is the pricecolor option based upon the cumulativevolume delta. In response to your earlier questions, 'touch' includes the wick and the cloud uses 'close'
Most appreciated, Im sure this has all been done and I appreciate you placating my naïveté. I mean that in a nice way. But this is helping me understand. Thank you!!! Enjoy the 4TH. 😎🧨
 
Most appreciated, Im sure this has all been done and I appreciate you placating my naïveté. I mean that in a nice way. But this is helping me understand. Thank you!!! Enjoy the 4TH. 😎🧨
Ok one more question. is it possible to put the volume delta amount on the candle/bar etc. so it can be toggled on and off.
 
Ok one more question. is it possible to put the volume delta amount on the candle/bar etc. so it can be toggled on and off.

The volume delta amount is displayed in a bubble, colored green if delta > 0 and red otherwise. You can turn the bubble on/off at an input and move the bubble up/down with the input bubbleoffset.

Capture.jpg
Ruby:
input pricecolor = yes;

def yyyymmdd = GetYYYYMMDD();
def period   = CountTradingDays(Min(First(yyyymmdd), yyyymmdd), yyyymmdd) - 1;
;
def cond     = 0 < period - period[1];
profile vol  = VolumeProfile("startNewProfile" = cond, "onExpansion" = no, numberOfProfiles = 1, "value area percent" = 0.0, pricePerRow = PricePerRow.TICKSIZE);

plot b = vol.GetPointOfControl();

input showlabel = yes;
AddLabel(showlabel, "Close: " + AsText(close) + " POC: " + AsText(b) + " %Var: " + AsPercent((close - b) / b), if close > b then Color.GREEN else if close < b then Color.RED else Color.WHITE);

input showcloud = yes;
def bn      = BarNumber();
def crossbn = if close crosses b then bn else Double.NaN;
def touch   = Between(b, low, high);
AddCloud(if showcloud and !touch and bn >= HighestAll(crossbn) then close else Double.NaN, b, Color.GREEN, Color.RED);

input showvertical = yes;
AddVerticalLine(showvertical and close crosses b, "", if close crosses above b then Color.GREEN else Color.RED);

#Buying/Selling Pressure
input length = 10;

def O = open;
def H = high;
def C = close;
def L = low;
def V = volume;
def Buying = V * (C - L) / (H - L);
def Selling = V * (H - C) / (H - L);
def Delt = Buying - Selling;

input showdelta    = yes;
input bubbleoffset = 1;

plot Delta = Delt;
AddChartBubble(showdelta and !IsNaN(close), low - bubbleoffset * TickSize(),
               if absvalue(Delta) > 1000
               then Round(Delta / 1000, 0) + "k"
               else delta + "",
               delta.TakeValueColor(), no);

Delta.AssignValueColor(if Delta > 0 then Color.GREEN else Color.RED);
Delta.SetPaintingStrategy(PaintingStrategy.HISTOGRAM);
Delta.Hide();

def zero = 0;
#zero.setDefaultColor(Color.BLUE);

def CumulativeVolumeDelta = Sum(Delta, length);
AssignPriceColor(if !pricecolor then Color.CURRENT else
                 if CumulativeVolumeDelta > 0
                 then Color.GREEN                 
                 else Color.RED);

#CumulativeVolumeDelta.AssignValueColor(if CumulativeVolumeDelta > 0 then Color.GREEN else Color.RED);
#CumulativeVolumeDelta.SetPaintingStrategy(PaintingStrategy.HISTOGRAM);
 
The volume delta amount is displayed in a bubble, colored green if delta > 0 and red otherwise. You can turn the bubble on/off at an input and move the bubble up/down with the input bubbleoffset.
Well it backtested beautifully. Real life remains to be seen. But I like it. Bubbles work great the info comes in and I can see a big dip or buy - or + clearly...amazing thank you. 😃
 
Well it backtested beautifully. Real life remains to be seen. But I like it. Bubbles work great the info comes in and I can see a big dip or buy - or + clearly...amazing thank you. 😃
The volume delta amount is displayed in a bubble, colored green if delta > 0 and red otherwise. You can turn the bubble on/off at an input and move the bubble up/down with the input bubbleoffset.
Okay this indicator performed well IMO I see that it can still be dialed in a bit, to maybe confirm some variables.
Is it possible to incorporate the following:

1) a bubble that follows the candle that displays what the %var poc says and be able to turn on and off.

2) a line that follows price movement on the candle and the price is displayed on that line and the line goes off to the right but doesn't interfere with the candle. Also can be turned on and off. I realize a bar chart is similar without the price attached, but I like HA candles.

3)Is it possible to calculate the previous delta number that is displayed, + vs - candles and get an avg? whether its more or less positive? And display that in upper left corner?

4) set the delta to watch for spikes in either direction. set a number that can be changed? or turned off. etc? that candle would have pyramid either underneath or on top?

thank you for your help thus far.
If you need an image for 1 and 2 let me know.
 

Join useThinkScript to post your question to a community of 21,000+ developers and traders.

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

87k+ Posts
422 Online
Create Post

Similar threads

Similar threads

The Market Trading Game Changer

Join 2,500+ subscribers inside the useThinkScript VIP Membership Club
  • Exclusive indicators
  • Proven strategies & setups
  • Private Discord community
  • ‘Buy The Dip’ signal alerts
  • Exclusive members-only content
  • Add-ons and resources
  • 1 full year of unlimited support

Frequently Asked Questions

What is useThinkScript?

useThinkScript is the #1 community of stock market investors using indicators and other tools to power their trading strategies. Traders of all skill levels use our forums to learn about scripting and indicators, help each other, and discover new ways to gain an edge in the markets.

How do I get started?

We get it. Our forum can be intimidating, if not overwhelming. With thousands of topics, tens of thousands of posts, our community has created an incredibly deep knowledge base for stock traders. No one can ever exhaust every resource provided on our site.

If you are new, or just looking for guidance, here are some helpful links to get you started.

What are the benefits of VIP Membership?
VIP members get exclusive access to these proven and tested premium indicators: Buy the Dip, Advanced Market Moves 2.0, Take Profit, and Volatility Trading Range. In addition, VIP members get access to over 50 VIP-only custom indicators, add-ons, and strategies, private VIP-only forums, private Discord channel to discuss trades and strategies in real-time, customer support, trade alerts, and much more. Learn all about VIP membership here.
How can I access the premium indicators?
To access the premium indicators, which are plug and play ready, sign up for VIP membership here.
Back
Top