k-means clustering in mql4

 

I'm working on a 1D k-means clustering code.

I have defined 25 Cluster Means and I need to go through the available data and assign each value to the closest Mean.

How can I do that without having to create 25 different arrays to which I should assign the data?

 
What about using R from the beginning of your calculation?
 

I wasn't aware of it, thanks! I'll take a look at the article.

Is it available for Mql4 though? 

 
It includes a mqh file  (look at the to of the mq5-file) so try it, I think it should work as they connect only to the R-packege, which you have to install - of course.
Reason: