I request combining 3 indicators into 1 paintbar study

Status
Not open for further replies.

hockeycoachdoug

Active member
2019 Donor
VIP
I watched a webinar awhile back that made the premise that combining a trend based indicator, a momentum based indicator and a cycle based indicator gives a good indication of directional bias. I would like to combine these 3 components into one paintbar type indicator and am hoping one of you coding pros might find value in this and be willing to code it here for the community.
For the trend indicator I want to use supertrend available here by Mobius. Here is the link SuperTrend by Mobius
For the momentum indicator I want to use True Momentum Oscillator (TMO). Here is the link TMO for TOS
For the cycle indicator I want to use TOP Cycle Trader. I am posting the code for this indicator here-

Code:
declare lower;
#plot Data = close;
input   FastCycleLength = 5;
input   SlowCycleLength = 8;
#def   CycleLineColor=DefineGlobalColor(Color.RED);
#input   CycleHistColor=Color.BLUE;
#input   ZeroLineColor1 = GetColor(1);
DefineGlobalColor("CycleLineColor", Color.RED);
DefineGlobalColor("CyclehistColor", Color.BLUE);
DefineGlobalColor("ZeroLineColor", Color.YELLOW);
def H = high;
def L = low;
#def FastVar(0),SlowVar(0),DiffVar(0);

def FastVar = ExpAverage((H + L) / 2, FastCycleLength);
def SlowVar = Average((H + L) / 2, SlowCycleLength);
def DiffVar = FastVar - SlowVar;

plot pDiffVar = DiffVar;
pDiffVar.SetDefaultColor(GlobalColor("CycleLineColor"));
plot pDiffVar2 = DiffVar;
pDiffVar2.SetDefaultColor(GlobalColor("CycleHistColor"));
plot pZeroLine = 0;
pZeroLine.SetDefaultColor(GlobalColor("ZeroLineColor"));
#Plot1(DiffVar,"Cycle",CycleLineColor);
#Plot2(DiffVar,"CycleHist",CycleHistColor);
#Plot3(0    ,"Zero",ZeroLineColor);

Here is how I envision the paintbar working-
When the supertrend indicator is long that would equal +1, when its short -1.
When the TMO is green that would equal +1. when its red its -1.
When the TOP Cycle Trader is above zero that would equal +1, when its below zero -1.
When all 3 indicators are equal to +1 making +3 total the price bars would paint green.
When all 3 indicators are equal to -1 making -3 total the price bars would paint red.
If the combination of all 3 indicators equals anything else, the price bars would paint gray meaning all 3 indicators were not in agreement.

I am open to any and all suggestions. I considered MACD for the momentum indicator but thought TMO was better. Considered Doncian channel for trend but thought supertrend was better. I am hoping one of you coders out there find this idea worthy of putting in the effort to code and share with us here.

