Anna Coulling Volume Price Analysis For ThinkOrSwim

Trying to debug an anomaly in this script where a cyan bar(up3) is being printed even though its not exceeding the volAvg.
Code:
def up3 = if IR_BODYG and (Vol > VolAvg) then 1 else 0;
anna4.jpg


Any ideas?
I found the source of this bug - the color assignment doesn't have a case where it handles doji candles, so it falls through to coloring them as GetColor(1). On a dark chart, GetColor(1) is COLOR.CYAN, which is the same color used for UP3.

The below code colors them YELLOW instead and also has a mod to allow for user selectable average type and length to use for volume. The original indicator was using a 12 period exponential average.

Ruby:
AddLabel(yes, "Day_volume: " + volume (period = "DAY" ), Color.LIGHT_GRAY);
AddLabel(yes, "volume: " + volume, Color.white);

declare lower;
declare zerobase;

input averageType = averagetype.Exponential;
input averageLength = 12;

plot Vol = volume;
plot VolAvg = MovingAverage(averageType,volume,averageLength);
VolAvg .SetPaintingStrategy(PaintingStrategy.squared_HISTOGRAM);
VolAvg .SetDefaultColor(Color.GRAY);
def BODY_RANGE = max(oPEN,cLOSE) - min(oPEN,cLOSE);
plot IR_BODY = if BODY_RANGE < BODY_RANGE[1] and volume > volume[1] then 1 else 0 ;
def IR_BODYG  = if IR_BODY and close>open then 1 else 0;
def IR_BODYR  = if IR_BODY and close<open then 1 else 0;

Vol.SetPaintingStrategy(PaintingStrategy.HISTOGRAM);
Vol.SetLineWeight(3);
Vol.DefineColor("Up", Color.green);
Vol.DefineColor("Down", Color.red);
Vol.DefineColor("Up2", Color.light_green);
Vol.DefineColor("Down2", Color.dark_ORANGE );
Vol.DefineColor("Up3", Color.cyan);
Vol.DefineColor("Up4", Color.blue);
Vol.DefineColor("Down3", Color.mAGENTA );
Vol.DefineColor("Down4", Color.plum );


Vol.AssignValueColor(
if close > open and IR_BODYG and Vol >VolAvg  then Vol.color("Up3") else if

close > open and IR_BODYG  then Vol.color("Up4")

else if close < open and IR_BODYR and Vol >VolAvg then Vol.color("Down3")

else if close < open and IR_BODYR then Vol.color("Down4")

else if close > open and Vol >VolAvg  then Vol.color("Up")

else if close < open and Vol >VolAvg then Vol.color("Down")

else if close > open then Vol.color("Up2")

else if close < open then Vol.color("Down2")

else color.yellow);



input paintBars = yes;

DefineGlobalColor("CAM_UP", Color.GREEN);
DefineGlobalColor("CAM_UP2", Color.liGHT_GREEN);
DefineGlobalColor("CAM_UP3", Color.cyan);
DefineGlobalColor("CAM_UP4", Color.blue);

DefineGlobalColor("CAM_DN", Color.RED);
DefineGlobalColor("CAM_DN2", Color.darK_ORANGE );
DefineGlobalColor("CAM_DN3", Color.mAGENTA );
DefineGlobalColor("CAM_DN4", Color.plum );
AssignPriceColor(if !paintBars then Color.CURRENT

else if close > open and IR_BODYG and Vol >VolAvg then GlobalColor("CAM_UP3")
else if close < open and IR_BODYR and Vol >VolAvg then GlobalColor("CAM_DN3")

else if close > open and IR_BODYG then GlobalColor("CAM_UP4")
else if close < open and IR_BODYR then GlobalColor("CAM_DN4")

else if close > open and Vol >VolAvg then GlobalColor("CAM_UP")
else if close < open and Vol >VolAvg then GlobalColor("CAM_DN")

else if close > open then GlobalColor("CAM_UP2")
else if close < open then GlobalColor("CAM_DN2")

else Color.CURRENT);

 

Join useThinkScript to post your question to a community of 21,000+ developers and traders.

