♥ 0 |
I have a simple PPS column indicator I pieced together that will change colors dependent of which signal is currently triggered. I use it in multiple columns each with a different timeframe to get a decent idea of the overall trend…what I can’t seem to figure out is how to get the price of the security when the study was triggered to display in the box rather than just the current close. I have already tried to create a counter and use that in ‘close[x]’ but apparently the ‘x’ must be a constant. Is there even a way to do this? Here is the code i am using: def sell = PPS().”SellSignal”; rec PriceAtBuy = if BarNumber() == 1 then close else if !IsNaN(buy[0]) then open[0] else PriceAtBuy[1]; rec trigger = if PriceAtBuy <> PriceAtBuy[1] then -1 else if PriceAtSell <> PriceAtSell[1] then 1 else trigger[1]; #def SellPrice = if trigger == 1 then PriceAtSell else Double.NaN; AddLabel(yes, close, if trigger == -1 then color.black else color.white); I only take credit for piecing it together from other code I have found online…Any help is appreciated! RESOLVED
Marked as spam
|
Please log in to post questions.
Due to the context of this post it will be moved out of the “Alerts and Notifications” topic and into the “Watch Lists” topic. I will also change the title of the question to more accurately describe the context of the question. This will make it easier for the rest of our visitors to search for and find this question and it’s solution. When I change that title it will also change the URL. So the original link to the post will no longer work.
The new question title will be: “Display close from most recent PPS signal”