FXCM Forex Trading

Function Collection (MQ4)

Moderator: admin

Function Collection (MQ4)

Postby Apprentice » Sat Oct 22, 2016 6:10 am

Here i will, u can post the functions that you can use as part of your own implementation.
User avatar
Apprentice
FXCodeBase: Confirmed User
 
Posts: 16984
Joined: Thu Dec 31, 2009 11:59 am
Location: Zagreb, Croatia

MathTanh

Postby Apprentice » Sat Oct 22, 2016 6:11 am

Code: Select all
double MathTanh(double x)
{
   double exp;
   double returnNum;
   if(x>0)
     {
       exp=MathExp(-2*x);
       returnNum= (1-exp)/(1+exp);
       return (returnNum);
     }
   else
     {
       exp=MathExp(2*x);
       returnNum=(exp-1)/(1+exp);
       return (returnNum);
     }
}
User avatar
Apprentice
FXCodeBase: Confirmed User
 
Posts: 16984
Joined: Thu Dec 31, 2009 11:59 am
Location: Zagreb, Croatia


Return to Indicator Development

Who is online

Users browsing this forum: No registered users and 1 guest