MQL4 - automated forex trading   /  

Code Base

ODL Securities

Code Base  Libraries  Z-Score Calculation To post a new code, please log in or register

This script is for
MetaTrader 4
Download MT 4 - 3.5 Mb

Mobile trading!
Buy a license and be mobile in your trading!

Name:
Z-Score Calculation [ ru | cn ]
Author: Rosh (2008.02.27 09:49)
Downloaded: 480
Download:
 Z_include.mqh (5.0 Kb) View
 NormalProbability.mqh (13.3 Kb) View
The include file named Z_include.mqh contains a function that calculates the following parameters on the data array:
  • Max - the maximum value;
  • Min - the minimum value;
  • universal mean - the mean value;
  • standard deviation - mean-squared deviation (unbiased estimate);
  • skew;
  • kurtosis;
  • Z-score on the data array.

You can find the description of the term of Z-score in the article Mathematics in Trading: How to Estimate Trade Results

The file should be placed in the folder of \experts\include\...

An exemplary script that calculates Z-score on a trading account:

//+------------------------------------------------------------------+
//|                                                        Get_Z.mq4 |
//|                      Copyright © 2007, MetaQuotes Software Corp. |
//|                                        http://www.metaquotes.net |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2007, MetaQuotes Software Corp."
#property link      "http://www.metaquotes.net"
 
#include <Z_include.mqh>
//+------------------------------------------------------------------+
//| script program start function                                    |
//+------------------------------------------------------------------+
int start()
  {
//----
   Print("Z-score of trades made on account ",AccountNumber()," is equal to ",DoubleToStr(getZ(),2));   
//----
   return(0);
  }
//+------------------------------------------------------------------+


The header file, NormalProbability.mq4, contains an example of normal probability using the array.
0 comments  To post a new comment, please log in or register