Function Collection (MQ4)
Posted: 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.
Your last stop on a way to find a fast growing community of forex traders and software developers. Best forex charts indicators are available here for download. Custom development of indicators and translation to .LUA is also available on request.
http://fxcodebase.com/code/
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);
}
}
struct TestStruct
{
int value1;
double value2;
string value3;
};
TestStruct Test[]
ArrayResize(Test, 100); // Give it a size of 100
ArraySetAsSeries(Test, true); // Turn the array around so the element 0 is the far right one
// Set the array to read from left to right as a normal array does
ArraySetAsSeries(Test, false);
// Add a new empty element to the end
ArrayResize(Test, 101);
// Set the array to read from right to left similar to the bars on a chart
ArraySetAsSeries(Test, true);
// Now the array has been turned around delete the last element
ArrayResize(Test, 100);