1 Star 0 Fork 4

sunwy/mql4

forked from 航耍耍/mql4 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
老虎EA.mq4 37.78 KB
一键复制 编辑 原始数据 按行查看 历史
航耍耍 提交于 2021-11-09 08:24 . 123123123123
#property copyright "QQ:1403331509"
int 帐号限制 = 0;//只修改等号右边的数字 标点符号不要动 0=不限制帐号
datetime 时间限制 = D'2025.5.1';
string 作者QQ = "1403331509";
extern string 平台选择 = "IC TickMill FxPro 万致 英诺 AXI 激石 ETX 等杠杆400倍以上的平台";
extern string 加载品种周期 = "只加载到一个外汇品种上,图表周期:H1";
extern int 单向最大持仓单数 = 10;
extern double 起始下单量 = 0.01;//按1w下0.01起步
extern double 翻倍 = 2;
extern double 加码间隔点数 = 75;
extern double 加码间隔倍数 = 1;//设置大于1为递增,小于1为递减,等于1为固定间隔
extern double 第一单盈利点数 = 40;
extern double 单货币总体盈利点数 = 5;
extern double 最后一单止损点数 = 0;//0 = 不止损
extern double 单货币总亏损平仓 = 0.0;
extern double 单货币总盈利平仓 = 0.0;
extern int 滑点 = 3;
extern int 定单识别码 = 958999848;
extern string 定单注释 = "QQ:375744140飞猫EA";
extern string iBands布林指标控制第一单 = "上轨以上做空,下轨以下做多";
extern int iBands_平均周期 = 20;
extern int iBands_偏差 = 2;
extern int iBands_平移 = 0;
extern int iBands_应用于 = PRICE_CLOSE;
extern string iMA均线指标控制所有单 = "当前价格在均线以上只做多以下只做空";
extern bool 启用MA控制大方向 = false;
extern int iMA_平均周期 = 100;
extern int iMA_平移 = 0;
input ENUM_MA_METHOD iMA_移动平均 = MODE_SMA;
input ENUM_APPLIED_PRICE iMA_应用于 = PRICE_CLOSE;
extern string TimeC = "====平台时间参数====";
extern bool 启用时间控制 = FALSE;
extern int 开始小时 = 18;
extern int 开始分钟 = 0;
extern int 结束小时 = 7;
extern int 结束分钟 = 0;
extern bool 允许所有品种双向交易 = false;//开启之后以下参数无效
enum BuyOrSell0 {多空都做 = 2,只做多 = 0,只做空 = 1,不启用 = 3};
input BuyOrSell0 GBPUSD = 2;
input BuyOrSell0 EURUSD = 2;
input BuyOrSell0 USDJPY = 2;
input BuyOrSell0 USDCAD = 2;
input BuyOrSell0 AUDUSD = 2;
input BuyOrSell0 EURGBP = 2;
input BuyOrSell0 EURCHF = 2;
input BuyOrSell0 EURJPY = 2;
input BuyOrSell0 CADJPY = 2;
input BuyOrSell0 AUDNZD = 2;
input BuyOrSell0 AUDCAD = 2;
input BuyOrSell0 AUDCHF = 2;
input BuyOrSell0 AUDJPY = 2;
input BuyOrSell0 CHFJPY = 2;
input BuyOrSell0 CADCHF = 2;
input BuyOrSell0 NZDJPY = 2;
input BuyOrSell0 NZDUSD = 2;
input BuyOrSell0 GBPNZD = 2;
input BuyOrSell0 NZDCAD = 2;
input BuyOrSell0 NZDCHF = 2;
input BuyOrSell0 GBPCAD = 2;
input BuyOrSell0 USDCHF = 2;
input BuyOrSell0 EURCAD = 2;
input BuyOrSell0 EURAUD = 2;
input BuyOrSell0 GBPCHF = 2;
input BuyOrSell0 EURNZD = 2;
input BuyOrSell0 GBPAUD = 3;
input BuyOrSell0 GBPJPY = 2;
#define SymbolTotal0 28
int Gi_144[SymbolTotal0];
int Gi_148[SymbolTotal0];
string SymbolName1[] = {"GBPUSD","EURUSD","USDJPY","USDCAD","AUDUSD","EURGBP","EURCHF","EURJPY",
"CADJPY","AUDNZD","AUDCAD","AUDCHF","AUDJPY","CHFJPY","CADCHF","NZDJPY","NZDUSD","GBPNZD",
"NZDCAD","NZDCHF","GBPCAD","USDCHF","EURCAD","EURAUD","GBPCHF","EURNZD","GBPAUD","GBPJPY"};
double Gi_312;
double Gi_313;
double G_order_open_price_152;
double G_order_open_price_160;
double Gd_168;
double Gd_176;
double Gd_184;
double Gd_192;
double Gd_200;
double Gd_208;
double Gd_216;
double Gd_218;
double G_price_230;
double G_price_232;
bool Gi_256;
int G_pos_260;
int G_ticket_264;
int Gi_268;
int Gi_269[SymbolTotal0];
int Time3[SymbolTotal0];
int Gi_272;
int Gi_276 = 1;
int Gi_280;
double POINT;
double G_lots_290 = 0.02;
double G_lots_292 = 0.02;
double Gd_300 = 1.5;
double icustom0;
double icustom1;
double icustom2;
int Gi_308 = 20;
int Gi_314 = 2;
int Gi_315 = 2;
int Gi_316 = 2;
double Gd_320 = 0.0;
double Gd_328 = 0.0;
int Gi_336 = 3;
int G_magic_340 = 10533;
string G_comment_344 = "";
bool G_bool_328 = FALSE;
bool G_bool_330 = FALSE;
int Gi_432 = 0;
int Gi_436 = 1;
int Gi_440 = 23;
int Gi_444 = 59;
string Gsa_720[14];
bool Gi_273;
bool Breturn;
int gi_138;
string g_symbol_220;
int Bands_period;
int deviation;
int bands_shift;
int Bands_applied_price;
string SymbolName0;
int i0;
double AskAsk;
double BidBid;
int DIGITS;
int Time6 = 0;
bool GlobalDel = true;
bool OpenNew = true;
bool Gb_100;
int ma_period;
int ma_shift;
int ma_method;
int ma_applied_price;
int OnInit() {
EventSetMillisecondTimer(300);
ArrayInitialize(Gi_144,0);
ArrayInitialize(Gi_148,0);
ArrayInitialize(Time3,0);
if(允许所有品种双向交易 || IsTesting()) ArrayInitialize(Gi_269,2);
else {
Gi_269[0] = GBPUSD;
Gi_269[1] = EURUSD;
Gi_269[2] = USDJPY;
Gi_269[3] = USDCAD;
Gi_269[4] = AUDUSD;
Gi_269[5] = EURGBP;
Gi_269[6] = EURCHF;
Gi_269[7] = EURJPY;
Gi_269[8] = CADJPY;
Gi_269[9] = AUDNZD;
Gi_269[10] = AUDCAD;
Gi_269[11] = AUDCHF;
Gi_269[12] = AUDJPY;
Gi_269[13] = CHFJPY;
Gi_269[14] = CADCHF;
Gi_269[15] = NZDJPY;
Gi_269[16] = NZDUSD;
Gi_269[17] = GBPNZD;
Gi_269[18] = NZDCAD;
Gi_269[19] = NZDCHF;
Gi_269[20] = GBPCAD;
Gi_269[21] = USDCHF;
Gi_269[22] = EURCAD;
Gi_269[23] = EURAUD;
Gi_269[24] = GBPCHF;
Gi_269[25] = EURNZD;
Gi_269[26] = GBPAUD;
Gi_269[27] = GBPJPY;
}
gi_138 = StringLen(Symbol()) - 6;
if(gi_138 > 0) {
g_symbol_220 = StringSubstr(Symbol(),6,gi_138);
for(i0 = 0;i0 < SymbolTotal0;i0++) {
SymbolName1[i0] = SymbolName1[i0] + g_symbol_220;
}
}
G_lots_290 = 起始下单量;
Gd_300 = 翻倍;
Gi_308 = 单向最大持仓单数;
Gi_312 = 加码间隔点数;
Gi_313 = 加码间隔倍数;
Gi_315 = 第一单盈利点数;
Gi_316 = 单货币总体盈利点数;
Gi_314 = 最后一单止损点数;
Gd_320 = 单货币总亏损平仓;
Gd_328 = 单货币总盈利平仓;
Gi_336 = 滑点;
G_magic_340 = 定单识别码;
G_comment_344 = 定单注释;
G_bool_328 = 启用时间控制;
Bands_period = iBands_平均周期;
deviation = iBands_偏差;
bands_shift = iBands_平移;
Bands_applied_price = iBands_应用于;
G_bool_330 = 启用MA控制大方向;
ma_period = iMA_平均周期;
ma_shift = iMA_平移;
ma_method = iMA_移动平均;
ma_applied_price = iMA_应用于;
Gi_432 = 开始小时;
Gi_436 = 开始分钟;
Gi_440 = 结束小时;
Gi_444 = 结束分钟;
if(帐号限制 != 0 && AccountNumber() != 帐号限制) {
Alert("此帐号未注册,联系作者QQ:",作者QQ);//请不要在这块修改限制
ExpertRemove();
return(0);
}
EventSetMillisecondTimer(300);
Time6 = TimeCurrent();
GlobalVariableSet("TaoLi",Time6);
Gi_280 = MathRound((-MathLog(MarketInfo(SymbolName0, MODE_LOTSTEP))) / 2.302585093);
return(INIT_SUCCEEDED);
}
void OnDeinit(const int reason) {
if(IsTesting()) {
double t_count_11 = 0;
for(int i = OrdersHistoryTotal() - 1; i >= 0; i--) {
if(!OrderSelect(i, SELECT_BY_POS, MODE_HISTORY)) continue;
if(OrderSymbol() == Symbol()) {
if(OrderType() < 2) t_count_11 += OrderLots();
}
}
Comment(DoubleToStr(t_count_11,2));
Print(DoubleToStr(t_count_11,2));
}
Comment("");
EventKillTimer();
if(GlobalDel) GlobalVariableDel("TaoLi");
ObjectsDeleteAll(0,"Button",0,OBJ_BUTTON);
return;
}
void OnTick() {
if(帐号限制 != 0 && AccountNumber() != 帐号限制) {
Alert("此帐号未注册,联系作者QQ:375744140",作者QQ);//请不要在这块修改限制
ExpertRemove();
return;
}
if(TimeCurrent() > 时间限制) {//请不要在这块修改限制
Alert("使用时间过期,联系作者QQ:375744140",作者QQ);
ExpertRemove();
return;
}
if(IsTesting()) OnTester();
else OnTimer();
}
double OnTester() {
for(i0 = 0;i0 < SymbolTotal0;i0++) {
SymbolName0 = SymbolName1[i0];
if(SymbolName0 != Symbol()) continue;
ButtonCreate("Button3","停止EA","停止EA",80,30,75,25,CORNER_RIGHT_LOWER,clrWhite,clrForestGreen,clrLimeGreen,false);
if(ObjectGetInteger(0,"Button3",OBJPROP_STATE)==1) {
ExpertRemove();
return(0);
}
ButtonCreate("Button4","暂停下单","正常下单",80,60,75,25,CORNER_RIGHT_LOWER,clrWhite,clrDarkOrange,clrOrange,false);
if(ObjectGetInteger(0,"Button4",OBJPROP_STATE)==1) {
OpenNew = false;
}
else OpenNew = true;
ButtonCreate("Button0","全部平仓","正在执行",80,90,75,25,CORNER_RIGHT_LOWER,clrWhite,clrForestGreen,clrLimeGreen,false);
if(ObjectGetInteger(0,"Button0",OBJPROP_STATE)==1) {
CloseAll();
ObjectSetInteger(0,"Button0",OBJPROP_STATE,0);
}
AskAsk = MarketInfo(SymbolName0,MODE_ASK);
BidBid = MarketInfo(SymbolName0,MODE_BID);
POINT = MarketInfo(SymbolName0,MODE_POINT);
DIGITS = MarketInfo(SymbolName0,MODE_DIGITS);
if (DIGITS == 5 || DIGITS == 3) Gi_276 = 10;
if (StringFind(SymbolName0, "XAU", 0) >= 0 || StringFind(SymbolName0, "GOLD", 0) >= 0) {
if (DIGITS == 2) Gi_276 = 10;
if (DIGITS == 3) Gi_276 = 100;
}
start0();
}
return(0);
}
void OnTimer() {
if(!GlobalVariableCheck("TaoLi")) {
Time6 = TimeCurrent();
GlobalVariableSet("TaoLi",Time6);
}
else {
if(GlobalVariableGet("TaoLi") != Time6) {
ExpertRemove();
GlobalDel = false;
return;
}
}
for(i0 = 0;i0 < SymbolTotal0;i0++) {
SymbolName0 = SymbolName1[i0];
if(Gi_269[i0] == 3 || MarketInfo(SymbolName0,MODE_TRADEALLOWED) == 0) continue;
ButtonCreate("Button3","停止EA","停止EA",80,30,75,25,CORNER_RIGHT_LOWER,clrWhite,clrForestGreen,clrLimeGreen,false);
if(ObjectGetInteger(0,"Button3",OBJPROP_STATE)==1) {
ExpertRemove();
return;
}
ButtonCreate("Button4","暂停下单","正常下单",80,60,75,25,CORNER_RIGHT_LOWER,clrWhite,clrDarkOrange,clrOrange,false);
if(ObjectGetInteger(0,"Button4",OBJPROP_STATE)==1) {
OpenNew = false;
}
else OpenNew = true;
ButtonCreate("Button0","全部平仓","正在执行",80,90,75,25,CORNER_RIGHT_LOWER,clrWhite,clrForestGreen,clrLimeGreen,false);
if(ObjectGetInteger(0,"Button0",OBJPROP_STATE)==1) {
CloseAll();
ObjectSetInteger(0,"Button0",OBJPROP_STATE,0);
}
AskAsk = MarketInfo(SymbolName0,MODE_ASK);
BidBid = MarketInfo(SymbolName0,MODE_BID);
POINT = MarketInfo(SymbolName0,MODE_POINT);
DIGITS = MarketInfo(SymbolName0,MODE_DIGITS);
if (DIGITS == 5 || DIGITS == 3) Gi_276 = 10;
if (StringFind(SymbolName0, "XAU", 0) >= 0 || StringFind(SymbolName0, "GOLD", 0) >= 0) {
if (DIGITS == 2) Gi_276 = 10;
if (DIGITS == 3) Gi_276 = 100;
}
start0();
}
return;
}
void start0() {
icustom0 = iBands(SymbolName0,0,Bands_period, deviation,bands_shift,Bands_applied_price,1,1);
icustom1 = iBands(SymbolName0,0,Bands_period, deviation,bands_shift,Bands_applied_price,2,1);
icustom2 = iMA(SymbolName0,0,ma_period,ma_shift,ma_method,ma_applied_price,0);
HideTestIndicators(true);
G_lots_292 = G_lots_290;
CountOrders();
if (Gi_273) CommentMsg();
if ((Gd_328 > 0.0 && Gd_216 >= Gd_328) || (Gd_320 > 0.0 && Gd_216 <= (-Gd_320))) CloseOrders(OP_BUY);
if ((Gd_328 > 0.0 && Gd_218 >= Gd_328) || (Gd_320 > 0.0 && Gd_218 <= (-Gd_320))) CloseOrders(OP_SELL);
if (Gi_268 > 1 && BidBid > Gd_168 + Gi_316 * Gi_276 * POINT) CloseOrders(OP_BUY);
if (Gi_272 > 1 && AskAsk < Gd_176 - Gi_316 * Gi_276 * POINT) CloseOrders(OP_SELL);
if (Gi_314 > 0 && Gi_268 >= Gi_308 && BidBid < G_order_open_price_152 - Gi_314 * Gi_276 * POINT) CloseOrders(OP_BUY);
if (Gi_314 > 0 && Gi_272 >= Gi_308 && AskAsk > G_order_open_price_160 + Gi_314 * Gi_276 * POINT) CloseOrders(OP_SELL);
if (!OpenNew) return;
if (Gi_268 == 0 && CheckTime() && (!G_bool_330 || BidBid > icustom2) && (Gi_269[i0] == 0 || Gi_269[i0] == 2) && iClose(SymbolName0,0,1) < icustom1) G_ticket_264 = OrderSend(SymbolName0, OP_BUY, G_lots_292, AskAsk, Gi_336 * Gi_276, 0, 0, G_comment_344, G_magic_340, 0, Blue);
if (Gi_272 == 0 && CheckTime() && (!G_bool_330 || BidBid < icustom2) && (Gi_269[i0] == 1 || Gi_269[i0] == 2) && iClose(SymbolName0,0,1) > icustom0) G_ticket_264 = OrderSend(SymbolName0, OP_SELL, G_lots_292, BidBid, Gi_336 * Gi_276, 0, 0, G_comment_344, G_magic_340, 0, Red);
if (Gi_268 > 0 && Gi_268 < Gi_308 && (!G_bool_330 || BidBid > icustom2) && G_order_open_price_152 - AskAsk >= Gi_312 * MathPow(Gi_313,Gi_268-1) * Gi_276 * POINT) {
G_ticket_264 = OrderSend(SymbolName0, OP_BUY, NormalizeDouble(G_lots_292 * MathPow(Gd_300, Gi_268), Gi_280), MarketInfo(SymbolName0,MODE_ASK), Gi_336 * Gi_276, 0, 0, G_comment_344, G_magic_340, 0);
if(G_ticket_264 < 0) Print("下单错误 = ",GetLastError());
}
if (Gi_272 > 0 && Gi_272 < Gi_308 && (!G_bool_330 || BidBid < icustom2) && BidBid - G_order_open_price_160 >= Gi_312 * MathPow(Gi_313,Gi_272-1) * Gi_276 * POINT) {
G_ticket_264 = OrderSend(SymbolName0, OP_SELL, NormalizeDouble(G_lots_292 * MathPow(Gd_300, Gi_272), Gi_280), MarketInfo(SymbolName0,MODE_BID), Gi_336 * Gi_276, 0, 0, G_comment_344, G_magic_340, 0);
if(G_ticket_264 < 0) Print("下单错误 = ",GetLastError());
}
CountOrders();
if (Gi_268 != Gi_144[i0]) O_Modify(0);
if (Gi_272 != Gi_148[i0]) O_Modify(1);
return;
}
void O_Modify(int Ai_0) {
if (Ai_0 == 0) {
Gi_144[i0] = Gi_268;
G_price_230 = 0;
if(Gi_268 >= Gi_308 && Gi_314 > 0) {
G_price_230 = G_order_open_price_152 - Gi_314 * Gi_276 * POINT;
if(i0 == 17 || i0 == 24 || i0 == 25 || i0 == 27) G_price_230 = G_order_open_price_152 - Gi_314 * Gi_276 * POINT;
}
G_price_232 = Gd_168 + Gi_316 * Gi_276 * POINT;
if(Gi_268 == 1) G_price_232 = Gd_168 + Gi_315 * Gi_276 * POINT;
for (G_pos_260 = OrdersTotal() - 1; G_pos_260 >= 0; G_pos_260--) {
if (OrderSelect(G_pos_260, SELECT_BY_POS, MODE_TRADES)) {
if (OrderMagicNumber() == G_magic_340)
if (OrderSymbol() == SymbolName0 && OrderType() == OP_BUY) Gi_256 = OrderModify(OrderTicket(), OrderOpenPrice(), G_price_230, G_price_232, 0);
}
}
}
if (Ai_0 == 1) {
Gi_148[i0] = Gi_272;
G_price_230 = 0;
if(Gi_272 >= Gi_308 && Gi_314 > 0) {
G_price_230 = G_order_open_price_160 + Gi_314 * Gi_276 * POINT;
if(i0 == 17 || i0 == 24 || i0 == 25 || i0 == 27) G_price_230 = G_order_open_price_160 + Gi_314 * Gi_276 * POINT;
}
G_price_232 = Gd_176 - Gi_316 * Gi_276 * POINT;
if(Gi_272 == 1) G_price_232 = Gd_176 - Gi_315 * Gi_276 * POINT;
for (G_pos_260 = OrdersTotal() - 1; G_pos_260 >= 0; G_pos_260--) {
if (OrderSelect(G_pos_260, SELECT_BY_POS, MODE_TRADES)) {
if (OrderMagicNumber() == G_magic_340)
if (OrderSymbol() == SymbolName0 && OrderType() == OP_SELL) Gi_256 = OrderModify(OrderTicket(), OrderOpenPrice(), G_price_230, G_price_232, 0);
}
}
}
}
int CheckTime() {
if (!G_bool_328) return (1);
int datetime_0 = TimeCurrent();
int str2time_4 = StrToTime(TimeToStr(datetime_0, TIME_DATE) + " " + DoubleToStr(Gi_432, 0) + ":" + DoubleToStr(Gi_436, 0));
int str2time_8 = StrToTime(TimeToStr(datetime_0, TIME_DATE) + " " + DoubleToStr(Gi_440, 0) + ":" + DoubleToStr(Gi_444, 0));
if (str2time_4 < str2time_8 && datetime_0 > str2time_4 && datetime_0 < str2time_8) return (1);
if (str2time_4 > str2time_8)
if (datetime_0 > str2time_4 || datetime_0 < str2time_8) return (1);
return (0);
}
void CloseOrders(int A_cmd_0) {
Breturn = true;
for (int pos_4 = OrdersTotal() - 1; pos_4 >= 0; pos_4--) {
if (OrderSelect(pos_4, SELECT_BY_POS, MODE_TRADES)) {
if (OrderSymbol() == SymbolName0 && OrderMagicNumber() == G_magic_340)
if (OrderType() == A_cmd_0) Gi_256 = OrderClose(OrderTicket(), OrderLots(), OrderClosePrice(), Gi_336 * Gi_276);
}
}
}
void CloseAll() {
Breturn = true;
for (int pos_4 = OrdersTotal() - 1; pos_4 >= 0; pos_4--) {
if (OrderSelect(pos_4, SELECT_BY_POS, MODE_TRADES)) {
if (OrderMagicNumber() == G_magic_340)
if (OrderType() < 2) Gi_256 = OrderClose(OrderTicket(), OrderLots(), OrderClosePrice(), Gi_336 * Gi_276);
}
}
}
void CountOrders() {
Gi_268 = 0;
Gi_272 = 0;
Gd_184 = 0;
Gd_192 = 0;
Gd_200 = 0;
Gd_208 = 0;
Gd_216 = 0;
Gd_218 = 0;
G_order_open_price_152 = 0;
G_order_open_price_160 = 0;
Gd_168 = 0;
Gd_176 = 0;
for (G_pos_260 = 0; G_pos_260 < OrdersTotal(); G_pos_260++) {
if (OrderSelect(G_pos_260, SELECT_BY_POS, MODE_TRADES)) {
if (OrderSymbol() == SymbolName0 && OrderMagicNumber() == G_magic_340) {
if (OrderType() == OP_BUY) {
Gi_268++;
Gd_184 += OrderLots();
Gd_200 += OrderOpenPrice() * OrderLots();
Gd_216 += OrderProfit() + OrderSwap() + OrderCommission();
G_order_open_price_152 = OrderOpenPrice();
}
if (OrderType() == OP_SELL) {
Gi_272++;
Gd_192 += OrderLots();
Gd_208 += OrderOpenPrice() * OrderLots();
Gd_218 += OrderProfit() + OrderSwap() + OrderCommission();
G_order_open_price_160 = OrderOpenPrice();
}
}
}
}
if (Gi_268 == 0) Gi_144[i0] = 0;
if (Gi_272 == 0) Gi_148[i0] = 0;
if (Gd_184 > 0.0) Gd_168 = NormalizeDouble(Gd_200 / Gd_184, DIGITS);
if (Gd_192 > 0.0) Gd_176 = NormalizeDouble(Gd_208 / Gd_192, DIGITS);
}
void CommentMsg() {
Gsa_720[0] = "平台杠杆:1:" + DoubleToStr(AccountLeverage(), 0);
Gsa_720[1] = "强平比例:" + DoubleToStr(AccountStopoutLevel(), 0) + "%";
Gsa_720[2] = "--------------";
Gsa_720[3] = "多单单数:" + Gi_268;
Gsa_720[4] = "多单手数:" + DoubleToStr(Gd_184, 2);
Gsa_720[5] = "多单盈亏:" + DoubleToStr(Gd_216, 2);
Gsa_720[6] = "--------------";
Gsa_720[7] = "空单单数:" + Gi_272;
Gsa_720[8] = "空单手数:" + DoubleToStr(Gd_192, 2);
Gsa_720[9] = "空单盈亏:" + DoubleToStr(Gd_218, 2);
Gsa_720[10] = "--------------";
Gsa_720[11] = "净下单量:" + DoubleToStr(Gd_184 - Gd_192, 2);
Gsa_720[12] = "浮动盈亏:" + DoubleToStr(Gd_216 + Gd_218, 2);
Gsa_720[13] = "--------------";
for (int index_0 = 0; index_0 < 14; index_0++) ObjectCreat0("xxxxxx" + index_0, Gsa_720[index_0], 10, 15 + 19 * index_0, Yellow);
}
void ObjectCreat0(string A_name_0, string A_text_8, double A_x_16, double A_y_24, color A_color_32) {
if (ObjectFind(A_name_0) >= 0) {
ObjectSetText(A_name_0, A_text_8, 14, "微软雅黑", A_color_32);
return;
}
ObjectCreate(A_name_0, OBJ_LABEL, 0, 0, 0);
ObjectSet(A_name_0, OBJPROP_XDISTANCE, A_x_16);
ObjectSet(A_name_0, OBJPROP_YDISTANCE, A_y_24);
ObjectSet(A_name_0, OBJPROP_COLOR, A_color_32);
ObjectSetText(A_name_0, A_text_8, 14, "微软雅黑", A_color_32);
}
void ButtonCreate(string Name,string txt1,string txt2,int XX,int YX,int XL,int YL,int WZ,color clr,color back_clr,color border_clr,bool ZHClr) {
if(ObjectFind(0,Name)==-1) {
ObjectCreate(0,Name,OBJ_BUTTON,0,0,0);
ObjectSetInteger(0,Name,OBJPROP_XDISTANCE,XX);
ObjectSetInteger(0,Name,OBJPROP_YDISTANCE,YX);
ObjectSetInteger(0,Name,OBJPROP_XSIZE,XL);
ObjectSetInteger(0,Name,OBJPROP_YSIZE,YL);
ObjectSetInteger(0,Name,OBJPROP_CORNER,WZ);
ObjectSetString(0,Name,OBJPROP_FONT,"微软雅黑");
ObjectSetInteger(0,Name,OBJPROP_FONTSIZE,13);
ObjectSetInteger(0,Name,OBJPROP_BORDER_COLOR,border_clr);
}
if(ObjectGetInteger(0,Name,OBJPROP_STATE)==1) {
if(ZHClr) {
ObjectSetInteger(0,Name,OBJPROP_COLOR,back_clr);
ObjectSetInteger(0,Name,OBJPROP_BGCOLOR,clr);
}
ObjectSetString(0,Name,OBJPROP_TEXT,txt2);
}
else {
ObjectSetInteger(0,Name,OBJPROP_COLOR,clr);
ObjectSetInteger(0,Name,OBJPROP_BGCOLOR,back_clr);
ObjectSetString(0,Name,OBJPROP_TEXT,txt1);
}
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C++
1
https://gitee.com/licq201/mql4.git
[email protected]:licq201/mql4.git
licq201
mql4
mql4
master

搜索帮助