I would like to add a bubble only when the PPS indicator has a buy signal and the arrow is higher than the previous one.
The bubble will have the arrow number up, example 1,2,3,4 etc...
When the next buy arrow is lower then the counter reset
I do not why the replica does not work for me (different signals from the original). Any idea?
The replica by Mobius is his version of how the PPS was likely done, as on TOS, the PPS code is protected. His version is not exact.
The "replica" that I used in a post above just defines the pps plots in the hidden code so that what you requested, for example, can be provided.
The image shows the replica in the upper chart and the TOS PPS protected code version in the lower for comparison.
Code:#PPS Replica input ArrowsOn = yes; input TracerLinesOn = no; input PriceColorOn = Yes; input ShowTodayOnly = no; input ShowExtraDays = 0; def Today = if !ShowTodayOnly then 1 else if GetDay() + ShowExtraDays >= GetLastDay() && GetYear() == GetLastYear() then 1 else 0; input ArrowSpace = 0; def space = Average(high - low) * ArrowSpace; input AlertsOn = no; def BuyIt = PPS().buysignal; def SellIt = PPS().sellsignal; plot ppsBuy = if !Today or !ArrowsOn then Double.NaN else BuyIt - space; ppsBuy.SetPaintingStrategy(PaintingStrategy.ARROW_UP); ppsBuy.SetDefaultColor(Color.WHITE); ppsBuy.SetLineWeight(3); Alert(AlertsOn and ppsBuy, “PPS Buy Signal”, Alert.BAR, Sound.Ring); plot ppsSell = if !Today or !ArrowsOn then Double.NaN else SellIt + space; ppsSell.SetPaintingStrategy(PaintingStrategy.ARROW_DOWN); ppsSell.SetDefaultColor(Color.WHITE); ppsSell.SetLineWeight(3); Alert(AlertsOn and ppsSell, “PPS Sell Signal”, Alert.BAR, Sound.Ring); rec PriceAtBuy = if BarNumber() == 1 then close else if !IsNaN(BuyIt[0]) then close[0] else PriceAtBuy[1]; rec PriceAtSell = if BarNumber() == 1 then close else if !IsNaN(SellIt[0]) then close[0] else PriceAtSell[1]; rec trigger = if PriceAtBuy <> PriceAtBuy[1] then -1 else if PriceAtSell <> PriceAtSell[1] then 1 else trigger[1]; plot BuyPrice = if TracerLinesOn && trigger == -1 then PriceAtBuy else Double.NaN; BuyPrice.SetDefaultColor(Color.WHITE); BuyPrice.SetPaintingStrategy(PaintingStrategy.POINTS); plot SellPrice = if TracerLinesOn && trigger == 1 then PriceAtSell else Double.NaN; SellPrice.SetDefaultColor(Color.YELLOW); SellPrice.SetPaintingStrategy(PaintingStrategy.POINTS); AssignPriceColor(if !PriceColorOn then Color.CURRENT else if trigger == 1 then Color.RED else Color.GREEN); def bb = if IsNaN(BuyIt) then bb[1] else if BuyIt then ppsBuy else bb[1]; def buycount = if bb > bb[1] then buycount[1] + 1 else if bb < bb[1] then 0 else buycount[1]; input showbubble = yes; AddChartBubble(showbubble and BuyIt and buycount > 0, low, buycount, up = no, color = Color.GREEN); #
Last edited: