Very smooth MA without lag - page 2

 
scorpion:
sccz97, u have formula of jma? I cannot make any understanding from the mql and mq4.

Unfortunately no I don't have the formula. I only have the mql. But the code is pretty simple and I'm hoping i can convert it to .net so long as i can decipher some of the metatrader functions the indexarray. If I can get it working in .net and step through then I'll be able to reconstruct the formula so any help in getting it working in .net would be great

thanks

steve

 

Have finally written a .NET class for the JMA. However, I'm still slighlty confused as t ohow it works. Will post a detailed description once I figure this baby out. Have used the jma with CCI and the results are superb

 
sccz97:
Have used the jma with CCI and the results are superb

That line triggered my attention

Can you tell us/me a bit more about that strategy?

 

the basic formula for cci is

(typical price) - (smatp(period))

-------------------------------

(0.015) x (mean deviation)

All you need to do is substitute the values of the sma with the jma and voila. You can play aroudn with whether you want to calculate the jma based on the close price or the typical price... the choice is yours. The result is a cci that crosses 0 earlier which is what we all want!

 

All you need is ............?????????

Can you send as an indicator, please?

 
chievo11:
All you need is ............????????? Can you send as an indicator, please?

the CCI indicator I've written using the JMA is in a .NET application so as such I have no mql file for you. Sorry, I don't know how to program in mql

 

I've noticed some slight inconsistencies in my .net JMA. Whilst the code seems to be sound, I'm not sure it's smoothing all that well. Woudl someone be able to take a look at a .net class if I were to post?

 

Yes, i'm willing to take a look at the class to get some idea how it works.

 
scorpion:
Yes, i'm willing to take a look at the class to get some idea how it works.

Heh, I've managed to sort it out. I missed whacking in some brackets so it was preventing the algorthim from looking back at enough samples to smooth the curve. It's all working now. I'll post my set of classes once I've updated the CCI properly. Hopefully you can put it to good use

 

here are the libraries. Feel free to play around. I've still not decided the best way to go about using jma with cci.

there are a few combinations but it boils down to:

JMA using closing price, typical prices or weighted typical price

CCI using JMA from either of the above and worign out the deviation from again either closing price, typical prices or weighted typical price.

Have yet to determine whihc the best combination is. While it's still faster than the regular CCI based of SMA it still lags the JMAs in terms of crossover. It's quite possible that the JMA's shoudl be used to trade and CCI to give the go ahead depending on the first differential of the CCI.

I'm currently working backtesting all possible JMA crossovers and CCIs. It's quite possible that the simple JMA crossover could be the best indicator, and that all you'd require would be to determine which two periods of the JMA to choose. The factors that would need to be taken into account are the spread of the two JMAs, first differnetial of the CCI, possibly a weighted implied volatility and correlation.

Anyway, let me know if you can make use of the libraries. Unfortunately they are a one off calculation and not cumulative. I've yet to add that as a method, but the calculations are so fast at the moment I haven't bothered to code it.

P.S. the code is pretty shoddy

Files:
ClassLib.zip  4 kb
Reason: