• Home
  • Forums
  • Trades
  • News
  • Calendar
  • Market
  • Brokers
  • Login
  • Join
  • User/Email: Password:
  • 2:33pm
Menu
  • Forums
  • Trades
  • News
  • Calendar
  • Market
  • Brokers
  • Login
  • Join
  • 2:33pm
Sister Sites
  • Metals Mine
  • Energy EXCH
  • Crypto Craft

Options

Bookmark Thread

First Page First Unread Last Page Last Post

Print Thread

Similar Threads

TMA CG MTF Oscillator 0 replies

Mtf accelerator oscillator 12 replies

Awesome Oscillator MTF Tape 3 replies

MTF-OnChart-Stochastic Oscillator 0 replies

Need Alert for MTF Awesome Oscillator AO 10 replies

  • Platform Tech
  • /
  • Reply to Thread
  • Subscribe
  • 80
Attachments: MT4 MTF Correlation table and Correlation oscillator indicators
Exit Attachments
Tags: MT4 MTF Correlation table and Correlation oscillator indicators
Cancel

MT4 MTF Correlation table and Correlation oscillator indicators

  • Last Post
  •  
  • Page 1 23456 8
  • Page 1 234 8
  •  
  • Post #1
  • Quote
  • First Post: Edited Jan 6, 2017 9:37am Oct 23, 2013 10:38am | Edited Jan 6, 2017 9:37am
  •  9047
  • Joined Jun 2011 | Status: Nominal | 304 Posts
ninety47 MTF Correlation Table
Current Version: v1.2.5
Release date: 16 December 2016
Change log: post #125
Download: post #125

Attached Image (click to enlarge)
Click to Enlarge

Name: ninety47_CorrelationTable_v1.2.5_screenshot2.png
Size: 58 KB


ninety47 MTF Correlation Oscillator
Current Version: v1.0 beta
Release date: January 6 2017
See: post #129


Attached Image (click to enlarge)
Click to Enlarge

Name: ninety47_CorrelationOscillator_v1.0_beta.png
Size: 51 KB
  • Post #2
  • Quote
  • Oct 23, 2013 6:44pm Oct 23, 2013 6:44pm
  •  9047
  • Joined Jun 2011 | Status: Nominal | 304 Posts
Correlation oscillator

Attached Image (click to enlarge)
Click to Enlarge

Name: euraud_corr_oscillator_demo.gif
Size: 27 KB


The Correlation Oscillator (CO) is limited to performing and displaying 8 correlation coefficient calculations with the chart symbol. The limitation is due to MQL4's indicator buffer model - but any more than 8 lines on a chart is starting to get hard to read anyway. It has a legend display on the upper right hand side of the chart that prints the most recent correlation values for the selected symbols.

As the user you can control the:

  1. symbols the calculations is done for,
  2. period the rolling calculation is done over,
  3. price that is used in the calculation,
  4. the correlation scale factor,
  5. colours and style of the lines being drawn,
  6. drawing of the legend, and
  7. legends position and font.

The list of symbols is passed to the indicator as a delimited string in symbols parameter. The default delimiter is a a comma and can be change by setting the
symbols_sep parameter.

Attached Image

Symbols entry example



The period can be any positive integer value but note that the bigger it is the more computation that will be required e.g. if you are compare the 8 symbols then you'll be handling (period) x 8 calculations on each new bar. This shouldn't be a problem for most modern computers but MT4 is single thread so you will likely notice a slow down.

You determine the value to be passed to the correlation function call via the price_mode parameter. The price_mode parameter accepts an integer value. It has six options:

  1. 0 = close
  2. 1 = open
  3. 2 = high
  4. 3 = low
  5. 4 = median
  6. 5 = typical
  7. 6 = weighted

You can consult the MT4 help to learn what each of the values are.

The correlation coefficient lies in the interval [-1, 1]. Buy default the value will be scaled by a factor of 100.0, adjusting the interval from [-100,100]. This was added at the request of some user who where more comfortable with the large values. You can set the scale factor through the scale_factor parameter. It will accept any floating point value - so if you want to scale by Pi to 10 decimal places knock yourself out.

The line colours and styles are set just like any other MT4 indicator.

The legend display the most recent correlation value for each symbol the indicator is correlating. If you find the legend annoying you can simply turn it off by setting the legend_show parameter to false. The legend is drawn by default.

