VQI Volatility Quality Index For ThinkOrSwim

mikeytrader13

New member
A MT4 version of Volatility Quality Zero Line with Dots by Mladen & Mrtools. It comes with Multi-timeframe mode + Interpolation & more.
https://forex-station.com/viewtopic.php?f=579496&t=8437913&start=70

Like volume, without volatility, price won’t move appreciably. In this instance, the Volatility Quality indicator is able to distinguish between “good” and “bad” volatility to help us traders find those beautiful entries we need for profitable trades.
We can find other information about volatility quality from this link;
https://stonehillforex.com/2022/11/volatility-quality-as-a-confirmation-indicator/

DmyHhQZ.png


If it can be converted all the help will be greatly appreciated and may this be useful towards your trading journey.

@mashume if you have time to kill can you check this out plz, maybe it can be helpful ;)
 
Last edited by a moderator:

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

A MT4 version of Volatility Quality Zero Line with Dots by Mladen & Mrtools. It comes with Multi-timeframe mode + Interpolation & more.
https://forex-station.com/viewtopic.php?f=579496&t=8437913&start=70

Like volume, without volatility, price won’t move appreciably. In this instance, the Volatility Quality indicator is able to distinguish between “good” and “bad” volatility to help us traders find those beautiful entries we need for profitable trades.
We can find other information about volatility quality from this link;
https://stonehillforex.com/2022/11/volatility-quality-as-a-confirmation-indicator/

DmyHhQZ.png


If it can be converted all the help will be greatly appreciated and may this be useful towards your trading journey.

@mashume if you have time to kill can you check this out plz, maybe it can be helpful ;)
check out the below . Pls test it.

CSS:
#// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
#// © loxx
#indicator('Zero-line Volatility Quality Index (VQI) [Loxx]',
# converted by Sam4Cok@Samer800 - 11/2022
declare lower;
#calc_jma(_src, _length, _phase, _power) =>
script jma {
   input _src = close;
   input _length = 0;
   input _power = 0;
    def beta = 0.45 * (_length - 1) / (0.45 * (_length - 1) + 2);
    def alpha = Power(beta, _power);
    def e0;
    def e1;
    def e2;
    def jma;
    e0 = (1 - alpha) * _src + alpha * (e0[1]);
    e1 = (_src - e0) * (1 - beta) + beta * (e1[1]);
    e2 = (e0 - jma[1]) * Power(1 - alpha, 2) + Power(alpha, 2) * (e2[1]);
    jma = CompoundValue(1, e2 + (jma[1]), _src) ;
    plot return = jma;
}
#ma(type, src, len) =>
script ma {
    input type = "SMA";
    input src = close;
    input len = 10;
    input power = 2;
    def sig;
    sig = if type == "SMA" then SimpleMovingAvg(src, len) else
    if type == "EMA" then  ExpAverage(src, len) else
    if type == "WMA" then WMA(src, len) else
    if type == "JMA" then JMA(src, len, power) else
    if type == "RMA" then WildersAverage(src, len) else SimpleMovingAvg(src, len);
    plot return = sig;
}
input PriceSmoothing = 15;#(10, "Source Smoothing Period"
input atrPercentage = 7.5;#(7.5, "ATR Percentage %"
input studyStyle = {Default Trend, Oscillator};
input type = {default "WMA", "JMA", "EMA", "RMA", "SMA"};# "Smoothing Type"
input power = 2;       # "Power"
input colorBars = yes; # "Color bars?"
input showSigs = yes;# "Show signals?"

def na = Double.NaN;
def bar = BarNumber();
def style = if studyStyle==studyStyle.Trend then 1 else 0;
def inpFilter = atrPercentage / 100;
def nATR = ATR(Length = PriceSmoothing);

def chigh  = ma(type,high    , PriceSmoothing, power);
def clow   = ma(type,low     , PriceSmoothing, power);
def cclose = ma(type,close   , PriceSmoothing, power);
def copen  = ma(type,open    , PriceSmoothing, power);
def pclose = ma(type,close[1], PriceSmoothing, power);

def truerange = Max(cHigh,pClose)- Min(cLow,pClose);
def range = chigh - clow;
def vqi_raw;

if (range != 0 and trueRange!=0) {
          vqi_raw = ((cClose-pClose)/trueRange + (cClose-cOpen)/range)*0.5;
    } else {
          vqi_raw = vqi_raw[1];
}
def vqi = AbsValue(Vqi_raw) * (cclose - pclose + cclose - copen) * 0.5;
def sumVqi = if inpFilter > 0 and bar > 0 then
             if AbsValue(vqi-vqi[1]) < inpFilter * nATR then sumVqi[1] else vqi else vqi;

def valc = if (sumVqi > 0) then 1 else if (sumVqi < 0) then -1 else if bar>0 then valc[1] else 0;
def trend = if sumVqi > 0 then 1 else if sumVqi < 0 then -1 else 0;

plot VQIline = if style then sumVqi else vqi;
VQIline.AssignValueColor(if valc > 0 then Color.GREEN else
                         if valc < 0 then Color.RED else Color.GRAY);
VQIline.SetLineWeight(2);
plot mid = if IsNaN(close) then na else 0;
mid.SetDefaultColor(Color.GRAY);
mid.SetStyle(Curve.SHORT_DASH);