@bigboss Thank you for catching that!
Here is the latest mods to that script which includes options for either bull/bear signals or reversal signals(based off all cyan or magenta bars that exceed vol avg and followed by opposing volume to the bar prior).
The way buy/sell volume is calculated has been changed as well.

Update: Latest version 3.0 posted here(see script notes for update details).

Code:
# Original script by Cwparker23
# Mods/additions by Tidan
# Updates:
#    Further reduced redundancy
#    Reconfigured reversal signals to include magenta bars and set default mode to reversal
#    Restructured how bull/bear volume bars are recognized
#    Added option to use original buy/sell volume calculation or new method
#    Removed bull/bear option and signals
# v3


#hint: The indicator finds irregular bodies based on candle size and volume, it colors price to indicate irregular bodies below volume average (blue bullish and plum bearish) and indicate irregular bodies above-average volume (cyan bullish and magenta bearish). Also colors price with above-average volume (green bullish and red bearish) and below-average volume (light green bullish and orange bearish). \n As confirmation watch TMO(trueMomentumOsc), it should be above zero for entering short and below zero for entering long.\n\n<b>Note: </b>To view aggregations higher than daily comment out the two "AddLabel" lines by prefixing them with a "#" sign.


input showReversalSignals = yes;
input reversalFilter = yes;
input showLabels = no;
input paintBars = no;
input volAvgLength = 12; #default 12
input volAvgType = averageType.exponential; #default exponential
input useOriginalVolCalc = no;

def revSig = showReversalSignals;
def revFil = reversalFilter;


####
# new method to determine buying/selling volume
#def buying = Round(volume * (close - low) / (high - low), 0);
#def selling = Round(volume * (high - close) / (high - low), 0);

def buying;
def selling;
if useOriginalVolCalc
{
    buying = if close > open then 1 else 0;
    selling = if close < open then 1 else 0;
}
else
{
    buying = Round(volume * (close - low) / (high - low), 0);
    selling = Round(volume * (high - close) / (high - low), 0);
}
####

# Note: to view on time frames higher than Daily comment out these two AddLabel lines
AddLabel(showLabels, "Day_volume: " + volume (period = "DAY" ), Color.LIGHT_GRAY);
AddLabel(showLabels, "volume: " + volume, Color.white);

declare lower;
declare zerobase;

plot Vol = volume;
plot VolAvg = movingAverage(volAvgType,volume,volAvgLength);
VolAvg .SetPaintingStrategy(PaintingStrategy.squared_HISTOGRAM);
VolAvg .SetDefaultColor(Color.GRAY);
def BODY_RANGE = max(open,close) - min(open,close);
def IR_BODY = if (BODY_RANGE < BODY_RANGE[1]) and (volume > volume[1]) then 1 else 0 ;
def IR_BODYG  = if IR_BODY and buying > selling then 1 else 0;
def IR_BODYR  = if IR_BODY and buying < selling then 1 else 0;

####
# new method to determine vol bar properties
def up3 = if IR_BODYG and (Vol > VolAvg) then 1 else 0;
def up4 = if IR_BODYG then 1 else 0;
def down3 = if IR_BODYR and (Vol > VolAvg) then 1 else 0;
def down4 = if IR_BODYR then 1 else 0;
def up = if (buying > selling) and (Vol > VolAvg)  then 1 else 0;
def down = if (buying < selling) and (Vol > VolAvg) then 1 else 0;
def up2 = if (buying > selling) then 1 else 0;
def down2 = if (buying < selling) then 1 else 0;
####

Vol.SetPaintingStrategy(PaintingStrategy.HISTOGRAM);
Vol.SetLineWeight(3);
Vol.DefineColor("Up", Color.green);
Vol.DefineColor("Down", Color.red);
Vol.DefineColor("Up2", Color.light_green);
Vol.DefineColor("Down2", Color.dark_ORANGE );
Vol.DefineColor("Up3", Color.cyan);
Vol.DefineColor("Up4", Color.blue);
Vol.DefineColor("Down3", Color.mAGENTA );
Vol.DefineColor("Down4", Color.plum );

