Alert Based on Custom Study | Study does not exist?

J

JabronLames

Member
VIP
Hello Guys,

I'm trying to manually set an alert for a chart I pulled up by navigating to..

=> Right Click Chart
=> Select 'Create Alert'
=> Select 'Price' Dropdown
• Select 'Study'
• Select 'Edit'...

The study I have loaded on my chart is below, it finds the distance form the current price to the ATR Trailing Stop as a %. I'm setting the 'alert' for when the price approaches the trailing stop.

Plot distanceToStop is less than VALUE.

When I set the condition for the study in the watchlist, I receive the error "Error Processing Script: No Such Study

Is anyone able to clue me in on what I'm doing wrong?

Thank you!

**Trailing Stop Study

Code:
# By Dan Dude
# ATR Trailing Stop - Chart Label
# Copyright forever
input price = close;

def ATR = reference ATRTrailingStop();

#def DistanceBetween = (Sqrt(Sqr(EMASlow / EMAFast))) / 100;

#def distanceToStop = (price / ATR - 1) * 100;

plot distanceToStop =  (Sqrt(Sqr(price / ATR - 1))) * 100;

#def distanceToStopInDollars=  (Sqrt(Sqr(price - ATR)));

input Labels = "Yes";


AddLabel(distanceToStop and yes, "ATR Dist. = " + asPercent(round(distanceToStop,2)), if distanceToStop > .35 then color.light_RED else color.light_green);

#AddLabel(distanceToStopInDollars and yes, "ATR Dist. = $" + asText(round(distanceToStopInDollars,2)), color.light_green);

**END
 
J

JabronLames

Member
VIP
Update:

I can add the exact same criteria as a custom scan without receiving the error...
This leads me to believe there isn't an issue with the code...

*Bumping my own thread in hopes of receiving feedback...
 
J

JabronLames

Member
VIP
UPDATE AGAIN:

For reference to everyone here. You cannot create an alert based on a study with a REFERENCE()

Now that the alert has been re-created...there is a new error. yay.

rec usage is not allowed in this context


Any ideas what this means? TOS has little info on it....
 
J

JabronLames

Member
VIP
OK So pretty much no custom studies can be referenced in manually chart alerts.

How disappointing =(
 
C

cay7man

New member
VIP
I added an alert to one of my study. The alert is not enabled by default by TOS. I had to configure the study and enable it for the stock.
Every time I change the stock on the chart Window, I've to do it all over again. Any workaround for this? How to enable the alert
by default?
 
BenTen

BenTen

Administrative
Staff
VIP
@cay7man Hard to help when you don't post the script in question.
 
C

cay7man

New member
VIP
sorry about hijacking another thread. I thought I created a new post.

Alert(p, "test", Alert.BAR, Sound.Ding);

I can't post the full script, sorry.
 
BenTen

BenTen

Administrative
Staff
VIP
@cay7man You didn't. I moved it here. I assume you need help with a paid indicator? In that case, I would reach out to the person who made it and ask for support. I wouldn't be able to help with what you provided.
 

Similar threads

Top