Abnormal Number Of Trades Intraday Indicator/Scanner

J

justAnotherTrader

Member
VIP
Just a simple momentum scanner designed to pick up on unusual number of trades inspired by equityfeed. This scanner will scan on the desired time frame for stocks that are 3*the average number of trades in the current bar i.e. 1min etc. I hope you guys like it, I havent found a similar one on this site, so let me know if its a dup.

Code:
declare lower;

def AbnormalTradeMultiplier = 3;
def AvgTradeCountLength = 50;

def TradeCount = tick_count;
def AvgTradeCount = Average(TradeCount, AvgTradeCountLength);
def AbnormalNumberOfTrades = AbnormalTradeMultiplier*AvgTradeCount;
def scan = TradeCount > AbnormalNumberOfTrades;

plot s =scan;

This picture shows where the scan would have picked up NCLH indicated by the oval on the lower indicator and the red arrow on the main chart.

 
Last edited:
J

justAnotherTrader

Member
VIP
@Newton I use it as a scanner, but I adjust everything from the thinkscript editor. So far the way I have gotten the most utility out of it is to set the AvgTradeCount > 100 and set time frame to 5 minutes to get me the most liquid stocks with abnormal trade activity.

A real life example: Yesterday the scanner picked up on AMD at $60 around market open. The stock continued to run all day into after market reaching a peak of somewhere around 62.50

Im still playing with the settings but I believe there is a lot of potential using it in conjunction with another study. If for no other reason than to identify a universe of stocks that are super liquid to get in and out of quickly.

My settings with the 5 minute time frame:
Code:
declare lower;

def AbnormalTradeMultiplier = 3;
def AvgTradeCountLength = 50;

def TradeCount = tick_count;
def AvgTradeCount = Average(TradeCount, AvgTradeCountLength);
def AbnormalNumberOfTrades = AbnormalTradeMultiplier*AvgTradeCount;
def scan = TradeCount > AbnormalNumberOfTrades;


plot s =scan and AvgTradeCount > 100;
 
Last edited:
Adeodatus

Adeodatus

New member
Very limited indicator, but it does exactly what its programmed it to do. I like intraday, not so much swingtrade or buy and hold, so I shortened the "def AvgTradeCountLength" to '13', to give it room to look back and still be ahead of any major movement. Works very well! I can get into a bullish run and, along with other indicators, it always provides the first indication of any major move in PPS in the bullish direction. lots of possibilities, maybe someone can code up a center-zero-line, and a distinction of a bearish signal too. Nice work J.A.Trader!

Lower indicator - - - - - -averagetradecountlength = 5, plot > 87

Lower lower indicator - -averagetradecountlength = 17, plot > 25

 
Last edited:
axlerod

axlerod

Member
@Adeodatus Love this a lot actually those buy labels and setup do you mind sharing?

Also I am a bit confused You said you changed it to 13 instead of 50 but then said this "
Lower indicator - - - - - -averagetradecountlength = 5, plot > 87

Lower lower indicator - -averagetradecountlength = 17, plot > 25"

Which doesn't have 13 specifically use 13. So you recommend using specifically 13 or which one do you prefer your Lower or LOWER Lower?
 
Adeodatus

Adeodatus

New member
Yeah, I posted that image either b4 variables changed for the text, or after I wrote the text and change the image. sory. Its a pretty darn good indicator, and being able to set a variety of combinations of variables is what I was trying to show. Of course its lagging, which is to say the indications are after the fact. Its just an indicator!

About the buy and sell bubbles, that too is an indicator and not meant for certain to trigger do this or do that. I think its based off of the MACD so it can repaint and change? Search the BlackFlag indicator, he has a website and I've seen it on useThinkScript as well, and its the same as another strategy listed here too, if i see it or find it someday I'll point you to it.
 
axlerod

axlerod

Member
Yeah, I posted that image either b4 variables changed for the text, or after I wrote the text and change the image. sory. Its a pretty darn good indicator, and being able to set a variety of combinations of variables is what I was trying to show. Of course its lagging, which is to say the indications are after the fact. Its just an indicator!

