chicago il USA
Posts: 19 since Apr 2012
Thanks Given: 9
Thanks Received: 11
|
there isnt a way i know of in TOS to have a script fire off an alert.....alerts have to manually be set up......
however you can have a ring or ding in the script to go off a pop in the upper right hand corner when certain criteria is met......sorry i am not a scripter .....however this may help.......i did not create this script......
this is a simple script combining 3 indicators into one I found online.....
#Name: ChrisStoplight
#Programmed By: Chris Ball ([email protected]) on 1/31/09
#Posted At:
#Description: This indicator is truly a representation of 3 indicators (RSI, DMI and the StochasticsMomentumIndex).
declare lower;
Input rsi = 50 ;
Input DMI = 14 ;
plot rsi1 = if RSIWilder(length = 14)."RSI" >= rsi then 10 else 9;
plot rsi2 = if RSIWilder(length = 14)."RSI" < rsi then 10 else 9;
AddCloud(rsi1, rsi2);
plot dmi1 = if DMI()."DI+" >= DMI()."DI-" then 8 else 7;
plot dmi2 = if DMI()."DI+" < DMI()."DI-" then 8 else 7;
AddCloud(dmi1, dmi2);
plot sto1 = if StochasticMomentumIndex()."SMI" >= StochasticMomentumIndex()."AvgSMI" then 6 else 5;
plot sto2 = if StochasticMomentumIndex()."SMI" < StochasticMomentumIndex()."AvgSMI" then 6 else 5;
AddCloud(sto1, sto2);
rsi1.setDefaultColor(Color.Gray);
rsi2.setDefaultColor(Color.Gray);
dmi1.setDefaultColor(Color.Gray);
dmi2.setDefaultColor(Color.Gray);
sto1.setDefaultColor(Color.Gray);
sto2.setDefaultColor(Color.Gray);
# an example of the code for the alert below........simple rsi alert
def SELL =rsi crosses above 70 ;
def BUY = rsi crosses below 30 ;
alert(SELL, "SELL", Alert.BAR, Sound.Ding);
alert(BUY, "BUY", Alert.BAR, Sound.Ring);
|