You can also adjust the legends:

  1. margins,
  2. row height,
  3. label width,
  4. cell width,
  5. font, and
  6. font size.

Have fiddle with these if you don't like the defaults.

Enjoy!

Next post the correlation table.

 
 
  • Post #3
  • Quote
  • Oct 23, 2013 7:47pm Oct 23, 2013 7:47pm
  •  9047
  • Joined Jun 2011 | Status: Nominal | 304 Posts
Multiple time frame correlation table

Attached Image (click to enlarge)
Click to Enlarge

Name: eurusd_corr_table_demo.gif
Size: 25 KB


This indicator only reports the latest value of the correlation between the chart symbol and any number of chosen symbols on the user selected time frames. The available time frames include all the MT4 defaults - M1 through to Monthly bars.

Warning: If you're correlating 5 symbols to the chart symbol on 4 time frames you will calculating the correlation of 5 x 4 = 20 time series. You may notice the MT4 molasses feature even if you have good hardware. This is why the correlation function was passed down to faster C++ code.

Like the Correlation Oscillator you supply a delimited string of symbols via the symbols parameter. The delimiter can also be changed to your through the symbol_sep parameter.

You can chose which time frames you would like calculate the correlation - if you don't want to calculate the correlation for a given time frame sets is show parameter to false. The defaults are:

Inserted Code
extern bool    show_m1 = false;
extern bool    show_m5 = true;
extern bool    show_m15 = false;
extern bool    show_m30 = true;
extern bool    show_h1 = true;
extern bool    show_h4 = true;
extern bool    show_d1 = true;
extern bool    show_w = false;
extern bool    show_mn = false;

Like the Correlation Oscillator you can determine the period for the moving correlation calculation. The main difference being you can set a period for each time frame. The default values are:

Inserted Code
extern int     period_m1 = 90;
extern int     period_m5 = 90;
extern int     period_m15 = 90;
extern int     period_m30 = 90;
extern int     period_h1 = 90;
extern int     period_h4 = 90;
extern int     period_d1 = 90;
extern int     period_w = 12;
extern int     period_mn = 12;



As with the oscillator the price mode can also be set to one of:

  1. 0 = close
  2. 1 = open
  3. 2 = high
  4. 3 = low
  5. 4 = median
  6. 5 = typical
  7. 6 = weighted

There isn't a scale factor for this indicator but you can colour the field based upon strength of the correlation. You can set 4 threshold values to indicate the strength of the current linearity. The levels and parameters are:

  1. level_neutral: intend to highlight states of limited or no correlation. Is less than level_weak.
  2. level_weak: the strength and direction of the linearity isn't very apparent e.g. could be falling out or possibly entering a correlated stated. Is less than level_moderate.
  3. level_moderate: There is definitely some measurable linearity but don't bet the house on it. Is less than level_strong.
  4. level_strong: Draw this things on top of each other and well they'll look like the same thing (if positively correlated) or the same thing just running away from each other if the correlation is negative.

The default values are:

Inserted Code
extern double  level_neutral = 0.0;
extern double  level_weak = 0.2;
extern double  level_moderate = 0.5;
extern double  level_strong = 0.8;

The correlation values are also highlighted based upon their level. You can change these colours through these parameters:

  1. text_colour: White. This is the default table colour - applied to symbols and time frames.
  2. text_colour_neutral: DarkGray.
  3. text_colour_weak: DeepSkyBlue.
  4. text_colour_moderate: DeepPink.
  5. text_colour_strong: Red.
  6. text_colour_error: Lime.

You can also adjust the tables:

  1. margins,
  2. row height,
  3. label width,
  4. cell width,
  5. font, and
  6. font size.

And it should be working nicely.

 
 
  • Post #4
  • Quote
  • Oct 25, 2013 4:49am Oct 25, 2013 4:49am
  •  juhanimi
  • Joined Feb 2009 | Status: Member | 2,293 Posts
Hi
everything done, but ....., help?


2013.10.25 11:45:17 ninety47_correlation_table EURUSD,M1: cannot load library 'libninety47stats-0.1.dll' (error 126)
 
 
  • Post #5
  • Quote
  • Oct 25, 2013 4:58am Oct 25, 2013 4:58am
  •  FerruFx
  • Joined May 2007 | Status: MT4/MT5 EAs/Indicators/Alerts coder | 6,428 Posts
