![]() ![]() |
Jun 24 2008, 14:27
Post
#1
|
||
![]() Mataf's VIP ![]() ![]() ![]() ![]() Group: Admin Posts: 2,565 Joined: 8-September 05 From: France Member No.: 1 Demo/Real: Real Leverage: 1:5 |
Qu'est que sont "le nombre de points" dans les tableaux de corrélation ?
D'après Wikipédia : En probabilités et en statistique, étudier la corrélation entre deux ou plusieurs variables aléatoires ou statistiques, c'est étudier l'intensité de la liaison qui peut exister entre ces variables. La liaison recherchée est une relation affine. Dans le cas de deux variables, il s'agit de la régression linéaire. Une mesure de cette corrélation est obtenue par le calcul du coefficient de corrélation linéaire. Ce coefficient est égal au rapport de leur covariance et du produit non nul de leurs écarts types (en anglais standard deviations) . Le coefficient de corrélation est compris entre -1 et 1. Dans nos tableaux de corrélation les deux variables aléatoires sont deux paires de devises, et le nombre de points indique le nombre de data sur lesquelles sont calculées la corrélation. Exemple : Je veux calculer la corrélation horaire entre EURUSD et GBPUSD des 24 dernières heures. Je sélectionne EURUSD et GBPUSD et j'indique un nombre de points à 24. Voici un graphe qui devrait être plus clair : |
|
|
|
||
Jun 24 2008, 15:56
Post
#2
|
|
|
Senior Member ![]() ![]() ![]() Group: Membre Actif Posts: 113 Joined: 14-September 05 Member No.: 89 Broker: oanda, Activtrades Demo/Real: Real Leverage: 1:10 |
Et dans la continuité de ce post, voici le code pour MT4, selectionnez 2 paires et le nombre de points et le tour est joué.
Code //+------------------------------------------------------------------+ //| Correlation_v1.mq4 | //| Copyright © 2006, TrendLaboratory Ltd. | //| http://finance.groups.yahoo.com/group/TrendLaboratory | //| E-mail: igorad2004@list.ru | //+------------------------------------------------------------------+ #property copyright "Copyright © 2006, TrendLaboratory Ltd." #property link "http://finance.groups.yahoo.com/group/TrendLaboratory" #property indicator_separate_window #property indicator_buffers 1 #property indicator_color1 DeepSkyBlue #property indicator_maximum 1.05 #property indicator_minimum -1.05 //---- input parameters extern string Symbol1="GBPUSD"; extern string Symbol2="EURUSD"; extern int cPeriod=20; //---- buffers double Correlation[]; double DiffBuffer1[]; double DiffBuffer2[]; double PowDiff1[]; double PowDiff2[]; //+------------------------------------------------------------------+ //| Custom indicator initialization function | //+------------------------------------------------------------------+ int init() { //---- indicators IndicatorBuffers(5); SetIndexStyle(0,DRAW_LINE); SetIndexBuffer(0,Correlation); SetIndexBuffer(1,DiffBuffer1); SetIndexBuffer(2,DiffBuffer2); SetIndexBuffer(3,PowDiff1); SetIndexBuffer(4,PowDiff2); //---- string short_name="Correlation("+Symbol1+","+Symbol2+","+cPeriod+")"; IndicatorShortName(short_name); SetIndexLabel(0,short_name); SetIndexDrawBegin(0,2*cPeriod); return(0); } //+------------------------------------------------------------------+ //| Custom indicator deinitialization function | //+------------------------------------------------------------------+ int deinit() { //---- //---- return(0); } //+------------------------------------------------------------------+ //| Custom indicator iteration function | //+------------------------------------------------------------------+ int start() { int shift,limit,counted_bars=IndicatorCounted(); if ( counted_bars < 0 ) return(-1); if ( counted_bars ==0 ) limit=Bars-cPeriod-1; if ( counted_bars < 1 ) for(int i=1;i<2*cPeriod;i++) Correlation[Bars-i]=0; if(counted_bars>0) limit=Bars-counted_bars; limit--; for( shift=limit; shift>=0; shift--) { //---- DiffBuffer1[shift]=iClose(Symbol1,0,shift)-iMA(Symbol1,0,cPeriod,0,MODE_SMA,PRICE_CLOSE,shift); DiffBuffer2[shift]=iClose(Symbol2,0,shift)-iMA(Symbol2,0,cPeriod,0,MODE_SMA,PRICE_CLOSE,shift); PowDiff1[shift]=MathPow(DiffBuffer1[shift],2); PowDiff2[shift]=MathPow(DiffBuffer2[shift],2); double u=0,l=0,s=0; for( i = cPeriod-1;i >= 0;i--) { u += DiffBuffer1[shift+i]*DiffBuffer2[shift+i]; l += PowDiff1[shift+i]; s += PowDiff2[shift+i]; } if(l*s >0) Correlation[shift]=u/MathSqrt(l*s); } //---- return(0); } //+------------------------------------------------------------------+ This post has been edited by betino83: Jun 24 2008, 19:48 |
|
|
|
Jun 24 2008, 17:46
Post
#3
|
|
![]() Mataf's VIP ![]() ![]() ![]() ![]() Group: Admin Posts: 2,565 Joined: 8-September 05 From: France Member No.: 1 Demo/Real: Real Leverage: 1:5 |
En rafraichissant ça devrait être correct maintenant
|
|
|
|
![]() ![]() |
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:
Similar Topics
| Topic Title | Replies | Topic Starter | Views | Last Action | |||
|---|---|---|---|---|---|---|---|
![]() |
1 | Arnaud Jeulin | 3,138 | 13th September 2005 - 20:58 Last post by: Arnaud |
|||
![]() |
2 | Arnaud Jeulin | 4,105 | 18th July 2008 - 15:04 Last post by: Damien |
|||
![]() |
0 | FXPrice | 1,591 | 19th September 2005 - 22:12 Last post by: FXPrice |
|||
![]() |
0 | FXPrice | 1,397 | 18th September 2005 - 23:44 Last post by: FXPrice |
|||
![]() |
0 | FXPrice | 1,240 | 22nd September 2005 - 22:15 Last post by: FXPrice |
|||
| Lo-Fi Version | Time is now: 1st December 2008 - 21:02 |
Chat
Forex Forum
English
Français
- flyersummer: A New Trading Week Brings A Heavy Interest In Us Dollar Pairs
Dec 1, 15:12 GMT - flyersummer: 1-dec: Eur/usd
Dec 1, 14:52 GMT - flyersummer: 28-nov: Eur/usd
Nov 28, 15:55 GMT - JohnLai: Where The Eur Will Go In The Long Term?
Nov 28, 9:15 GMT - www.orsotoro.blogspot.com: Hello!
Nov 27, 11:56 GMT - cable: Gbp/usd
Nov 26, 6:22 GMT - gbp..jpy: Speculative Buy On Eur Usd
Nov 26, 0:39 GMT - calfx: Why Most Newbie Traders Fail?
Nov 25, 16:10 GMT - flyersummer: November 24th Eur/usd Outlook
Nov 24, 15:48 GMT - Mockingbird: difference between a limit- and a stop-order
Nov 24, 13:49 GMT
- madjes: [videobourse] Analyses Techniques Quotidiennes Du Forex En Vidéo
Dec 1, 18:33 GMT - Arnaud Jeulin: Saxo Bank Suspend Un Directeur
Dec 1, 17:28 GMT - fetha: Le Royaume Uni Pense À L'euro, Bientôt La Fin De La Livre Sterling ?
Dec 1, 12:35 GMT - Ulysse: Achat Spéculatif Sur L'euro Dollar
Nov 30, 22:07 GMT - christopher@forex.fr: Bilan De La Semaine
Nov 30, 9:46 GMT - www.tribuforex.fr: Résistances Et Supports
Nov 29, 3:38 GMT - damtoul: Ea Parabolic Sar
Nov 28, 19:17 GMT - Zernamit: Scalping À Partir Du Carnet D'ordre
Nov 27, 18:02 GMT - Ulysse: Recherche Programmateur Mq4
Nov 27, 10:58 GMT - touco: Saxo Banque : 1er Trade Et Ça Commence Mal !
Nov 27, 7:19 GMT





Jun 24 2008, 14:27