About the buy and sell bubbles, that too is an indicator and not meant for certain to trigger do this or do that. I think its based off of the MACD so it can repaint and change? Search the BlackFlag indicator, he has a website and I've seen it on useThinkScript as well, and its the same as another strategy listed here too, if i see it or find it someday I'll point you to it.
Awesome appreciate it but that picture you posted. You posted that correct? Could you message me that grid link so i can take a look. Thanks
 
Adeodatus

Adeodatus

New member
Awesome appreciate it but that picture you posted. You posted that correct? Could you message me that grid link so i can take a look. Thanks
Axel, im not sure what your asking. The upper main indicators are a combination of one of the indictors in the BlackFlag swingarm set, a 220 day EMA, and a VWAP. The lower is the indicator from this thread (X2)two times).
 
axlerod

axlerod

Member
Axel, im not sure what your asking. The upper main indicators are a combination of one of the indictors in the BlackFlag swingarm set, a 220 day EMA, and a VWAP. The lower is the indicator from this thread (X2)two times).
Sorry for not being clear, asking specifically that buy label and indicator you have in the picture if you could share the ToS link for that so I could take a look may have a few suggestions on that buy indicator as i am working on something very unique with some interesting variables like AroonOscillator and Momentum but with different lengths etc
 
Adeodatus

Adeodatus

New member
Sorry for not being clear, asking specifically that buy label and indicator you have in the picture if you could share the ToS link for that so I could take a look may have a few suggestions on that buy indicator as i am working on something very unique with some interesting variables like AroonOscillator and Momentum but with different lengths etc

Here is the main link to find more information:

UseThinkScript.com; https://usethinkscript.com/threads/...avity-2nd-derivatives.1803/page-14#post-23080

Here is the totality of the indicator, I only use parts to see "buy" signals.

Please let me know how it goes as your work proceeds. Good Luck!

Code:
# blackFLAG FTS Alerts for SwingArms
# 5-24-2020

# Hull Moving Average Concavity and Turning Points
# or
# The Second Derivative of the Hull Moving Average
#
# Author: Seth Urion (Mahsume)
# Version: 2020-05-01 V4
#
# Now with support for ToS Mobile
#
# This code is licensed (as applicable) under the GPL v3
# UseThinkScript.com
# https://usethinkscript.com/threads/hull-moving-average-turning-points-and-concavity-2nd-derivatives.1803/page-14#post-23080
# ----------------------

# INSTRUCTIONS:
# SETTINGS TO SET UP ALERT NOTIFICATIONS - JAzcarate -
# BUY / SELL CHART ALERTS WITH EMAIL / TEXT
# STUDY NAME: HULL MOVING AVERAGE TURNING POINTS
# 1 MINUTE CHART SETTING 255 period HMA
# 5 MINUTE CHART SETTING 255 period HMA
# 4 Hour CHART SETTING 255 PERIOD HMA

# SELL FROM RESISTANCE - BUY FROM SUPPORT

declare upper;

input price = HL2;
input HMA_Length = 27;
input lookback = 2;

# I read somewhere that it's faster to define nan's and then use the def'd var rather than call double.nan every time.
def nan = double.nan;

plot HMA = HullMovingAvg(price = price, length = HMA_Length);

def delta = HMA[1] - HMA[lookback + 1];
def delta_per_bar = delta / lookback;

def next_bar = HMA[1] + delta_per_bar;

def concavity = if HMA > next_bar then 1 else -1;

plot turning_point = if concavity[1] != concavity then HMA else nan;

HMA.AssignValueColor(color = if concavity[1] == -1 then
if HMA > HMA[1] then color.dark_orange else color.red else
if HMA < HMA[1] then color.dark_green else color.green);

HMA.SetLineWeight(3);

turning_point.SetLineWeight(4);
turning_point.SetPaintingStrategy(paintingStrategy = PaintingStrategy.POINTS);
turning_point.SetDefaultColor(color.white);