Quoting juhanimi
Disliked
Hi everything done, but ....., help? 2013.10.25 11:45:17 ninety47_correlation_table EURUSD,M1: cannot load library 'libninety47stats-0.1.dll' (error 126)
Ignored
1/ You don't have libninety47stats-0.1.dll in the /libraries/ folder

or

2/ You didn't allowed DLL in the settings
MT4/MT5 EAs/Indicators/Alerts coder
 
 
  • Post #6
  • Quote
  • Oct 25, 2013 5:05am Oct 25, 2013 5:05am
  •  juhanimi
  • Joined Feb 2009 | Status: Member | 2,293 Posts
libninety47stats-0.1.dll is in<MT4_HOME>/experts/libraries/libninety47stats-0.1.dll
and DLL are enabled
what else it can be?
 
 
  • Post #7
  • Quote
  • Oct 25, 2013 5:14am Oct 25, 2013 5:14am
  •  9047
  • Joined Jun 2011 | Status: Nominal | 304 Posts
Quoting FerruFx
Disliked
{quote} 1/ You don't have libninety47stats-0.1.dll in the /libraries/ folder or 2/ You didn't allowed DLL in the settings
Ignored
Hi juhanimi,

What FerruFX said.

Assuming you copied the DLL file into "<MT4_HOME>/experts/libraries" then next step is make sure DLL imports are allowed.
When you add the indicator to the chart MT4 will prompt you with a settings window. Make sure the "Allow DLL imports" check box is set. Also as I mentioned above DLL imports can also be allowed through the MT4 options panel.

For quick reference the DLL can be downloaded from here: https://raw.github.com/ninety47/mt4-...7stats-0.1.dll
(I'd attached the file directly but DLLs aren't allowed as attachments).

If your not sure about installing indicators and libraries into MT4 I urge you to use Google - there is a stack of information out there.

Let me know if you have any further hassles.

ninety47
 
 
  • Post #8
  • Quote
  • Oct 25, 2013 5:21am Oct 25, 2013 5:21am
  •  juhanimi
  • Joined Feb 2009 | Status: Member | 2,293 Posts
Everything is as should be, but does not load that library, don`t know what to say to that.
 
 
  • Post #9
  • Quote
  • Oct 25, 2013 5:25am Oct 25, 2013 5:25am
  •  FerruFx
  • Joined May 2007 | Status: MT4/MT5 EAs/Indicators/Alerts coder | 6,428 Posts
It may be a Windows issue.

Try to Google "error 126 dll mt4" ...
MT4/MT5 EAs/Indicators/Alerts coder
 
 
  • Post #10
  • Quote
  • Oct 25, 2013 5:25am Oct 25, 2013 5:25am
  •  juhanimi
  • Joined Feb 2009 | Status: Member | 2,293 Posts
Attached Image (click to enlarge)
Click to Enlarge

Name: metatrader 4 finfx.png
Size: 78 KB
 
 
  • Post #11
  • Quote
  • Oct 25, 2013 7:02am Oct 25, 2013 7:02am
  •  9047
  • Joined Jun 2011 | Status: Nominal | 304 Posts
Based on the decorations/them on the window in your screenshot I'm guessing your using Windows XP?
I compiled the DLL using Visual C++ 2010 Express Edition on Windows Vista 64-bit and I've successfully used it with Metatrader running on Windows 7 and Wine under Ubuntu Linux.

I not certain if anyone has run the DLL on Windows XP, so it might be an issue. But I'm pretty sure it should work since its just vanilla C/C++ code and nothing fancy.

Might be a silly question: Have your tried to restart MT4?

Also where have you installed Metatrader. If you going to play with DLLs and compile scripts, indicators and libraries its best to not have it living under "Program Files" (e.g. C:\Program Files\Metatrade" is usually the default location). The program files folder is "protected" so you can get file permission/access issues if you didn't copy them in as an administrator (but I think this more of a Windows 2000 and higher issue).

FerruFX have you downloaded and got it work by any chance?
 
 
  • Post #12
  • Quote
  • Oct 25, 2013 7:19am Oct 25, 2013 7:19am
  •  juhanimi
  • Joined Feb 2009 | Status: Member | 2,293 Posts
yes, it is old laptop xp, I`ll try in weekend with linux/wine
i think your correlation table has strong potential
we`ll see
thanks
 
 
  • Post #13
  • Quote
  • Oct 26, 2013 2:00am Oct 26, 2013 2:00am
  •  juhanimi
  • Joined Feb 2009 | Status: Member | 2,293 Posts
not working with linux either , looks same
is there anyone who did get this to work like it should?
 
 
  • Post #14
  • Quote
  • Oct 26, 2013 2:05am Oct 26, 2013 2:05am
  •  FerruFx
  • Joined May 2007 | Status: MT4/MT5 EAs/Indicators/Alerts coder | 6,428 Posts
Quoting juhanimi
Disliked
not working with linux either
Ignored
So it is certainly a DLL compilation compatibility issue.
MT4/MT5 EAs/Indicators/Alerts coder
 
 
  • Post #15
  • Quote
  • Oct 26, 2013 2:30am Oct 26, 2013 2:30am
  •  juhanimi
  • Joined Feb 2009 | Status: Member | 2,293 Posts
yes, i was surprised yesterday that XP had a problem, because i don`t remember when i have had problems with XP
 
 
  • Post #16
  • Quote
  • Oct 26, 2013 2:51am Oct 26, 2013 2:51am
  •  9047
  • Joined Jun 2011 | Status: Nominal | 304 Posts
