|
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.
|