def crossUp = if trend != trend[1] and trend== 1 then sumVqi - 5* stDev(sumVqi,PriceSmoothing) else na;
def crossDn = if trend != trend[1] and trend==-1 then sumVqi + 5* stDev(sumVqi,PriceSmoothing) else na;

plot long = if showSigs then crossUp[-1] else na;
long.SetDefaultColor(Color.GREEN);
long.SetStyle(Curve.POINTS);
long.SetLineWeight(3);
plot short = if showSigs then crossDn[-1] else na;
short.SetDefaultColor(Color.RED);
short.SetStyle(Curve.POINTS);
short.SetLineWeight(3);

#---Bar Color
AssignPriceColor(if !colorbars then Color.CURRENT else
                 if valc > 0 then Color.GREEN else
                 if valc < 0 then color.RED else Color.GRAY);


#--- END CODE
 
Last edited by a moderator:
check out the below . Pls test it.

CSS:
#// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
#// © loxx
#indicator('Zero-line Volatility Quality Index (VQI) [Loxx]',
# converted by Sam4Cok@Samer800 - 11/2022
declare lower;
#calc_jma(_src, _length, _phase, _power) =>
script jma {
   input _src = close;
   input _length = 0;
   input _power = 0;
    def beta = 0.45 * (_length - 1) / (0.45 * (_length - 1) + 2);
    def alpha = Power(beta, _power);
    def e0;
    def e1;
    def e2;
    def jma;
    e0 = (1 - alpha) * _src + alpha * (e0[1]);
    e1 = (_src - e0) * (1 - beta) + beta * (e1[1]);
    e2 = (e0 - jma[1]) * Power(1 - alpha, 2) + Power(alpha, 2) * (e2[1]);
    jma = CompoundValue(1, e2 + (jma[1]), _src) ;
    plot return = jma;
}
#ma(type, src, len) =>
script ma {
    input type = "SMA";
    input src = close;
    input len = 10;
    input power = 2;
    def sig;
    sig = if type == "SMA" then SimpleMovingAvg(src, len) else
    if type == "EMA" then  ExpAverage(src, len) else
    if type == "WMA" then WMA(src, len) else
    if type == "JMA" then JMA(src, len, power) else
    if type == "RMA" then WildersAverage(src, len) else SimpleMovingAvg(src, len);
    plot return = sig;
}
input PriceSmoothing = 15;#(10, "Source Smoothing Period"
input atrPercentage = 7.5;#(7.5, "ATR Percentage %"
input studyStyle = {Default Trend, Oscillator};
input type = {default "WMA", "JMA", "EMA", "RMA", "SMA"};# "Smoothing Type"
input power = 2;       # "Power"
input colorBars = yes; # "Color bars?"
input showSigs = yes;# "Show signals?"

def na = Double.NaN;
def bar = BarNumber();
def style = if studyStyle==studyStyle.Trend then 1 else 0;
def inpFilter = atrPercentage / 100;
def nATR = ATR(Length = PriceSmoothing);

def chigh  = ma(type,high    , PriceSmoothing, power);
def clow   = ma(type,low     , PriceSmoothing, power);
def cclose = ma(type,close   , PriceSmoothing, power);
def copen  = ma(type,open    , PriceSmoothing, power);
def pclose = ma(type,close[1], PriceSmoothing, power);

def truerange = Max(cHigh,pClose)- Min(cLow,pClose);
def range = chigh - clow;
def vqi_raw;

if (range != 0 and trueRange!=0) {
          vqi_raw = ((cClose-pClose)/trueRange + (cClose-cOpen)/range)*0.5;
    } else {
          vqi_raw = vqi_raw[1];
}
def vqi = AbsValue(Vqi_raw) * (cclose - pclose + cclose - copen) * 0.5;
def sumVqi = if inpFilter > 0 and bar > 0 then
             if AbsValue(vqi-vqi[1]) < inpFilter * nATR then sumVqi[1] else vqi else vqi;

def valc = if (sumVqi > 0) then 1 else if (sumVqi < 0) then -1 else if bar>0 then valc[1] else 0;
def trend = if sumVqi > 0 then 1 else if sumVqi < 0 then -1 else 0;

plot VQIline = if style then sumVqi else vqi;
VQIline.AssignValueColor(if valc > 0 then Color.GREEN else
                         if valc < 0 then Color.RED else Color.GRAY);
VQIline.SetLineWeight(2);
plot mid = if IsNaN(close) then na else 0;
mid.SetDefaultColor(Color.GRAY);
mid.SetStyle(Curve.SHORT_DASH);

def crossUp = if trend != trend[1] and trend== 1 then sumVqi - 5* stDev(sumVqi,PriceSmoothing) else na;
def crossDn = if trend != trend[1] and trend==-1 then sumVqi + 5* stDev(sumVqi,PriceSmoothing) else na;

plot long = if showSigs then crossUp[-1] else na;
long.SetDefaultColor(Color.GREEN);
long.SetStyle(Curve.POINTS);
long.SetLineWeight(3);
plot short = if showSigs then crossDn[-1] else na;
short.SetDefaultColor(Color.RED);
short.SetStyle(Curve.POINTS);
short.SetLineWeight(3);

#---Bar Color
AssignPriceColor(if !colorbars then Color.CURRENT else
                 if valc > 0 then Color.GREEN else
                 if valc < 0 then color.RED else Color.GRAY);


#--- END CODE
thank you @samer800 a lot of work, so far its doing what it supposed to do I will keep testing!
 

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

87k+ Posts
467 Online
Create Post

Similar threads

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