Sorry your have problems.

I'll rebuild it on Monday and post the version somewhere you can download it. I'll also post the source code up on Github for download. I haven't done a lot Windows development so I may have done something wrong in build process. I think the Windows alternative to "ldd" is "depend.exe". I'm away from my workstation at the moment but it would be a great help of you could run that tool against the dll so we know if your missing dependencies or if I made a mistake.

ninety47
 
 
  • Post #17
  • Quote
  • Oct 28, 2013 12:30am Oct 28, 2013 12:30am
  •  9047
  • Joined Jun 2011 | Status: Nominal | 304 Posts
Quoting juhanimi
Disliked
yes, i was surprised yesterday that XP had a problem, because i don`t remember when i have had problems with XP
Ignored
Hi juhanimi,

After a bit of research I think the issues is that you might be missing the "Microsoft Visual C++ 2010 Redistributable Package". To install it you need make sure you're running XP service pack 3 and then install Microsoft Visual C++ 2010 Redistributable Package, which can be download from here. With a bit of luck this should do the trick. To make it work with wine you'll need to copy DLLs from the redistributable package into your WINE installation.

Let me me know if this helps. I'll post the code for to GitHub in the next 48 hours.

Cheers,

ninety47.
 
 
  • Post #18
  • Quote
  • Oct 28, 2013 12:36am Oct 28, 2013 12:36am
  •  shervinm
  • | Membership Revoked | Joined Dec 2012 | 25 Posts
i download and test it

i have a same problem ( error 126) in win7
 
 
  • Post #19
  • Quote
  • Oct 28, 2013 2:02am Oct 28, 2013 2:02am
  •  juhanimi
  • Joined Feb 2009 | Status: Member | 2,293 Posts
"I compiled the DLL using Visual C++ 2010 Express Edition on Windows Vista 64-bit and I've successfully used it with Metatrader running on Windows 7 and Wine under Ubuntu Linux."

Looks like problem is with that 64.bit., Needs 64-bit platform to work properly.

Thanks anyway.
 
 
  • Post #20
  • Quote
  • Oct 28, 2013 2:50am Oct 28, 2013 2:50am
  •  shervinm
  • | Membership Revoked | Joined Dec 2012 | 25 Posts
hi
thanks for your reply
my windows is 64bit home premium
and i have that problem ( error 126)
 
 
  • Platform Tech
  • /
  • MT4 MTF Correlation table and Correlation oscillator indicators
  • Reply to Thread
    • Page 1 23456 8
    • Page 1 234 8
0 traders viewing now
  • More
Top of Page
  • Facebook
  • Twitter
About FF
  • Mission
  • Products
  • User Guide
  • Media Kit
  • Blog
  • Contact
FF Products
  • Forums
  • Trades
  • Calendar
  • News
  • Market
  • Brokers
  • Trade Explorer
FF Website
  • Homepage
  • Search
  • Members
  • Report a Bug
Follow FF
  • Facebook
  • Twitter

FF Sister Sites:

  • Metals Mine
  • Energy EXCH
  • Crypto Craft

Forex Factory® is a brand of Fair Economy, Inc.

Terms of Service / ©2023