Requests & Ideas - page 99

 

Klinger oscillator revised..

Hi all,

I did a little mod of the Klinger oscillator coded by Mladen; for the fans of volume (like I am...) now we can have 4 ways to plot this indi; lines or histogram both in two flavor: with MA signal or not.

Have a look at the picture to see which "flavor" do you prefer...

Enjoy

mladen:
According to that definition and some other definitions I have found, it would be kvo2.

Attaching a version that I have and which is solving a case when current and previous price are equal (if and when it happens, it is the case which they describe at that link as the "In our research, we found no statement as to how to treat the case") as a continuation of previous "trend", so that even that case is solved in more or less acceptable manner (at least I hope so)

PS: added an option to allow the second prevailing calculation mode too - when high-low range is used in calculation. They are giving very similar results except that when using range in calculation it is somewhat smoother and it seems that it is avoiding some false signals. The "range" calculation is used in tradestation code and since tradestation people are very long in this game it seems that they can be trusted (left the regular mode to, just in case ). Here is a comparison of the "using range" calculation (upper) and a "regular" (lower)

regards

Mladen
 

d9 Particle Oscillator

mladen,

I was wondering is there any indicator in metatrader similar to d9 Particle Oscillator in ninjatrader.

If not, would it be possible to code something for mq4?

I have attached the C code for your reference.

d9particle.txt

Files:
d9particle.txt  24 kb
d9particle.jpg  96 kb
 
Pip:
Brilliant!

Hi Senior members,

I would like to know a bit of the setting of the indi especially the info3:cycle list settings, which is set to false. i set the usetopcycles to 2 which mean it uses the 1st 2 cycles. so with cycle list settings to true, cycle1=1 means it starts at 1, cycle2=2 means the 2nd top cycle starts at 2 ? Appreciate if you could explain to me a bit of these settings.

Thanks

KL

 

kokleongch

If you use the cycle list (so if it is set to true) then it will use up to 5 cycles that you choose, so if any cycle in the cycle1, cycle2, ... cycle5 is set to > 0, it will be used. In that case you do not have to use consecutive cycles. For example you cane use 1,3,5th cycle if you set cycle1 to 1, cycle2 to 3 and cycle3 to 5

kokleongch:
Hi Senior members,

I would like to know a bit of the setting of the indi especially the info3:cycle list settings, which is set to false. i set the usetopcycles to 2 which mean it uses the 1st 2 cycles. so with cycle list settings to true, cycle1=1 means it starts at 1, cycle2=2 means the 2nd top cycle starts at 2 ? Appreciate if you could explain to me a bit of these settings.

Thanks

KL
 
mladen:
kokleongch If you use the cycle list (so if it is set to true) then it will use up to 5 cycles that you choose, so if any cycle in the cycle1, cycle2, ... cycle5 is set to > 0, it will be used. In that case you do not have to use consecutive cycles. For example you cane use 1,3,5th cycle if you set cycle1 to 1, cycle2 to 3 and cycle3 to 5

thanks for the quick reply mladen.

 
mladen:
kokleongch If you use the cycle list (so if it is set to true) then it will use up to 5 cycles that you choose, so if any cycle in the cycle1, cycle2, ... cycle5 is set to > 0, it will be used. In that case you do not have to use consecutive cycles. For example you cane use 1,3,5th cycle if you set cycle1 to 1, cycle2 to 3 and cycle3 to 5

hi mladen,

another question is how to do a phase out/in by a certain degree ? let say i would like to check cycle1 and the other cycle1 but phase forward by 45degree ?

thanks

KL

 

It would need a change in the code in order to achieve that, and it could be done only for "sub-cycles" (sub-waves, it can not be done for a composite values, it only can be done for an underlying sine or cosine waves that are forming the composite value). So, in that case, every sub-wave would be altered then and only then they would reconstruct the composite.

There is a comment line in Goertzel browser that is saying "calculate waves". After that you have 2 lines that go like this :
if (useCosine)

goeWorkPast[k] = amplitude * MathCos(phase+sign*k*2.0*pi/cycle);

else goeWorkPast[k] = amplitude * MathSin(phase+sign*k*2.0*pi/cycle);

[/PHP]

to achieve what you want, you would need to change those lines to following
[PHP]if (useCosine)

goeWorkPast[k] = amplitude * MathCos(phase+sign*k*2.0*pi/cycle+pi/4.0);

else goeWorkPast[k] = amplitude * MathSin(phase+sign*k*2.0*pi/cycle+pi/4.0);

and that would alter every sub-wave's phase by +45 degrees (metatrader uses radians, so pi/4)

 

Another question

Any luck enabling G browser to map cycles to market price to match the start of a cycle with a cycle low and thus achieving relative amplitude determination?

 
mladen:
It would need a change in the code in order to achieve that, and it could be done only for "sub-cycles" (sub-waves, it can not be done for a composite values, it only can be done for an underlying sine or cosine waves that are forming the composite value). So, in that case, every sub-wave would be altered then and only then they would reconstruct the composite. There is a comment line in Goertzel browser that is saying "calculate waves". After that you have 2 lines that go like this :
if (useCosine)

goeWorkPast[k] = amplitude * MathCos(phase+sign*k*2.0*pi/cycle);

else goeWorkPast[k] = amplitude * MathSin(phase+sign*k*2.0*pi/cycle);

[/PHP]

to achieve what you want, you would need to change those lines to following
[PHP]if (useCosine)

goeWorkPast[k] = amplitude * MathCos(phase+sign*k*2.0*pi/cycle+pi/4.0);

else goeWorkPast[k] = amplitude * MathSin(phase+sign*k*2.0*pi/cycle+pi/4.0);

and that would alter every sub-wave's phase by +45 degrees (metatrader uses radians, so pi/4)

appreciate for the response mladen will give it a try

 

Fractals mtf alerts

Hi Mladen!

Do you have time to check this indicator for me again?. The problem is that when I run it on 4H and set the TF to Daily, then it repeats the buy/sell signal all the time, maybe you can set it to only alert me once??. I dont know if its possible since its taking the signals from a higher TF?

Best regards,

Halvard

Reason: