Sending alerts from script

max

New member
VIP
I made a script and added the alert. It looks it works fine - I can hear the bell sound if I close to my laptop. The same script is running on the mobile ThinkorSwim app. But I don't get any notification from mobile script. I would like to get also text alert. I added everything in the settings and it works fine if I add the alert manually. But not from the alert in the script. Is it possible in general to get notification from script?

Edit: Follow the tutorial here https://usethinkscript.com/threads/how-to-receive-thinkorswim-alert-notifications-via-phone.5430/
 

mfsteve

Member
VIP
I also have this question. I'm using the latest MacOS and TOS Desktop, latest iOS and TOS mobile.

I get the desktop alert but nothing on the iPhone (running TOS Mobile).

Update: I contacted TOS support about this. They sent me instructions on enabling notifications in the desktop app and on the phone (which I already had in place). So, still no joy getting an alert() from thinkscript on the laptop sent to the iPhone. I am giving up on the idea.
 
Last edited:

TMB70

New member
@BenTen Hello. I have a similar questions regarding alerts but wasn't sure where to post them. I see that you have helped with various scripts that include sound alerts. I borrowed one and created the following in an attempt to create an audible reference for when "the tape" speeds up.

Code:
# Ticker for audible signal as volume increases
# based on_volume contracts being filled more quickly

def tick = tick_count - tick_count[1];

# Alerts
Alert(tick, " ", Alert.Bar, Sound.Chimes);

This code produces a ding each time the next candle starts. I am currently watching it with a 21T count.
Q1) Is there a way to have the sound produced each time a contract is filled instead of when is reaches a count of 21 and starts the next candle?
Q2) Are there any other sounds that can be implemented besides the standard bell, ding, ring, or chimes? I would prefer a tick or click sound.
 

XeoNoX

Well-known member
VIP
Q1) Is there a way to have the sound produced each time a contract is filled instead of when is reaches a count of 21 and starts the next candle?

In theory every time a contract fills it produces a volume candle, therefore u can set it to make a alert every time a volume adds +1... (dont know what you are trying to do but it would constantly be going off on most instruments/tickers)

Q2) Are there any other sounds that can be implemented besides the standard bell, ding, ring, or chimes? I would prefer a tick or click sound.

if you have a study and the actual ticker/symbol/instrument loaded on your chart with the study loaded you can get a alert, however in doing this as you have already found out you are out of luck if you are trying to change from the stock standard TOS sounds from within a study by itself as you are restricted to using the 4 or 5 stock ones..

there is a tad bit trickier and more of a " limited workaround" but you can add scan to watch-list, create alert when symbol gets added (the scan would have to meet your criteria and be labeled as "TRUE") for it to trigger, then u can also choose custom sounds from the menu..... unfortunately for tos the scans inside the watch-lists only refresh every couple minutes so if your expecting live tick by tick alerts to be sent as sound your out of luck..


sEY1AWs.png
 

Satmon06

New member
VIP
Testing this right now.. Can someone help to add sound alerts for this code? Thanks.

Code:
# John Ehlers' Forward and Reversed EMA

input tradesize = 1;
input AA = 0.1;

def CC = 1 - AA;
def EMA = AA * close + CC * EMA[1];
def RE1 = CC * EMA + EMA[1];
def RE2 = Power(CC, 2) * RE1 + RE1[1];
def RE3 = Power(CC, 4) * RE2 + RE2[1];
def RE4 = Power(CC, 8) * RE3 + RE3[1];
def RE5 = Power(CC, 16) * RE4 + RE4[1];
def RE6 = Power(CC, 32) * RE5 + RE5[1];
def RE7 = Power(CC, 64) * RE6 + RE6[1];
def RE8 = Power(CC, 128) * RE7 + RE7[1];
def Signal = EMA - AA * RE8;
def svalue = Signal;
def zeroline = 0;

################ LONG ENTRY
def longsignal = Signal > 0;

################ SHORT ENTRY
def signalshort = Signal < 0;

################ LONG EXIT
def longexit = Signal < 0;

################ SHORT EXIT
def shortexit = Signal > 0;

################ ENTRY ORDERS
AddOrder(OrderType.BUY_AUTO, longsignal, open[1], tradesize, Color.CYAN, Color.CYAN);
AddOrder(OrderType.SELL_AUTO, signalshort, open[1], tradesize, Color.GREEN, Color.GREEN);

################ Alert  ????????
 

rad14733

Well-known member
VIP
Add these lines of code at the bottom...
Ruby:
################ Alerts
Alert(longsignal, "Long Signal", Alert.BAR, Sound.Ding);
Alert(signalshort, "Short Signal", Alert.BAR, Sound.Ding);
 
Top