Price Volume Anomoly by Anna Coulling for ThinkorSwim

A

Afghan1

New member
Has anyone ever tried creating the script by infamous Anna coulling?

Simply put it utilizes capitulations and only spits out hidden buyers and sellers. few diff variables but when price action is tanking and big volume bar comes in to stop it (hidden buyer etc).

Have been hunting for this code for ages, it does exist have seen few guys at hedge fund use it. would love to know if anyone else has it. the overall objective of script would be to find hidden seller, it just reduces some eye strain from looking at tape.

http://prntscr.com/pm17vu
 
Last edited by a moderator:
G

guga

New member
Try the one below. Adapt as you see fit.

Code:
input OpenTime = 0945;
input CloseTime = 1555;

def active = if SecondsFromTime(OpenTime) >= 0 and
                SecondsTillTime(CloseTime) > 0
                then active[1] + 1
                else 0;

def anomaly1 = if active then (close >= close [1]) and (close[1]>close[2])and (close[2]>close[3])and (close[3]>close[4])and volume > (volume[1]*1.33) else Double.NaN;

def anomaly2 =if active then (close <= close [1]) and (close[1]<close[2])and (close[2]<close[3])and (close[3]>close[4]) and volume > (volume[1]*1.33) else Double.NaN;

plot H = if anomaly1 > 0 then high else Double.NaN;

plot L = if anomaly2 > 0 then low else Double.NaN;

H.SetStyle(Curve.POINTS);
H.SetDefaultColor(Color.red);

L.SetStyle(Curve.POINTS);
L.SetDefaultColor(Color.white);
 
T

tomsk

Well-known member
VIP
@guga while I have not seen any prior studies regarding Anna Couling, I have optimized the logic based on your script using a bunch of boolean constructs. Hope this is helpful

Code:
input OpenTime = 0945;
input CloseTime = 1555;

def active = SecondsFromTime(OpenTime) >= 0 and SecondsTillTime(CloseTime) > 0;
def anomaly1 = active and sum(close > close[1], 5) >= 5 and volume > (volume[1] * 1.33);
def anomaly2 = active and sum(close < close[1], 5) >= 5 and volume > (volume[1] * 1.33);

plot H = if anomaly1 then high else Double.NaN;
plot L = if anomaly2 then low else Double.NaN;

H.SetPaintingStrategy(PaintingStrategy.ARROW_UP);
H.SetPaintingStrategy(PaintingStrategy.ARROW_DOWN);
H.SetDefaultColor(Color.CYAN);
L.SetDefaultColor(Color.YELLOW);
H.SetLineWeight(3);
L.SetLineWeight(3);
 
zeek

zeek

Active member
2019 Donor
Doing some testing today using this indicator on the 5min timeframe and i can definitely see usefulness in this indicator to find hidden buyers/sellers. Very good stuff 👍 Thanks @guga for the code.

Btw, is it possible to add audio alerts as well for the signals?
 
Last edited:
T

tomsk

Well-known member
VIP
@zeek per your request here is the study with alerts for both conditions added in

input OpenTime = 0945;
input CloseTime = 1555;

def active = SecondsFromTime(OpenTime) >= 0 and SecondsTillTime(CloseTime) > 0;
def anomaly1 = active and sum(close > close[1], 5) >= 5 and volume > (volume[1] * 1.33);
def anomaly2 = active and sum(close < close[1], 5) >= 5 and volume > (volume[1] * 1.33);

plot H = if anomaly1 then high else Double.NaN;
plot L = if anomaly2 then low else Double.NaN;

H.SetPaintingStrategy(PaintingStrategy.ARROW_UP);
H.SetPaintingStrategy(PaintingStrategy.ARROW_DOWN);
H.SetDefaultColor(Color.CYAN);
L.SetDefaultColor(Color.YELLOW);
H.SetLineWeight(3);
L.SetLineWeight(3);

# Alerts
Alert(anomaly1, "Price Volume Anomaly - High", Alert.BAR, Sound.RING);
Alert(anomaly2, "Price Volume Anomaly - Low", Alert.BAR, Sound.DING);
 
G

guga

New member
I have updated the code to fine tune it to pick anomalies on 5-min charts. So far it works very well in pick reversals spots. Let me know what you guys find out.
Also, I'm told that TOS scanning is delays by around 3-min, is this true? if yes, does anyone know if it's possible to improve it? Thanks

Code:
input OpenTime = 0945;
input CloseTime = 1555;



def active = if SecondsFromTime(OpenTime) >= 0 and
                SecondsTillTime(CloseTime) > 0
                then active[1] + 1
                else 0;

def anomaly1 = if active then (close < hl2) and (close > open) and volume > (volume[1]*1.5) else Double.NaN;

def anomaly2 =if active then (close > hl2)and (close < open)and volume > (volume[1]*1.5) else Double.NaN;

plot H = if anomaly1 > 0 then high else Double.NaN;

plot L = if anomaly2 > 0 then low else Double.NaN;



H.SetStyle(Curve.POINTS);
H.SetDefaultColor(Color.red);

L.SetStyle(Curve.POINTS);
L.SetDefaultColor(Color.white);

# Alerts
Alert(anomaly1, "Price Volume Anomaly - High", Alert.BAR, Sound.RING);
Alert(anomaly2, "Price Volume Anomaly - Low", Alert.BAR, Sound.DING);
 
BenTen

BenTen