Vol.AssignValueColor(
    if up3 then Vol.color("Up3")
    else if up4  then Vol.color("Up4")
    else if down3 then Vol.color("Down3")
    else if down4 then Vol.color("Down4")
    else if up  then Vol.color("Up")
    else if down then Vol.color("Down")
    else if up2 then Vol.color("Up2")
    else if down2 then Vol.color("Down2")
    else color.white);




DefineGlobalColor("CAM_UP", Color.GREEN);
DefineGlobalColor("CAM_UP2", Color.liGHT_GREEN);
DefineGlobalColor("CAM_UP3", Color.cyan);
DefineGlobalColor("CAM_UP4", Color.blue);
DefineGlobalColor("CAM_DN", Color.RED);
DefineGlobalColor("CAM_DN2", Color.darK_ORANGE );
DefineGlobalColor("CAM_DN3", Color.mAGENTA );
DefineGlobalColor("CAM_DN4", Color.plum );

AssignPriceColor(
    if !paintBars then Color.CURRENT
    else if up3 then GlobalColor("CAM_UP3")
    else if down3 then GlobalColor("CAM_DN3")
    else if up4 then GlobalColor("CAM_UP4")
    else if down4 then GlobalColor("CAM_DN4")
    else if up then GlobalColor("CAM_UP")
    else if down then GlobalColor("CAM_DN")
    else if up2 then GlobalColor("CAM_UP2")
    else if down2 then GlobalColor("CAM_DN2")
    else Color.CURRENT);



# reversal signal set up
def pastUp = if up[2] or up2[2] or up3[2] or up4[2] then 1 else 0;
def pastDn = if down[2] or down2[2] or down3[2] or down4[2] then 1 else 0;
def currUp = if up or up2 or up3 or up4 then 1 else 0;
def currDn = if down or down2 or down3 or down4 then 1 else 0;
def trigger = if (pastUp and currUp) or (pastDn and currDn) then 0 else 1;

# cyan reversal
addVerticalLine(revSig and revFil and up3[1] and trigger,"",if(currUp) then color.light_green else if (currDn) then color.dark_orange else color.gray,curve.short_dash);
addVerticalLine(revSig and !revFil and up3[1],"",if(currUp) then color.light_green else if (currDn) then color.dark_orange else color.gray,curve.short_dash);
# magenta reversal
addVerticalLine(revSig and revFil and down3[1] and trigger,"",if(currUp) then color.light_green else if (currDn) then color.dark_orange else color.gray,curve.short_dash);
addVerticalLine(revSig and !revFil and down3[1],"",if(currUp) then color.light_green else if (currDn) then color.dark_orange else color.gray,curve.short_dash);

# end of script
 
Last edited by a moderator:
I love to see how everyone is finding different ways to use the indicator and it's drawbacks and fixes. Keep up the great work!
 
While I understand the key code, Im struggling to get the difference between lets say, cyan and dark green (both above avg vol bullish), magenta and red (above average volume bearish), orange and plum (below avg volume, bearish), etc...Any help? @Tidan @charlie2598 @Cwparker23
 
While I understand the key code, Im struggling to get the difference between lets say, cyan and dark green (both above avg vol bullish), magenta and red (above average volume bearish), orange and plum (below avg volume, bearish), etc...Any help? @Tidan @charlie2598 @Cwparker23
You can click the question mark next to the study after you add it to TOS or you can read the #hint comments in the source code.
The colors change relative to candle size and volume.
 
Here's an interesting way to look at the irregular (cyan and magenta) candles. This script plots arrows on the upper chart as buy and sell signals for the irregular candles. It also has an option to do higher timeframe candles in two ways - using standard higher timeframe aggregation (with all the downsides like repainting that come with that), but also using a rolling period to construct aggregate candles of a user configurable period, in a way that will not repaint.