I also want to create a scan/ watchlist using this where I can add a number of stock symbols to a watchlist and have the following columns showing symbol, color of bar on a daily basis (or long term) (red, green, or gray), color of bar on a 15 or 30 minute basis (short term)(red, green, or gray, and a column showing average volatility for some period of bars to use as a sort column to find the symbols that are moving.

I want to use this in 3 ways. First as a way to confirm directional bias of trade I am in ( I should be long if bars are green). second with the scanner portion, when both a long term (daily) and a short term (15 or 30 min) are both same color then enter a trade in that colors direction. Lastly as a portfolio management feature. Take a portion of money and break into 5-10 slots each represented by a sector ETF such as 50K broken into 5 trading slots of 10K committed to each ETF. When daily bars are green for a specific ETF, that slot is long all 10K, when its red that slot is in cash.
Thank you in advance.
 
Last edited by a moderator:
Solution
ok everyone, In this version 1.9; I incorporated the MACD evaluation on the neutral paintbars. set the input of enableNeutralMACDPainter to yes, and all the neutral bars/conditions will then be further evaluated and painted based on the MACD condition. the MACD will paint with DARK reds and greens.

I will be working on integrating the rest of the indicator requests (5 to 6 new modules) throughout this week starting with HA's and will implement them in order of the threads.

Please take it for a spin and happy trading. Please provide any feedback for improvement or results as you all test it and what is working for you all.

Ruby:
#trend, a momentum and a cycle based indicator for ThinkorSwim V1.9
#@hockeycoachdoug Community Request
#...

YungTraderFromMontana

Well-known member
thanks All - can someone help me improve this.

Here is a good pattern in which the current parameters are not efficient, if we can solve for this type of pattern, I think it will make the indicators/csa better well rounded for partial trending conditions.

using dolomick share, MSFT 1M on 1/15/2020. on 1/15 most of all timeframes are negative.

C8gOT75.png
The way to improve it best is to refer to my previous instructions for the strategy. Only make trades in trending periods, if a signal is given in a non-trending period void it unless it is the latest signal. If it is the latest signal then make the trade as soon as the trending bar resumes trending. For example in this msft chart you would void around(going of visuals) 12:05 to around 12:50 and then at 12:50 place that short sell trade. The biggest issue if you look at the p/l is the loss of profit to trading in non-trending areas. It doesn't lose much per trade but it adds up. If you could do this I promise it would skyrocket the p/l.
 

diazlaz

Well-known member
2019 Donor
VIP
The way to improve it best is to refer to my previous instructions for the strategy. Only make trades in trending periods, if a signal is given in a non-trending period void it unless it is the latest signal. If it is the latest signal then make the trade as soon as the trending bar resumes trending. For example in this msft chart you would void around(going of visuals) 12:05 to around 12:50 and then at 12:50 place that short sell trade. The biggest issue if you look at the p/l is the loss of profit to trading in non-trending areas. It doesn't lose much per trade but it adds up. If you could do this I promise it would skyrocket the p/l.
I don't have time at the moment to go looking into this, I going to be in heavy travels over the next 2 weeks, but I took a few of the indicators and developed what I called "chop explode" - base on difference levels of RSI. I think it could do a nice job as a "confirmation" indicator, so if the explode matches the direction of the trend, enter if gray stay out.

QEEkfMH.png


you can see it here. I need to go dig it out and review the code, it was a few weeks ago and see if its something I can make available,

notice the gray boxes, it would have keep you out of some of the heavier chop.

In the meantime good luck with your testing and safe trading. keep us updated and let us know of any other suggestions all.
 

diazlaz

Well-known member
2019 Donor
VIP
@diazlaz I commend you on your patience and coding. If you wish to try the ADX code below and see if it improves the current code have at it. I have not tested if it does or not as I do not use this study at all. Just took a look at it to see why all the interest and thought I read somewhere of a complaint the ADX bar was not working as they wished.

Code:
#ADX TRENDING

input DI_length = 8;
input ADX_length = 8;
input ADXTrending = 25; #ADX
input showADXBar = yes;

def DX = if (diplus(di_length) + diminus(di_length) > 0) then 100 * AbsValue(diplus(di_length) - diminus(di_length)) / (diplus(di_length) + diminus(di_length)) else 0;
def ADX = WildersAverage(DX, adx_length);

plot ADXCross = LowestAll(low);
ADXCross.SetPaintingStrategy(PaintingStrategy.LINE);
ADXCross.AssignValueColor(
    if ADX > ADXTrending then Color.LIME
    else Color.DARK_GRAY);
ADXCross.SetLineWeight(5);
ADXCross.SetHiding(!showADXBar);
Hi @horserider,

thanks for the suggestion, I update the ADX to include your changes, looks pretty close or if not the same. (e.g. original is on the left and you're DI updates on the right).

RaViHnr.png


bars in orange are trending bars, dark gray are considered non-trending.

thanks again!
 

markos

Well-known member
VIP
Hi @horserider,

thanks for the suggestion, I update the ADX to include your changes, looks pretty close or if not the same. (e.g. original is on the left and you're DI updates on the right).

RaViHnr.png


bars in orange are trending bars, dark gray are considered non-trending.

thanks again!
Hey @diazlaz , Could you post the code for this CSA as it stands in the picture above. Even a grid share can be worked with. Thanks for everything, Markos
 

markos

Well-known member
VIP
Noticed this little snippet in version 2.0 (?) Question:Why does Pricedata = hl2 & price = c+l+h? Just wondering.
Code:
# SUPERTREND BY MOBIUS AND CCI ATR TREND COMBINED
input lengthCCI = 50;
input lengthATR = 21;
input AtrFactor = 1.0;
def pricedata = hl2;
def ATRcci = Average(TrueRange(h, c, l), lengthATR) * AtrFactor;
def price = c + l + h;
 

diazlaz

Well-known member
2019 Donor
VIP
Noticed this little snippet in version 2.0 (?) Question:Why does Pricedata = hl2 & price = c+l+h? Just wondering.
Code:
# SUPERTREND BY MOBIUS AND CCI ATR TREND COMBINED
input lengthCCI = 50;
input lengthATR = 21;
input AtrFactor = 1.0;
def pricedata = hl2;
def ATRcci = Average(TrueRange(h, c, l), lengthATR) * AtrFactor;
def price = c + l + h;
I think this was how it was in the original study. If it's different or suggest a change, please do so.

I will triage later in the week.
 

markos

Well-known member
VIP
I think this was how it was in the original study. If it's different or suggest a change, please do so.
I will triage later in the week.
@tomsk Please cross reference your database for the study posted in #168. Curious if this is from Mobius. I can't find it in JQ's Onenote. Thanks!
The question I posed was for all of our learning as well, even it it isn't a Mobius original. :)
 

HighBredCloud

Well-known member
Hi @diazlaz So I have been paying attention to what you stated about the possible mistake in the original Mobius script for the HA SuperTrend which you corrected...and it makes me wonder if what Mobius did was with a purpose or on purpose to get the results that he did from that particular HA SuperTrend?...It is unlike him to make mistakes and release it without corrections.

Anyways take a look SPY from today starting from the left the 2.1 version...middle being Mobius HA SuperTrend and all the way on the right regular 5 min HA...Please note that the Mobius version is using .7 ATR MULT and 4 NATR. Do you see those differences? Just in SPY alone from 10:10 to 10:40 is about $.50 difference...

MLhk5s7.png


I was thinking IF you would be able to add the original Mobius HA SuperTrend I am attaching here...while keeping the one you also corrected...IF you can...Would you be able to incorporate the ATR MULT to be set to .7 default or have the ability to have the end user switch that from the user menu? same with the 4 NATR?

We might get some very pleasing results once all the SuperTrends correlate with one another...Please let me know if you'd be able to include the original Mobius HA SuperTrend in the new 2.2 release...along with HULL MA when you get a chance...Thanks again for all your hard work.

Code:
# Mobius
# SuperTrend HeikenAshi
# Chat Room Request
# V03.10.2015
# Up = (HIGH + LOW) / 2 + Multiplier * ATR
# Down = (HIGH + LOW) / 2 – Multiplier * ATR
# When the change of trend occurs, the indicator flips

# For RP: Add AR trend, Aberrant Vol, R State, PTR

input AtrMult = .70;
input nATR = 4;
input AvgType = AverageType.HULL;
input PaintBars = yes;
input BubbleOn = no;
input ShowLabel = no;
input AlertOn = no;
input PlotLine = no;

def HAopen;
def HAhigh;
def HAlow;
def HAclose;
HAopen = CompoundValue(1, (haopen[1] + haclose[1]) / 2, (open[1] + close) / 2);
HAhigh = Max(high, close[1]);
HAlow = Min(low, close[1]);
haclose = (HAopen + HAclose[1] + HAlow + close) / 4;
def v = volume;
def bar = barNumber();
def EOD = if SecondsTillTime(1545) == 0 and
             SecondsFromTime(1545) == 0
          then 1
          else 0;
def NotActive = if SecondsFromTime(1545) > 0
                then 1
                else 0;
def ATR = MovingAverage(AvgType, TrueRange(HAhigh, HAclose, HAlow), nATR);
def UP = HL2 + (AtrMult * ATR);
def DN = HL2 + (-AtrMult * ATR);
def ST = if close < ST[1]
         then Round(UP / tickSize(), 0) * tickSize()
         else Round(DN / tickSize(), 0) * tickSize();
plot SuperTrend = ST;
SuperTrend.SetHiding(!PlotLine);
SuperTrend.AssignValueColor(if close < ST then Color.RED else Color.GREEN);
SuperTrend.SetPaintingStrategy(PaintingStrategy.Line);
AssignPriceColor(if PaintBars and close < ST
                 then Color.RED
                 else if PaintBars and close > ST
                      then Color.GREEN
                      else Color.CURRENT);
plot ST_point = if isNaN(close[-1])
                then ST
                else double.nan;
ST_point.SetStyle(Curve.Points);
ST_point.SetLineWeight(3);
ST_point.SetDefaultColor(Color.Yellow);
# End Code SuperTrend HeikenAshi
 

HighBredCloud

Well-known member
@markos I don't believe this script was by Mobius...I've seen this script on here before...I think this is it...it works good tho and it resembles Trend Magic Indicator...

https://usethinkscript.com/threads/supertrend-cci-atr-trend-combo-1-plot-works-on-mobile.494/
Code:
# SUPERTREND BY MOBIUS AND CCI ATR TREND COMBINED INTO ONE CHART INDICATOR, BOTH IN AGREEMENT IS A VERY POWERFUL SIGNAL IF TRENDING. VERY GOOD AT CATCHING REVERSALS. WORKS WELL ON 1 AND 5 MIN CHARTS. PLOT IS THE COMBINATION LOWEST FOR UPTREND AND HIGHEST OF THE DOWNTREND. DOTS COLORED IF BOTH IN AGREEMENT OR GREY IF NOT -  08/10/19 DTEK


def c = close;
def h = high;
def l = low;
def pricedata = hl2;

#SUPERTREND
input ST_Atr_Mult = 1.0;
input ST_Length = 4;
input ST_AvgType = AverageType.HULL;

def ATR = MovingAverage(ST_AvgType, TrueRange(high, close, low), ST_Length);
def UP = HL2 + (ST_Atr_Mult* ATR);
def DN = HL2 + (-ST_Atr_Mult * ATR);
def ST = if close < ST[1] then UP else DN;

def SuperTrend = ST;


#CCI_ATR
input lengthCCI = 50;
input lengthATR = 21;
input AtrFactor = 1.0;

def ATRcci = Average(TrueRange(h, c, l), lengthATR) * AtrFactor;
def price = c + l + h;
def linDev = LinDev(price, lengthCCI);
def CCI = if linDev == 0
          then 0
          else (price - Average(price, lengthCCI)) / linDev / 0.015;

def MT1 = if CCI > 0
          then Max(MT1[1], pricedata - ATRcci)
          else Min(MT1[1], pricedata + ATRcci);
def CCI_ATR_TREND = MT1;

plot ST_ATR_COMBO = if C> ST and C>CCI_ATR_TREND then min(CCI_ATR_TREND, ST) else if c< ST and c<CCI_ATR_TREND then max(CCI_ATR_TREND, ST) else CCI_ATR_TREND;

ST_ATR_COMBO.AssignValueColor(if c < MT1 and c <ST then color.cyan else if C > MT1 and c >ST then color.magenta else color.yellow);
ST_ATR_COMBO.setPaintingStrategy(paintingStrategy.LINE_VS_POINTS);
 

diazlaz

Well-known member
2019 Donor
VIP
Hi @diazlaz So I have been paying attention to what you stated about the possible mistake in the original Mobius script for the HA SuperTrend which you corrected...and it makes me wonder if what Mobius did was with a purpose or on purpose to get the results that he did from that particular HA SuperTrend?...It is unlike him to make mistakes and release it without corrections.

Anyways take a look SPY from today starting from the left the 2.1 version...middle being Mobius HA SuperTrend and all the way on the right regular 5 min HA...Please note that the Mobius version is using .7 ATR MULT and 4 NATR. Do you see those differences? Just in SPY alone from 10:10 to 10:40 is about $.50 difference...

MLhk5s7.png


I was thinking IF you would be able to add the original Mobius HA SuperTrend I am attaching here...while keeping the one you also corrected...IF you can...Would you be able to incorporate the ATR MULT to be set to .7 default or have the ability to have the end user switch that from the user menu? same with the 4 NATR?

We might get some very pleasing results once all the SuperTrends correlate with one another...Please let me know if you'd be able to include the original Mobius HA SuperTrend in the new 2.2 release...along with HULL MA when you get a chance...Thanks again for all your hard work.

Code:
# Mobius
# SuperTrend HeikenAshi
# Chat Room Request
# V03.10.2015
# Up = (HIGH + LOW) / 2 + Multiplier * ATR
# Down = (HIGH + LOW) / 2 – Multiplier * ATR
# When the change of trend occurs, the indicator flips

# For RP: Add AR trend, Aberrant Vol, R State, PTR

input AtrMult = .70;
input nATR = 4;
input AvgType = AverageType.HULL;
input PaintBars = yes;
input BubbleOn = no;
input ShowLabel = no;
input AlertOn = no;
input PlotLine = no;

def HAopen;
def HAhigh;
def HAlow;
def HAclose;
HAopen = CompoundValue(1, (haopen[1] + haclose[1]) / 2, (open[1] + close) / 2);
HAhigh = Max(high, close[1]);
HAlow = Min(low, close[1]);
haclose = (HAopen + HAclose[1] + HAlow + close) / 4;
def v = volume;
def bar = barNumber();
def EOD = if SecondsTillTime(1545) == 0 and
             SecondsFromTime(1545) == 0
          then 1
          else 0;
def NotActive = if SecondsFromTime(1545) > 0
                then 1
                else 0;
def ATR = MovingAverage(AvgType, TrueRange(HAhigh, HAclose, HAlow), nATR);
def UP = HL2 + (AtrMult * ATR);
def DN = HL2 + (-AtrMult * ATR);
def ST = if close < ST[1]
         then Round(UP / tickSize(), 0) * tickSize()
         else Round(DN / tickSize(), 0) * tickSize();
plot SuperTrend = ST;
SuperTrend.SetHiding(!PlotLine);
SuperTrend.AssignValueColor(if close < ST then Color.RED else Color.GREEN);
SuperTrend.SetPaintingStrategy(PaintingStrategy.Line);
AssignPriceColor(if PaintBars and close < ST
                 then Color.RED
                 else if PaintBars and close > ST
                      then Color.GREEN
                      else Color.CURRENT);
plot ST_point = if isNaN(close[-1])
                then ST
                else double.nan;
ST_point.SetStyle(Curve.Points);
ST_point.SetLineWeight(3);
ST_point.SetDefaultColor(Color.Yellow);
# End Code SuperTrend HeikenAshi
Will do probably will be in the 2.3 towards the end of the week. I also question the inconsistencies and questioning if it was by design.

Thanks for your analysis.
 

HighBredCloud

Well-known member
@diazlaz I do not know the logic either...but there must be...To throw more fuel into the fire...another Mobius Heikin Ashi Candles this time...Perhaps you will get your answer here and see that what Mobius did is not a mistake but rather something he meant to do maybe?

For comparison purposes from the left is the Mobius Heikin Ashi Candles from the script below...Middle Mobius Heikin Ashi SuperTrend from post #174 and standard Heikin Ashi. Out of curiosity...would it be too much to ask for if you can also include this new Mobius Heikin Ashi Candles from the script below in the 2.3 version as well as the Mobius Heikin Ashi SuperTrend from post #174? IF not than I prefer the Heikin Ashi SuperTrend from post #174.


Code:
def HAopen;

def HAhigh;

def HAlow;

def HAclose;

HAopen = CompoundValue(1, HAopen[1] + HAclose[1], open[1] + close)/2;

HAhigh = Max(high, close[1]);

HAlow = Min(low, close[1]);

haclose = (HAopen + HAhigh + HAlow + HAclose[1]) / 4;

AssignPriceColor(if HAclose > HAopen

                 then color.green

                 else color.red);
 
Last edited:

tomsk

Well-known member
VIP
@tomsk Please cross reference your database for the study posted in #168. Curious if this is from Mobius. I can't find it in JQ's Onenote. Thanks!
The question I posed was for all of our learning as well, even it it isn't a Mobius original. :)


@markos Nope, this was not written by Mobius - Best guess is someone posted botched up code. As they often say in the lounge, why mess with perfection? Stick to Mobius version for the most part.
 

HighBredCloud

Well-known member
@diazlaz Someone here asked about incorporating an RSI into this CSA...Here's is Derivative RSI by @horserider that I think would do well with the CSA...Let me know if you can throw that in there along with everything else you have planned for the 2.3 version. Once again thanks for your hard work on this.

Code:
#  Derivative RSI Oscillator
#  Can be used alone as a smoother RSI or as part of the Carting Wealth strategy when combined    with the MACD and MAs Charting Wealth study.
#  By Horserider 12/25/2019
#

declare lower;

input length = 14;
input length1 = 5;
input length2 = 3;
input length3 = 9;
input price = close;


def NetChgAvg = WildersAverage(price - price[1], length);
def TotChgAvg = WildersAverage(AbsValue(price - price[1]), length);
def ChgRatio = if TotChgAvg != 0 then NetChgAvg / TotChgAvg else 0;

def RSI = (50 * (ChgRatio + 1) - 50);

#################################
plot  ZeroLine = 0;
ZeroLine.SetDefaultColor(Color.YELLOW);
ZeroLine.SetLineWeight(1);

input averageType = AverageType.EXPONENTIAL;
input averageType2 = averageType.SIMPLE;
def x = MovingAverage(averageType,RSI, length1);
def x2 = MovingAverage(averageType, x, length2);
def xs = MovingAverage(averageType2, x2 , length3);
def rsi__linediff = x2 - xs;

plot RSI_Line = rsi__linediff;
RSI_Line.SetDefaultColor(GetColor(1));

RSI_Line.SetDefaultColor(GetColor(5));
RSI_Line.SetPaintingStrategy(PaintingStrategy.HISTOGRAM);
RSI_Line.SetLineWeight(3);
RSI_Line.DefineColor("Positive and Up", Color.GREEN);
RSI_Line.DefineColor("Positive and Down", Color.DARK_GREEN);
RSI_Line.DefineColor("Negative and Down", Color.RED);
RSI_Line.DefineColor("Negative and Up", Color.DARK_RED);
RSI_Line.AssignValueColor(if RSI_Line >= 0 then if RSI_Line > RSI_Line[1] then RSI_Line.color("Positive and Up") else RSI_Line.color("Positive and Down") else if RSI_Line < RSI_Line[1] then RSI_Line.color("Negative and Down") else RSI_Line.color("Negative and Up"));
 

HighBredCloud

Well-known member
@diazlaz I also found Relative Volume...take a look at how the candles are painted based on relative volume...very interesting seeing how fast the candle colors react to price changes.

Code:
# Volume Comparison
# Plots Yesterdays Total Volume At Same Bar and Average Volume At Same Bar
# Mobius
# V02.06.2018 Posted to Chat Room 07.13.2018
# tomsk added Alert when today's volume/avgVol > 300%, 1.17.2020

# Plots a comparison of yesterdays total volume at the same bar
# and compares an average volume to the same time yesterday.

declare on_volume;

input avgLength = 10;

def v = volume;
def vD = volume(period = AggregationPeriod.Day);
def c = close;
def x = BarNumber();
def nan = double.nan;
def RTHbar1 = if GetTime() crosses above RegularTradingStart(GetYYYYMMDD())
              then x
              else RTHbar1[1];
def RTH = GetTime() >= RegularTradingStart(GetYYYYMMDD()) and
          GetTime() <= RegularTradingEnd(GetYYYYMMDD());
def PrevRTHbar1 = if RTHbar1 != RTHbar1[1]
                  then RTHbar1[1]
                  else PrevRTHbar1[1];
def indexBar = RTHbar1 - PrevRTHbar1;
plot prevVol = if IsNaN(c)
               then nan
               else GetValue(v, indexBar);
prevVol.SetPaintingStrategy(PaintingStrategy.HISTOGRAM);
prevVol.SetDefaultColor(CreateColor(75, 75, 75));
prevVol.SetLineWeight(1);
plot Vol = v;
Vol.SetPaintingStrategy(PaintingStrategy.SQUARED_HISTOGRAM);
Vol.AssignValueColor(if close > open then CreateColor(5, 250, 12) else CreateColor(250, 5, 25));
AssignPriceColor(if close > open then CreateColor(5, 250, 12) else CreateColor(250, 5, 25));
def avgPrev = Average(prevVol, avgLength);
def avgCurr = Average(Vol, avgLength);
def prevDailyVol = if RTH and !RTH[1]
                   then getValue(v, indexBar)
                   else if RTH
                        then compoundValue(1, prevDailyVol[1] + GetValue(v, indexBar), GetValue(v, indexBar))
                   else prevDailyVol[1];
AddLabel(1, "Prev D Vol = " + prevDailyVol +
          "  Prev Vol avg(" + avgLength + ") = " + Round(avgPrev, 0), prevVol.TakeValueColor());
AddLabel(1, "Current D Vol = " + vD +
          "  Curr Vol avg(" + avgLength + ") = " + Round(avgCurr, 0), if vD > prevDailyVol
                                                                      then color.green
                                                                      else color.red);
Alert(vD/avgCurr > 3, "Daily Volume > 300% AvgVol", Alert.BAR, Sound.Ring);
# End Code Volume Comparison
 
Last edited:
Status
Not open for further replies.

Similar threads

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