plot MA_Max = if HMA[-1] < HMA and HMA > HMA[1] then HMA else NaN;
MA_Max.SetDefaultColor(Color.WHITE);
MA_Max.SetPaintingStrategy(PaintingStrategy.SQUARES);
MA_Max.SetLineWeight(3);

plot MA_Min = if HMA[-1] > HMA and HMA < HMA[1] then HMA else Nan;
MA_Min.SetDefaultColor(Color.WHITE);
MA_Min.SetPaintingStrategy(PaintingStrategy.TRIANGLES);
MA_Min.SetLineWeight(3);

# NOTE: I PREFER TO TURN OFF UP ARROWS WHEN IN DOWN TREND. IF IN DOWNTRENDING SWINGARM, THE TURN ON ONLY DOWN SELL ARROWS. YOU CAN DO THIS USING THE INPUT SETTINGS SCREEN.

plot sell = if turning_point and concavity == -1 then high else nan;
sell.SetDefaultColor(Color.DARK_ORANGE);
sell.SetPaintingStrategy(PaintingStrategy.ARROW_DOWN);
sell.SetLineWeight(3);

plot buy = if turning_point and concavity == 1 then low else nan;
buy.SetDefaultColor(Color.CYAN);
buy.SetPaintingStrategy(PaintingStrategy.ARROW_UP);
buy.SetLineWeight(3);

def divergence = HMA - next_bar;

addLabel(yes, concat("DIVERGENCE: " , divergence), color = if concavity < 0 then if divergence[1] > divergence then Color.RED else color.PINK else if divergence[1] < divergence then color.green else color.yellow);

###################
#
# ALERTS
#
###################

Alert(condition = buy, text = "Buy", "alert type" = Alert.BAR, sound = Sound.Bell);

Alert(condition = sell, text = "Sell", "alert type" = Alert.BAR, sound = Sound.Chimes);

###################
#
# 2020-05-01
#
# MOBILE TOS SUPPORT
#
# Each color of the HMA needs to be a separate plot as ToS Mobile
# lacks the ability to assign colors the way ToS Desktop does.
# I recommend a plain colored HMA behind the line
# Set the line color of the HMA above to gray or some neutral
#
# CCD_D -> ConCave Down and Decreasing
# CCD_I -> ConCave Down and Increasing
# CCU_D -> ConCave Up and Decreasing
# CCU_I -> ConCave Up and Increasing
#
###################
plot CCD_D = if concavity == -1 and HMA < HMA[1] then HMA else nan;
CCD_D.SetDefaultColor(Color.RED);
CCD_D.SetLineWeight(3);

plot CCD_I = if concavity == -1 and HMA >= HMA[1] then HMA else nan;
CCD_I.SetDefaultColor(Color.DARK_ORANGE);
CCD_I.SetLineWeight(3);

plot CCU_D = if concavity == 1 and HMA <= HMA[1] then HMA else nan;
CCU_D.SetDefaultColor(COLOR.DARK_GREEN);
CCU_D.SetLineWeight(3);

plot CCU_I = if concavity == 1 and HMA > HMA[1] then HMA else nan;
CCU_I.SetDefaultColor(COLOR.GREEN);
CCU_I.SetLineWeight(3);

AddChartBubble(MA_MAX == MA_MAX , MA_MAX , "SELL" , Color.RED,no);

AddChartBubble(MA_MIN == MA_MIN , MA_MIN , "BUY" , Color.GREEN, yes);
 
S

sheldonxp

New member
VIP
Is there a volume indicator that can pick up explosive volume before a bar closes? I am thinking something that picks up on abnormal volume on a time frame lower than 1 minute, maybe 10 seconds or something. Perhaps where the volume in those 10 seconds is at least 2x the average over the last 50 bars. I would ultimately want this to be incorporated into a scan, or at least can be used as an alert.
 
H

HighBredCloud

Well-known member
VIP
@justAnotherTrader Does this scanner ONLY search for LONG positions? or is it also searching for SHORTS?
 

Similar threads

Top