Code:
# VPA IRREGULAR ARROWS WITH ALTERNATE TIMEFRAME OPTIONS
# VERSION 1.0
# by bigboss
#
# Modified from https://usethinkscript.com/threads/anna-coulling-volume-price-analysis-for-thinkorswim.8882/post-86921
# This plots the irregular buy and sell volume candles as arrows
#
# Added an option to do multi timeframe analysis in two ways
# 1. The first way is simply using a higher timeframe aggregation.
#    This can be useful if you want to see the 5 min irregular candles
#    on a 1 min chart, for instance. It repaints, and will flicker on
#    and off until the 5 minute period so be aware.
#
# 2. The second way is a little more novel, and much more interesting.
#    It constructs a higher timeframe candle by looking at the open, high,
#    low, close, and volume of the previous X bars. On a 1 minute chart with
#    a rolling length of 5, it will take the last 5 bars and merge them together
#    as if they were one 5 minute candle, then evaluates the aggregate candle for irregular
#    body shape, and volume against the prior rollingLength period.


input volavgtype = averagetype.exponential;
input volavglength = 12;
input AggregationMode = {none, period, default rolling};
input period = aggregationPeriod.FIVE_MIN;
input rollingLength = 5;

def v;
def o;
def h;
def l;
def c;
def vaLength;
def vOffset;

switch(AggregationMode){
    case none:
        v = volume;
        o = open;
        h = high;
        l = low;
        c = close;
        vaLength = volAvglength;
        vOffset = 1;
    case period:
        v = volume(period=period);
        o = open(period=period);
        h = high(period=period);
        l = low(period=period);
        c = close(period=period);
        vaLength = volAvglength;
        vOffset = 1;
    case rolling:
        v = sum(volume,rollingLength);
        o = open[rollingLength-1];
        h = highest(high,rollingLength);
        l = lowest(low,rollingLength);
        c = close;
        vaLength = volAvgLength * rollingLength;
        vOffset = rollingLength;
}

def VolAvg = movingAverage(volAvgType,v,vaLength);
def buying = Round(v * (c - l) / (h - l), 0);
def selling = Round(v * (h - c) / (h - l), 0);


def BODY_RANGE = max(o,c) - min(o,c);
def IR_BODY = if (BODY_RANGE < BODY_RANGE[vOffset]) and (v > v[vOffset]) then 1 else 0 ;
def IR_BODYG  = if IR_BODY and buying > selling then 1 else 0;
def IR_BODYR  = if IR_BODY and buying < selling then 1 else 0;

def up3 = if IR_BODYG and (v > VolAvg) then 1 else 0;
def down3 = if IR_BODYR and (v > VolAvg) then 1 else 0;

plot buyarrow = up3;
buyarrow.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);
buyarrow.setdefaultColor(color.cyan);
plot sellarrow = down3;
sellarrow.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);
sellarrow.setdefaultColor(color.magenta);
 
Here's an interesting way to look at the irregular (cyan and magenta) candles. This script plots arrows on the upper chart as buy and sell signals for the irregular candles. It also has an option to do higher timeframe candles in two ways - using standard higher timeframe aggregation (with all the downsides like repainting that come with that), but also using a rolling period to construct aggregate candles of a user configurable period, in a way that will not repaint.

Code:
# VPA IRREGULAR ARROWS WITH ALTERNATE TIMEFRAME OPTIONS
# VERSION 1.0
# by bigboss
#
# Modified from https://usethinkscript.com/threads/anna-coulling-volume-price-analysis-for-thinkorswim.8882/post-86921
# This plots the irregular buy and sell volume candles as arrows
#
# Added an option to do multi timeframe analysis in two ways
# 1. The first way is simply using a higher timeframe aggregation.
#    This can be useful if you want to see the 5 min irregular candles
#    on a 1 min chart, for instance. It repaints, and will flicker on
#    and off until the 5 minute period so be aware.
#
# 2. The second way is a little more novel, and much more interesting.
#    It constructs a higher timeframe candle by looking at the open, high,
#    low, close, and volume of the previous X bars. On a 1 minute chart with
#    a rolling length of 5, it will take the last 5 bars and merge them together
#    as if they were one 5 minute candle, then evaluates the aggregate candle for irregular
#    body shape, and volume against the prior rollingLength period.


input volavgtype = averagetype.exponential;
input volavglength = 12;
input AggregationMode = {none, period, default rolling};
input period = aggregationPeriod.FIVE_MIN;
input rollingLength = 5;

def v;
def o;
def h;
def l;
def c;
def vaLength;
def vOffset;