Administrative
Staff
VIP
@guga If you save the scanner as a watchlist then there is 3-5 mins delay.
 
G

guga

New member
Thanks Ben. is there a way to have it real-time or reduced delay?
 
BenTen

BenTen

Administrative
Staff
VIP
@guga Not that I know of. You would have to click the Scan button whenever you want real-time result.
 
T

tomsk

Well-known member
VIP
I have updated the code to fine tune it to pick anomalies on 5-min charts. So far it works very well in pick reversals spots. Let me know what you guys find out.
Also, I'm told that TOS scanning is delays by around 3-min, is this true? if yes, does anyone know if it's possible to improve it? Thanks

Code:
input OpenTime = 0945;
input CloseTime = 1555;



def active = if SecondsFromTime(OpenTime) >= 0 and
                SecondsTillTime(CloseTime) > 0
                then active[1] + 1
                else 0;

def anomaly1 = if active then (close < hl2) and (close > open) and volume > (volume[1]*1.5) else Double.NaN;

def anomaly2 =if active then (close > hl2)and (close < open)and volume > (volume[1]*1.5) else Double.NaN;

plot H = if anomaly1 > 0 then high else Double.NaN;

plot L = if anomaly2 > 0 then low else Double.NaN;



H.SetStyle(Curve.POINTS);
H.SetDefaultColor(Color.red);

L.SetStyle(Curve.POINTS);
L.SetDefaultColor(Color.white);

# Alerts
Alert(anomaly1, "Price Volume Anomaly - High", Alert.BAR, Sound.RING);
Alert(anomaly2, "Price Volume Anomaly - Low", Alert.BAR, Sound.DING);

@guga Just a minor point in your revised code, the variable "active" is intended to flag a bracketed time period.
It is a boolean expression which evaluates to true or false. Hence you don't need to increment the variable.

Code:
def active = if SecondsFromTime(OpenTime) >= 0 and
                SecondsTillTime(CloseTime) > 0
                then active[1] + 1
                else 0;

Just use the definition of "active" I gave you earlier.
 
G

guga

New member
@guga Just a minor point in your revised code, the variable "active" is intended to flag a bracketed time period.
It is a boolean expression which evaluates to true or false. Hence you don't need to increment the variable.

Code:
def active = if SecondsFromTime(OpenTime) >= 0 and
                SecondsTillTime(CloseTime) > 0
                then active[1] + 1
                else 0;

Just use the definition of "active" I gave you earlier.
Hi Tom - sorry, but i didn't quite get what you meant by using the 'active' definition...
 
T

tomsk

Well-known member
VIP
You want your condition to trigger only between the hours from 0945 - 1555
The way to do this is via the variable "active" which should evaluate to either true or false
True = 1, false = 0
Hence no need to increment the value of "active" like in your case.
 
D

DeusMecanicus

Member
@zeek per your request here is the study with alerts for both conditions added in

input OpenTime = 0945;
input CloseTime = 1555;

def active = SecondsFromTime(OpenTime) >= 0 and SecondsTillTime(CloseTime) > 0;
def anomaly1 = active and sum(close > close[1], 5) >= 5 and volume > (volume[1] * 1.33);
def anomaly2 = active and sum(close < close[1], 5) >= 5 and volume > (volume[1] * 1.33);

plot H = if anomaly1 then high else Double.NaN;
plot L = if anomaly2 then low else Double.NaN;

H.SetPaintingStrategy(PaintingStrategy.ARROW_UP);
H.SetPaintingStrategy(PaintingStrategy.ARROW_DOWN);
H.SetDefaultColor(Color.CYAN);
L.SetDefaultColor(Color.YELLOW);
H.SetLineWeight(3);
L.SetLineWeight(3);

# Alerts
Alert(anomaly1, "Price Volume Anomaly - High", Alert.BAR, Sound.RING);
Alert(anomaly2, "Price Volume Anomaly - Low", Alert.BAR, Sound.DING);
H.SetPaintingStrategy(PaintingStrategy.ARROW_DOWN);

Shoudn't this one be
L.SetPaintingStrategy(PaintingStrategy.ARROW_DOWN);
 
zeek

zeek

Active member
2019 Donor
Now i am confused, is the updated code from @guga in post #9 the correct one or should i continue to use the older one?
 
S

skynetgen

Well-known member
I have updated the code to fine tune it to pick anomalies on 5-min charts. So far it works very well in pick reversals spots. Let me know what you guys find out.
Also, I'm told that TOS scanning is delays by around 3-min, is this true? if yes, does anyone know if it's possible to improve it? Thanks
No . Some times it lags but it pretty close to real time most of the time
 
T

tomsk

Well-known member
VIP
Now i am confused, is the updated code from @guga in post #9 the correct one or should i continue to use the older one?

@zeek it all really depends on what you're looking for. Here is the section of code I modified

def active = SecondsFromTime(OpenTime) >= 0 and SecondsTillTime(CloseTime) > 0;
def anomaly1 = active and sum(close > close[1], 5) >= 5 and volume > (volume[1] * 1.33);
def anomaly2 = active and sum(close < close[1], 5) >= 5 and volume > (volume[1] * 1.33);

Anomaly1 essentially is looking for a 33% increase in volume with 5 preceding bullish closes while anomaly2 just addresses the similar condition for the bearish case. At the end of the day it depends on what you're looking for. It's all math and logic.
 

Similar threads

Top