NexusFi: Find Your Edge


Home Menu

 





Trigger Alert when %age in Volume Changes Within Timeframe


Discussion in ThinkOrSwim

Updated
      Top Posters
    1. looks_one kosnarf with 1 posts (0 thanks)
    2. looks_two staspo with 1 posts (0 thanks)
    3. looks_3 opts with 1 posts (0 thanks)
    4. looks_4 MrAPod with 1 posts (0 thanks)
    1. trending_up 13,307 views
    2. thumb_up 0 thanks given
    3. group 5 followers
    1. forum 4 posts
    2. attach_file 0 attachments




 
Search this Thread

Trigger Alert when %age in Volume Changes Within Timeframe

  #1 (permalink)
MrAPod
hamburg + germany
 
Posts: 1 since Jul 2014
Thanks Given: 0
Thanks Received: 0

Hey guys,
I'm quite new here and to all of the ThinkScript stuff! I just wanted to ask real quick if there is a possibility to code a script / alert in TOS' thinkscript / thinkalert plattform that does the following:

- When a certain spike in volume occurs (for instance 15%+ gain in volume in trades @ one or more of my stocks on my watchlist) within a timeframe like 1m (one BAR in the one minute timeframe), an alert triggers!

alternatively (or as an addition) something that does the same but with the price per share of a stock: If a stock's price goes up like 10% in a specified timeframe like 1-2 minutes, it should fire off my alert.

Does someone know how to do it? Woudl be REALLY thankful

Reply With Quote

Can you help answer these questions
from other members on NexusFi?
How to apply profiles
Traders Hideout
Pivot Indicator like the old SwingTemp by Big Mike
NinjaTrader
ZombieSqueeze
Platforms and Indicators
MC PL editor upgrade
MultiCharts
Cheap historycal L1 data for stocks
Stocks and ETFs
 
  #2 (permalink)
kosnarf
Long Beach CA
 
Posts: 4 since Mar 2014
Thanks Given: 0
Thanks Received: 1


MrAPod View Post
Hey guys,
I'm quite new here and to all of the ThinkScript stuff! I just wanted to ask real quick if there is a possibility to code a script / alert in TOS' thinkscript / thinkalert plattform that does the following:

- When a certain spike in volume occurs (for instance 15%+ gain in volume in trades @ one or more of my stocks on my watchlist) within a timeframe like 1m (one BAR in the one minute timeframe), an alert triggers!

alternatively (or as an addition) something that does the same but with the price per share of a stock: If a stock's price goes up like 10% in a specified timeframe like 1-2 minutes, it should fire off my alert.

Does someone know how to do it? Woudl be REALLY thankful

I will lead you in the right direction:

1) calculate the volume average
2) compare the volume to above volume average you want (might want to use input instead of def)
3) use def for the comparison
4) define a "plotter" def
5) define an alert plot using the comparison def that plots to plot the "plotter" def


Feel free to reply if you still need help

Reply With Quote
  #3 (permalink)
staspo
Vancouver, Canada
 
Posts: 1 since Nov 2014
Thanks Given: 0
Thanks Received: 0


Hi kosnarf,

I had exactly the same question and eventually I found the solution - please see below:

def afterStart = secondsfromtime(1000)>0;
def beforeEnd = secondstilltime(1530)>0;
def conditionTrue = volume > 10*average(volume, 390);
plot alert = afterStart and beforeEnd and conditionTrue;


This alert will pop up when there is a volume spike in the stock. Please note - when you set the alert you should choose your aggregation period. I have chosen 5 min as I work with 5 min candles. You asked about 1 or 2 min, so you will have to set it to 1 or 2 min. The following values are used in this particular example:

1. afterStart is set to 1000 - meaning 10:00am, i.e. the alert will ignore any volume spikes in the first 30 minutes of trading because based on my experience, most of the stocks have increased volume during the first 30 minutes of trading, so if you dont ignore, you will have a lot of alerts (depending on how many stocks you are watching).

2. beforeEnd is set to 1530 - meaning 15:30 (3:30pm) same logic as above, but for the end of the trading day.

3. volume > 10 - meaning the volume of the current bar/candle is higher 10 times than the average for the last 390 bars/candles.

4. 390 - I set it to 390 because I'm using the aggregation period of 5 min, so for the whole trading day it's 5min x 390 = 6 hours and 30 min which is the length of the trading day.

So you will have to play with the values to fit them to your needs. I believe same logic will work for the price.

The only issue is that you will have to set this alert for every stock in your watchlist to be notified. I was trying to find a way to setup alert only once, but to apply it for the entire watchlist. I haven't succeeded yet. At the time I asked TOS support, but they said there was no such capability yet. I don't know whether it's been developed since then.

Good luck and let me know if it worked for you.

Reply With Quote
  #4 (permalink)
 
opts's Avatar
 opts 
NW Florida
 
Experience: Intermediate
Platform: OX and TOS
Trading: Futures Options, Stocks
Posts: 234 since Aug 2012
Thanks Given: 29
Thanks Received: 115

So if I wanted to have an SMS alert sent to my phone instead of plotting the alert on the chart how would that be done?

I want to add the alert to several tickers in my watchlist and look for volume spikes between 12:30 pm and up until the close at 3pm CST. I think the code has to be changed from plot to alert but not sure how to do that...

Thanks.

Reply With Quote
  #5 (permalink)
haoqi001
Detroit, michigan/usa
 
Posts: 1 since Nov 2018
Thanks Given: 0
Thanks Received: 0


staspo View Post
Hi kosnarf,

def afterStart = secondsfromtime(1000)>0;
def beforeEnd = secondstilltime(1530)>0;
...
plot alert = afterStart and beforeEnd and conditionTrue;

Please excuse my novice, should it be "(afterStart OR beforeEnd) and conditionTrue
?

Reply With Quote




Last Updated on November 12, 2018


© 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