switch(AggregationMode){
    case none:
        v = volume;
        o = open;
        h = high;
        l = low;
        c = close;
        vaLength = volAvglength;
        vOffset = 1;
    case period:
        v = volume(period=period);
        o = open(period=period);
        h = high(period=period);
        l = low(period=period);
        c = close(period=period);
        vaLength = volAvglength;
        vOffset = 1;
    case rolling:
        v = sum(volume,rollingLength);
        o = open[rollingLength-1];
        h = highest(high,rollingLength);
        l = lowest(low,rollingLength);
        c = close;
        vaLength = volAvgLength * rollingLength;
        vOffset = rollingLength;
}

def VolAvg = movingAverage(volAvgType,v,vaLength);
def buying = Round(v * (c - l) / (h - l), 0);
def selling = Round(v * (h - c) / (h - l), 0);


def BODY_RANGE = max(o,c) - min(o,c);
def IR_BODY = if (BODY_RANGE < BODY_RANGE[vOffset]) and (v > v[vOffset]) then 1 else 0 ;
def IR_BODYG  = if IR_BODY and buying > selling then 1 else 0;
def IR_BODYR  = if IR_BODY and buying < selling then 1 else 0;

def up3 = if IR_BODYG and (v > VolAvg) then 1 else 0;
def down3 = if IR_BODYR and (v > VolAvg) then 1 else 0;

plot buyarrow = up3;
buyarrow.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);
buyarrow.setdefaultColor(color.cyan);
plot sellarrow = down3;
sellarrow.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);
sellarrow.setdefaultColor(color.magenta);


Somtheing like this might help with the excess candles printing:
Code:
plot buyarrow = if !up3[1] then up3 else double.nan;

plot sellarrow = if !down3[1] then down3 else double.nan;
 
@Tidan I know it's been a couple months since anyone commented on this indicator but I had just started reading Anna Coulling's works. I was excited to see this indicator for TOS as she does not provide one.
On my chart, I'm not seeing the arrow alerts as I've seen in other pictures on this post. I'm not finding any input for it. Does this include a setting for showing those alert arrows or is this from something else? Thanks.
 
@Tidan I know it's been a couple months since anyone commented on this indicator but I had just started reading Anna Coulling's works. I was excited to see this indicator for TOS as she does not provide one.
On my chart, I'm not seeing the arrow alerts as I've seen in other pictures on this post. I'm not finding any input for it. Does this include a setting for showing those alert arrows or is this from something else? Thanks.
You didn't provide enough information to say where you went astray.

