Crossover alert question/help

liminal-rider

New member
I wish to add an alert for the below script...a buy alert when price crosses above "crossprice" and a sell alert when price crosses below "crossprice" one bar ago that signal once. Also, that sends a text message to my cell phone. Below is the script. Thanks.

Code:
input FAST = 8.3896;
input SLOW = 17.5185;
input Length = 9.0503;

#Constants
def a = 2 / (1 + FAST);
def b = 1 - a;
def c = 2 / (1 + SLOW);
def d = 1 - c;
def e = 2 / (1 + Length);
def f = 1 - e;

rec FASTMAQ = (close[1] * a) + (FASTMAQ[1] * b);
rec SLOWMAQ = (close[1] * c) + (SLOWMAQ[1] * d);
def MACD = FastMAQ - SLOWMAQ;

rec Signal = (MACD * e) + (Signal[1] * f);

plot Crossprice = ((Signal * f) + (FASTMAQ * b * e) - (SLOWMAQ * d * e) -
(FASTMAQ * b) + (SLOWMAQ * d)) / (a - c - (a * e) + (c * e));

plot xPrice = CrossPrice;
 

BenTen

Administrative
Staff
VIP
Add this to the bottom of your script:

Code:
def condition1 = close crosses above Crossprice;
def condition2 = close crosses below Crossprice;
Alert(condition1, " ", Alert.Bar, Sound.Chimes);
Alert(condition2, " ", Alert.Bar, Sound.Bell);
 

BillW

New member
I can code cross alerts but need help with a simple zeroline cross alert.
The indicator is TRIX

lxTQ3d8.jpg
 

Similar threads

Top