Here is the code function that will return the chart period in the nicely formation text line.
Example: (if EA is running on 1hour chart)
chartperiod = periodToString(Period()) // will return 1 HourCode:string periodToString(int tf)
{
string tfString;
switch (tf)
{
case 1: tfString = "1 Min"; break;
case 5: tfString = "5 Min"; break;
case 15: tfString = "15 Min"; break;
case 30: tfString = "30 Min"; break;
case 60: tfString = "1 Hour"; break;
case 240: tfString = "4 Hour"; break;
case 1440: tfString = "Daily"; break;
case 10080: tfString = "Weekly"; break;
case 40320: tfString = "Monthly"; break;
default: tfString = "Unknown";
}
return (tfString);
}
Senin, 26 November 2012
Numeric Chart Period to Text String Format
Langganan:
Posting Komentar (Atom)
Tidak ada komentar:
Posting Komentar