Here is an example chart, using the FIRST script from post#8:
https://usethinkscript.com/threads/...ice-analysis-for-thinkorswim.8882/#post-82520
(the 2nd script is a strategy and won't work in the study tab)

Make sure that you are using it in the "lower chart" area not the "volume chart"
There are no 'arrows' this version uses vertical lines as signals.
There are lots of signals:
oUzURfi.png
 
I was trying this on GBP/USD and it was not showing anything. I switched back to SPY and now everything is showing up. Lots of arrows, now to filter the best ones. Any suggestions for that? Thanks for your support.
 
I was trying this on GBP/USD and it was not showing anything. I switched back to SPY and now everything is showing up. Lots of arrows, now to filter the best ones. Any suggestions for that? Thanks for your support.
Volume indicators can only be used on instruments that have volume.
When troubleshooting ToS issues, the explanation point symbol in the upper left-hand corner of the chart can be clicked on for more information.
In this case, it provides a pop-up that states:
Volume is hidden as some bars int are equal to zero.
y2waY9g.png
 
Last edited:
I tend to wait for the next bar to close. If price is divergence with disparity index then I take the trade.
I copied your formula from 12/12/21 and I am trying to distinguish between what is happening between up 1-2-3. To me, they all sound the same. I must not be reading the code properly. Many thanks for your help.
 
I copied your formula from 12/12/21 and I am trying to distinguish between what is happening between up 1-2-3. To me, they all sound the same. I must not be reading the code properly. Many thanks for your help.
The formula evaluates volume relative to its moving average and to the range of each candle on the price chart.
 
The formula evaluates volume relative to its moving average and to the range of each candle on the price chart.
Hi Tidan, can you share what indicator you are using in the #22 chart that is predicting reversals in the upper chart ?
 
Hi Tidan, can you share what indicator you are using in the #22 chart that is predicting reversals in the upper chart ?

The disparity index I use is one I customized to include Bollinger bands, but you can use the factory one that is available in TOS.
When I see a cyan or magenta bar on the Anna Coulling VPA I check to see if the price is in divergence with the disparity index indicator.
 
# Original script by Cwparker23 # Mods/additions by Tidan # Updates: # Further reduced redundancy # # v2.1 #hint: The indicator finds irregular bodies based on candle size and volume it colors price to indicate irregular bodies below volume average (blue bullish and plum bearish) and indicate bodies above-average volume (cyan bullish and magenta bearish). Also colors price with above-average volume (green bullish and red bearish) and below-average volume (light green bullish and orange bearish). input multiplier = 2; input allowOpposingVolume = yes; AddLabel(yes, "Day_volume: " + volume (period = "DAY" ), Color.LIGHT_GRAY); AddLabel(yes, "volume: " + volume, Color.white); declare lower; declare zerobase; plot Vol = volume; plot VolAvg = expAverage(volume); VolAvg .SetPaintingStrategy(PaintingStrategy.squared_HISTOGRAM); VolAvg .SetDefaultColor(Color.GRAY); def BODY_RANGE = max(oPEN,cLOSE) - min(oPEN,cLOSE); def IR_BODY = if (BODY_RANGE < BODY_RANGE[1]) and (volume > volume[1]) then 1 else 0 ; def IR_BODYG = if IR_BODY and (close > open) then 1 else 0; def IR_BODYR = if IR_BODY and (close < open) then 1 else 0; #### def up3 = if IR_BODYG and (Vol > VolAvg) then 1 else 0; def up4 = if IR_BODYG then 1 else 0; def down3 = if IR_BODYR and (Vol > VolAvg) then 1 else 0; def down4 = if IR_BODYR then 1 else 0; def up = if (close > open) and (Vol > VolAvg) then 1 else 0; def down = if (close < open) and (Vol > VolAvg) then 1 else 0; def up2 = if (close > open) then 1 else 0; def down2 = if (close < open) then 1 else 0; #### Vol.SetPaintingStrategy(PaintingStrategy.HISTOGRAM); Vol.SetLineWeight(3); Vol.DefineColor("Up", Color.green); Vol.DefineColor("Down", Color.red); Vol.DefineColor("Up2", Color.light_green); Vol.DefineColor("Down2", Color.dark_ORANGE ); Vol.DefineColor("Up3", Color.cyan); Vol.DefineColor("Up4", Color.blue); Vol.DefineColor("Down3", Color.mAGENTA ); Vol.DefineColor("Down4", Color.plum ); Vol.AssignValueColor( if up3 then Vol.color("Up3") else if up4 then Vol.color("Up4") else if down3 then Vol.color("Down3") else if down4 then Vol.color("Down4") else if up then Vol.color("Up") else if down then Vol.color("Down") else if up2 then Vol.color("Up2") else if down2 then Vol.color("Down2") else GetColor(1)); input paintBars = yes; DefineGlobalColor("CAM_UP", Color.GREEN); DefineGlobalColor("CAM_UP2", Color.liGHT_GREEN); DefineGlobalColor("CAM_UP3", Color.cyan); DefineGlobalColor("CAM_UP4", Color.blue); DefineGlobalColor("CAM_DN", Color.RED); DefineGlobalColor("CAM_DN2", Color.darK_ORANGE ); DefineGlobalColor("CAM_DN3", Color.mAGENTA ); DefineGlobalColor("CAM_DN4", Color.plum ); AssignPriceColor( if !paintBars then Color.CURRENT else if up3 then GlobalColor("CAM_UP3") else if down3 then GlobalColor("CAM_DN3") else if up4 then GlobalColor("CAM_UP4") else if down4 then GlobalColor("CAM_DN4") else if up then GlobalColor("CAM_UP") else if down then GlobalColor("CAM_DN") else if up2 then GlobalColor("CAM_UP2") else if down2 then GlobalColor("CAM_DN2") else Color.CURRENT); def bull = if up3 and vol >= (volAvg * multiplier) and (up3[-1] or up4[-1] or up[-1] or up2[-1]) then yes else if allowOpposingVolume and down3 and (vol >= (volAvg * multiplier)) and (up3[-1] or up4[-1] or up[-1] or up2[-1]) then yes else double.nan; def bear = if down3 and vol >= (volAvg * multiplier) and (down3[-1] or down4[-1] or down[-1] or down2[-1]) then yes else if allowOpposingVolume and up3 and (vol >= (volAvg * multiplier)) and (down3[-1] or down4[-1] or down[-1] or down2[-1]) then yes else double.nan; addVerticalLine(bull[1],"bull",color.green,curve.short_dash); addverticalLine(bear[1],"bear",color.red,curve.short_dash); # end of script
Hi bro Tidan, thank you so much for this! The below signal works well, please could you advise the "logic" behind and it would be very much appreciated! Thanks in advance. Cheers

def bull =
if up3 and vol >= (volAvg * multiplier) and (up3[-1] or up4[-1] or up[-1] or up2[-1]) then yes
else if allowOpposingVolume and down3 and (vol >= (volAvg * multiplier)) and (up3[-1] or up4[-1] or up[-1] or up2[-1]) then yes
else double.nan;
def bear =
if down3 and vol >= (volAvg * multiplier) and (down3[-1] or down4[-1] or down[-1] or down2[-1]) then yes
else if allowOpposingVolume and up3 and (vol >= (volAvg * multiplier)) and (down3[-1] or down4[-1] or down[-1] or down2[-1]) then yes
else double.nan;
 
Hi bro Tidan, thank you so much for this! The below signal works well, please could you advise the "logic" behind and it would be very much appreciated! Thanks in advance. Cheers

def bull =
if up3 and vol >= (volAvg * multiplier) and (up3[-1] or up4[-1] or up[-1] or up2[-1]) then yes
else if allowOpposingVolume and down3 and (vol >= (volAvg * multiplier)) and (up3[-1] or up4[-1] or up[-1] or up2[-1]) then yes
else double.nan;
def bear =
if down3 and vol >= (volAvg * multiplier) and (down3[-1] or down4[-1] or down[-1] or down2[-1]) then yes
else if allowOpposingVolume and up3 and (vol >= (volAvg * multiplier)) and (down3[-1] or down4[-1] or down[-1] or down2[-1]) then yes
else double.nan;
It's largely based on Anna Coulling's volume price analysis. Clicking the question mark next to the study will give you more details.
 

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

87k+ Posts
359 Online
Create Post

The Market Trading Game Changer

Join 2,500+ subscribers inside the useThinkScript VIP Membership Club
  • Exclusive indicators
  • Proven strategies & setups
  • Private Discord community
  • ‘Buy The Dip’ signal alerts
  • Exclusive members-only content
  • Add-ons and resources
  • 1 full year of unlimited support

Frequently Asked Questions

What is useThinkScript?

useThinkScript is the #1 community of stock market investors using indicators and other tools to power their trading strategies. Traders of all skill levels use our forums to learn about scripting and indicators, help each other, and discover new ways to gain an edge in the markets.

How do I get started?

We get it. Our forum can be intimidating, if not overwhelming. With thousands of topics, tens of thousands of posts, our community has created an incredibly deep knowledge base for stock traders. No one can ever exhaust every resource provided on our site.

If you are new, or just looking for guidance, here are some helpful links to get you started.

What are the benefits of VIP Membership?
VIP members get exclusive access to these proven and tested premium indicators: Buy the Dip, Advanced Market Moves 2.0, Take Profit, and Volatility Trading Range. In addition, VIP members get access to over 50 VIP-only custom indicators, add-ons, and strategies, private VIP-only forums, private Discord channel to discuss trades and strategies in real-time, customer support, trade alerts, and much more. Learn all about VIP membership here.
How can I access the premium indicators?
To access the premium indicators, which are plug and play ready, sign up for VIP membership here.
Back
Top