想要分享其实不容易,不是贴出来就能用的那么简单。
在学习mt4设计之初,开发了很多公共的辅助库类函数。
像这个。
[C++] 纯文本查看 复制代码class KCoder
{
private:
public:
string symbolDivide(string symbolInput);
bool tts(string text);
void ObjectSetPosition(int chart_ID=0,string ObjecName="Object",
int x_distance=10,
int y_distance=10,
ENUM_BASE_CORNER corner=CORNER_LEFT_UPPER);
void ObjectSetControl(int chart_ID=0,string ObjecName="Object",
const bool selectable=false,
const bool selected=false,
const bool hiddenInList=true,
const int z_order=0);
void ObjectSetOutlook(int chart_ID=0,string ObjecName="Object",
const bool asBackground=true,
const int xSize=50,
const int ySize=20,
const color clrBackGround=clrWhite,
ENUM_ANCHOR_POINT anchor=ANCHOR_LEFT_UPPER,
const int editAlign=ALIGN_RIGHT,
const int angle=0);
int Array_Search_String(
const string &array[],// array for search
string value,// what is searched for
int count=WHOLE_ARRAY,// count of elements to search for
int startFrom=0,// starting position
int direction=MODE_ASCEND // search direction
);
int Array_Search_Time(
const datetime &array[],// array for search
datetime value, // what is searched for
int count=WHOLE_ARRAY, // count of elements to search for
int startFrom=0,// starting position
int direction=MODE_ASCEND // search direction
);
string errorPrint(int id);
double currencyRate(string Currency,int timef,int shift);
double currency_Real_Value(string Currency,int timef,int shift);
double currency_Real_Value_V2(string Currency,int timef,int i_shift,ENUM_APPLIED_PRICE applied_price=PRICE_CLOSE);
long currency_Volume(string Currency,int timef,int shift);
string currency_Compare(int period);
int currency_Compare_single(int period,int index);
string StringGetString(string Str,string startBy,string endWith);
int get_File_Size(string path);
string get_DataPath_File();
double currencyRSI(string Currency,int timef,int period,int applied_pcrice,int shift);
//change function
int str_to_currency_index(string strInput);
color symbol_to_color(string symbol);
int time_to_index(datetime TIME);
string num_To_Shape(int i,string shapeType);
string TimeFrame_to_String(int arg);
int String_to_TimeFrame(string Str);
string DoubleToStrMorePrecision(double number,int precision);
string second_To_Time(int sec);
string second_To_DigitTimer(int num);
string bool_to_string(bool bo=true,int type=0,bool upcase=false);
int weekOfYear(datetime time);
string time12To24(string timeStr);