NexusFi: Find Your Edge


Home Menu

 





Alert triggered from multiple studies


Discussion in ThinkOrSwim

Updated
    1. trending_up 11,459 views
    2. thumb_up 2 thanks given
    3. group 1 followers
    1. forum 2 posts
    2. attach_file 0 attachments




 
Search this Thread

Alert triggered from multiple studies

  #1 (permalink)
tozwp
Milwaukee WI/US
 
Posts: 7 since Feb 2012
Thanks Given: 2
Thanks Received: 1

Relatively new to TOS and its scripting language and I have more experience with TS/MC/EasyLanguage. Have a question as to whether or not TOS is capable of generating an alert or highlighting a bar on a chart when a criteria is met. Basically looking to eyeball backtest an idea similar to a 'showme' study in TS. I have a chart with several indicators that are built on different symbols. The price chart is SPX or another major index and below that I have breadth indicators built with Advancing and Declining Issues, VIX and TRIN. On each of these indicators right now I have some simple moving averages plotted. Now for the tricky part. When I have the combination I am looking for from the several indicators in the subcharts, how to I fire off an alert or have the program highlight the bar where the combination is true? In TS this is easily done but I'm lost in TOS so far. Right now I would like to know if it is possible to do this. If it is, then I'll start looking into how much work it will be. I've seen some indications that it might not be possible and that is why I thought I'd ask here. Thanks!

Reply With Quote

Can you help answer these questions
from other members on NexusFi?
MC PL editor upgrade
MultiCharts
Quant vue
Trading Reviews and Vendors
REcommedations for programming help
Sierra Chart
How to apply profiles
Traders Hideout
Pivot Indicator like the old SwingTemp by Big Mike
NinjaTrader
 
  #2 (permalink)
Gisfor
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);

Reply With Quote
Thanked by:
  #3 (permalink)
Gisfor
chicago il USA
 
Posts: 19 since Apr 2012
Thanks Given: 9
Thanks Received: 11


also forgot to mention......and I am NOT trying to take you away from this site....just trying to help u find an answer......
I also go to the TOS chatroom ......."thinkscript lounge" and many people have helped me with stuff about scripting......

Reply With Quote
Thanked by:




Last Updated on April 30, 2012


© 2024 NexusFi™, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
All information is for educational use only and is not investment advice. There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Privacy Policy - Downloads - Top
no new posts