Help with PPS indicator in Watchlist

S

ssaeed73

New member
Hi everyone, new to ThinkorSwim and to this site. Hoping someone can lend me a hand with this problem.

I am trying to get the PPS Buy and Sell signals in a column in my watchlist and have been able to do so using the code below. The issue is that I run this on the 5 min chart and the signal triggers on and off as the condition for Buy and Sell is being formed. What I would like to do is to only get the notification once the Buy or Sell signal is confirmed on one 5 min candle and that the alert stay on for at least the next five minutes before it goes away. Is that possible? Thanks in advance!

def buy = !IsNaN(PPS().”BuySignal”);
def sell = !IsNaN(PPS().”SellSignal”);

AddLabel(buy, "Buy Fired", color.black);
AddLabel(sell, "Sell Fired", color.black);
AddLabel(!buy and !sell, " ", color.black);

AssignBackgroundColor(if buy then color.white else if sell then color.white else color.black);
 
J

Joules360

New member
HOw do I get this into the watchlist format? I created a study.... cant seem to get into watchlist format for my symbols.

I figured it out....also changed the color background to red for sell and green for buy...visual cues are great....also put it in columns of 1 5 20 min 1 hour and 4 hour....powerful to get similar signals in different time frames.

Thanks Joules
 
J

Joules360

New member
hi:

I picked up this code from SSAEED73...trying to add audible alerts...any help?

Code:
def buy = !IsNaN(PPS().”BuySignal”);
def sell = !IsNaN(PPS().”SellSignal”);

AddLabel(buy, "Buy Fired", color.black);
AddLabel(sell, "Sell Fired", color.black);
AddLabel(!buy and !sell, " ", color.black);

AssignBackgroundColor(if buy then color.white else if sell then color.white else color.black);

I tried this..but no sound yet...

def buy = !IsNaN(PPS().”BuySignal”);
def sell = !IsNaN(PPS().”SellSignal”);

AddLabel(buy, "Buy", color.black);
AddLabel(sell, "Sell", color.black);
AddLabel(!buy and !sell, " ", color.black);

Alert(Sell, “Sell”, Alert.BAR, Sound.Ring);
Alert(Buy, “Buy”, Alert.BAR, Sound.Ding);


AssignBackgroundColor(if buy then color.green else if sell then color.red else color.black);
 
Last edited by a moderator:
  • Like
Reactions: MBF
J

Joules360

New member
NO one has any hints for me? I put in thealert line ..no sound?

Joules
 
J

Joules360

New member
Ok ...I get it.....you want me to learn how to fish...instead of throwing me a fish.....

I been trying to copy and paste other alert code into this program with no luck....is it because its watchlist...that it wont allow an audible alert?

Thanks,
Joules
p.s. I hate fish....lol
 
K

Kiriland

New member
Hello Guys,

I am hoping to get some help is building an watchlist "indicator".

Is based on PPS study.

I used a code I found in the forum that is great, but i need some improvement. Now the indicator is showing only then event happens. PPS is triggered (Buy/ Sell). What i need is to get an indicator that is sensitive not only to a single event, but to count how many bars ago did happen. Example on 5 min chart if a buy/sell signal was triggered 15m ago I want in my added field in the watchlist to appear "buy -3" is 20 min "buy -4" same with the same. I assume this will be a loop code then this is all I have. I am adding as well the code I already have. It will be great is the color changes as well in the event is a buys is a regular green, if it happened a few bars ago dark green with text inside on the number of bars and same for sell signal

Code:
def buy = !IsNaN(PPS().”BuySignal”);
def sell = !IsNaN(PPS().”SellSignal”);

AddLabel(buy, "Buy Fired", color.black);
AddLabel(sell, "Sell Fired", color.black);
AddLabel(!buy and !sell, " ", color.black);

AssignBackgroundColor(if buy then color.DaRK_GREEN else if sell then color.dark_reD else color.black);

Thank you so much for the help. Regards Kiril
 
Thread starter Similar threads Forum Replies Date
M Scan Help POC close to VAH or VAL Questions 0
scott69 Help with a "def" statement Questions 4
B Help With a Label Statement Questions 5
L TOS Strategy Backtesting help Questions 13
P Help with TOS code - Only One Signal at a Time Questions 2

Similar threads

Top