Dark Theme
Light Theme
Trading Articles
Article Categories
Article Tools
Welcome to NexusFi: the best trading community on the planet, with over 150,000 members Sign Up Now for Free
Genuine reviews from real traders, not fake reviews from stealth vendors
Quality education from leading professional traders
We are a friendly, helpful, and positive community
We do not tolerate rude behavior, trolling, or vendors advertising in posts
We are here to help, just let us know what you need
You'll need to
register in order to view the content of the threads and start contributing to our community.
It's free for basic access, or support us by becoming an Elite Member -- see if you qualify for a discount below.
-- Big Mike, Site Administrator
(If you already have an account, login at the top of the page)
IV Rank Indicator
Updated May 21, 2017
trending_up
3,401 views
thumb_up
4 thanks given
group
2 followers
forum
8 posts
attach_file
4 attachments
IV Rank Indicator
May 19th, 2017, 05:05 AM
Indonesia
Posts: 8 since Dec 2013
Thanks Given: 3
Thanks Received: 1
Hi,
I want to build Indicator IV rank but IV in TS sometimes have Zero Value or the value Spike so I want to Filter that but the indicator become error. Can anyone help me to fix this.
Thanks in advance.
My code now is :
inputs :
Length(252),
IVSpikeRatio(2);
variables:
IV(0),
IV1(0),
IVH(0),
IVL(0),
HL(0),
Rank(0);
IV = IVolatility;
IV1 = IV[1] * IVSPikeRatio; {Criteria for Spike IV}
If IV <= 0 then IV = IV[1]; {For Filtering the Zero Value IV}
//If IV >= IV1 then IV = IV[1]; {For Filtering Spike IV Value}
Plot1 (IV, !("IV ALL"));
IVH = Highest(IV,Length)[1];
IVL = Lowest(IV,Length)[1];
If (IVH - IVL) > 0 then Begin
HL = (IVH - IVL);
Rank = ((IV - IVL) / HL);
End
else Begin
Rank = 0;
End;
//Plot1 (IV1,"IV1");
Plot2 (IVH,"Highest");
Plot3 (IVL,"Lowest");
//Plot4 (IV,"IV");
Plot5 (Rank, "IV Rank 66");
SetPlotColor(2,Green);
SetPlotColor(3,Red);
//SetPlotColor(1,Yellow);
//SetPlotColor(4,Blue);
SetPlotColor(5,Blue);
My Problem is the spike filter result IV is Zero.
Can you help answer these questions from other members on NexusFi?
Best Threads (Most Thanked) in the last 7 days on NexusFi
May 19th, 2017, 05:36 AM
Posts: 2,436 since Apr 2013
Thanks Given: 482
Thanks Received: 1,629
a121e,
what is the exact error that you are facing with the code?
Regards,
ABCTG
May 19th, 2017, 05:40 AM
Indonesia
Posts: 8 since Dec 2013
Thanks Given: 3
Thanks Received: 1
Hi ABCTG,
the problem is when I want to to filter the sudden spike IV the result is the IV become Zero.
I dont know why and how to fix that.
May 19th, 2017, 05:57 AM
Posts: 2,436 since Apr 2013
Thanks Given: 482
Thanks Received: 1,629
a121e,
I would suggest to start simple and just plot IV and IV1. What is the outcome of that?
Code
inputs :
IVSpikeRatio(2);
variables:
IV(0),
IV1(0);
IV = IVolatility;
IV1 = IV[1] * IVSPikeRatio; {Criteria for Spike IV}
If IV <= 0 then IV = IV[1]; {For Filtering the Zero Value IV}
Plot1 (IV, "IV" );
Plot2 (IV1 , "IV1" );
If this is giving you what you want, great, add the spike filter. What is the outcome now?
Code
inputs :
IVSpikeRatio(2);
variables:
IV(0),
IV1(0);
IV = IVolatility;
IV1 = IV[1] * IVSPikeRatio; {Criteria for Spike IV}
If IV <= 0 then IV = IV[1]; {For Filtering the Zero Value IV}
If IV >= IV1 then IV = IV[1]; {For Filtering Spike IV Value}
Plot1 (IV, "IV" );
Plot2 (IV1 , "IV1" );
Post the screenshots for the two outcomes.
Regards,
ABCTG
May 21st, 2017, 04:47 AM
Indonesia
Posts: 8 since Dec 2013
Thanks Given: 3
Thanks Received: 1
Hi ABCTG,
The result is :
For the zero IV is gone but the spike is still there and the second Code give result Zero value.
Regards,
Arie
May 21st, 2017, 09:34 AM
Posts: 2,436 since Apr 2013
Thanks Given: 482
Thanks Received: 1,629
a121e,
what will be the value for IV[1] on the very first bar that you compute your code? Think about what this will result in with your code.
Regards,
ABCTG
May 21st, 2017, 11:41 AM
Indonesia
Posts: 8 since Dec 2013
Thanks Given: 3
Thanks Received: 1
Hi ABCTG,
I think the result is zero.
I Guess I solve the problem even I dont know why the problem is finished. It Looks like suddenly works.
The final is like in the picture, the Zero IV and the Spike IV is gone.
the code is :
inputs :
IVSpikeRatio(2);
variables:
IV(0),
IV1(0),
IVSpike(0);
IV = IVolatility;
IVSPike = IV[1] * IVSPikeRatio; {Criteria for Spike IV}
If IV <= 0 then IV = IV[1]; {For Filtering the Zero Value IV}
//Filter for Spike
If IV >= IVSpike then
Begin
IV1 = IV[1];
End
Else
Begin
IV1 = IV;
End;
Plot1 (IV1, "IV Filter" );
Thanks for your guidance ABCTG
Regards,
Arie
May 21st, 2017, 12:27 PM
Posts: 2,436 since Apr 2013
Thanks Given: 482
Thanks Received: 1,629
a121e,
I think so, too.
IV[1] could simply be 0 on the first bar. This results in "IVSPike = IV[1] * IVSPikeRatio;" being zero as well
and with "If IV <= 0 then IV = IV[1];" you make IV = 0, too.
Therefore on the next bar IV[1] will be 0 again and your code simply created a situation where you keep setting IV to 0.
I am glad to hear that you got it working.
Regards,
ABCTG
Last Updated on May 21, 2017