Dear Community
Is this IBS-indicator already build in MC, maybe with another name?
http://qusma.com/2012/11/06/closing-pri ... reversion/
Can someone please code it as working indicator?
I am a little confused because i always get an Error (division/zero)
Thank you very much
LRP
Internal Bar Strength (IBS)
- TJ
- Posts: 7744
- Joined: 29 Aug 2006
- Location: Global Citizen
- Has thanked: 1033 times
- Been thanked: 2223 times
Re: Internal Bar Strength (IBS)
If you have already tried, you should post your attempt and let the community help you to debug.Dear Community
Is this IBS-indicator already build in MC, maybe with another name?
http://qusma.com/2012/11/06/closing-pri ... reversion/
Can someone please code it as working indicator?
I am a little confused because i always get an Error (division/zero)
Thank you very much
LRP
- LRP
- Posts: 153
- Joined: 07 Apr 2008
- Location: Switzerland
- Has thanked: 96 times
- Been thanked: 15 times
Re: Internal Bar Strength (IBS)
Thank you TJ,If you have already tried, you should post your attempt and let the community help you to debug.
OK lets try, this is my attempt:
// Internal Bar Strength Indicator (IBS)
// Source: http://qusma.com/2012/11/06/closing-pri ... reversion/
vars: Oben(0), Unten(0), Durch(0);
Oben = (Close-low);
Unten = (High - Low);
Durch = (Oben/Unten);
Plot1( Oben, "0ben" );
Plot2 (Unten, "Unten");
Plot3 (Durch, "IBS")
THX for your inputs
- TJ
- Posts: 7744
- Joined: 29 Aug 2006
- Location: Global Citizen
- Has thanked: 1033 times
- Been thanked: 2223 times
Re: Internal Bar Strength (IBS)
What would be the value of Unten if the high = low?Thank you TJ,If you have already tried, you should post your attempt and let the community help you to debug.
OK lets try, this is my attempt:
// Internal Bar Strength Indicator (IBS)
// Source: http://qusma.com/2012/11/06/closing-pri ... reversion/
vars: Oben(0), Unten(0), Durch(0);
Oben = (Close-low);
Unten = (High - Low);
Durch = (Oben/Unten);
Plot1( Oben, "0ben" );
Plot2 (Unten, "Unten");
Plot3 (Durch, "IBS")
THX for your inputs
What would be the impact on Durch?
ps. [FAQ] How to Post Codes
viewtopic.php?f=16&t=11713
- LRP
- Posts: 153
- Joined: 07 Apr 2008
- Location: Switzerland
- Has thanked: 96 times
- Been thanked: 15 times
Re: Internal Bar Strength (IBS)
OK, i try again:
The problem is if the dominator result is a zero.
I am not sure if it is correct coded?
The problem is if the dominator result is a zero.
I am not sure if it is correct coded?
Code: Select all
// Internal Bar Strength Indicator (IBS)
// Source: http://qusma.com/2012/11/06/closing-price-in-relation-to-the-days-range-and-equity-index-mean-reversion/
vars: Above(0), Below(0), IBS(0);
Above = (Close-Low);
Below = (High-Low);
if Below <> 0 then
IBS = (Above/Below);
Plot1 (IBS, "InternalBarStrength")
- TJ
- Posts: 7744
- Joined: 29 Aug 2006
- Location: Global Citizen
- Has thanked: 1033 times
- Been thanked: 2223 times
Re: Internal Bar Strength (IBS)
You have to decide the next logic:OK, i try again:
The problem is if the dominator result is a zero.
...
What to do when the dominator is zero?
1. Do you make IBS the same value as the previous bar? (ie skip the calculation)
2. Make IBS = zero?
3. some other logic?
- TJ
- Posts: 7744
- Joined: 29 Aug 2006
- Location: Global Citizen
- Has thanked: 1033 times
- Been thanked: 2223 times
Re: Internal Bar Strength (IBS)
I see that you have edited your post...OK, i try again:
The problem is if the dominator result is a zero.
I am not sure if it is correct coded?
Code: Select all
// Internal Bar Strength Indicator (IBS)
// Source: http://qusma.com/2012/11/06/closing-price-in-relation-to-the-days-range-and-equity-index-mean-reversion/
vars: Above(0), Below(0), IBS(0);
Above = (Close-Low);
Below = (High-Low);
if Below <> 0 then
IBS = (Above/Below);
Plot1 (IBS, "InternalBarStrength")
Yes, that is a good check for "Division by Zero".
- LRP
- Posts: 153
- Joined: 07 Apr 2008
- Location: Switzerland
- Has thanked: 96 times
- Been thanked: 15 times
Re: Internal Bar Strength (IBS)
You have to decide the next logic:OK, i try again:
The problem is if the dominator result is a zero.
...
What to do when the dominator is zero?
1. Do you make IBS the same value as the previous bar? (ie skip the calculation)
2. Make IBS = zero?
3. some other logic?
Do you think it is now correct?Thank TJ for your patience
sorry I edited my code and did not see your fast reply
- TJ
- Posts: 7744
- Joined: 29 Aug 2006
- Location: Global Citizen
- Has thanked: 1033 times
- Been thanked: 2223 times
Re: Internal Bar Strength (IBS)
This will skip a bar's calculation and repeat the previous bar's value
This will make the IBS = zero (useful for zero oscillators)
Code: Select all
if Below <> 0 then
IBS = (Above/Below)
else
IBS = IBS[1];
Code: Select all
if Below <> 0 then
IBS = (Above/Below)
else
IBS = 0;