顺水外汇EA交易网MT4
标题:
这是著名的复盘宝MT4buddy的源码,不能开空单问题!
[打印本页]
作者:
liuhai555
时间:
2018-1-11 00:42
标题:
这是著名的复盘宝MT4buddy的源码,不能开空单问题!
这是著名的复盘宝MT4buddy的源码,不知为何只能开多不能开空单?请论坛大侠们帮助解决!
/*
Generated by EX4-TO-MQ4 decompiler FREEWARE V4.0.451.1 [-]
Website: http://www.metaquotes.net
E-mail : support@metaquotes.net
*/
#property copyright "Copyright ?2008, MetaQuotes Software Corp."
#property link "http://www.metaquotes.net"
#import "buddydll.dll"
void Init();
void Deinit();
void Lock();
void Unlock();
void UpdateInfo(double a0, double a1, double a2, double a3);
int GetCommandCount();
int GetCommand(int a0);
int GetTicket(int a0);
int GetType(int a0);
double GetPrice(int a0);
double GetLot(int a0);
double GetSL(int a0);
double GetTP(int a0);
void ClearCommand();
void ClearOrder();
void AddOrder(int a0, int a1, double a2, double a3, double a4, double a5);
void RaiseOrderChanged();
void UpdateSymbolInfo(double a0, double a1);
int GetPause();
void SetPause(int a0);
#import
bool gi_76;
bool gi_80;
bool gi_84;
bool gi_88;
bool gi_92;
double gd_96;
bool gi_104;
double gd_108;
int gi_116;
bool gi_120;
int init() {
Init();
UpdateSymbolInfo(Digits, Point);
ResetOrder(0);
RaiseOrderChanged();
gi_76 = FALSE;
gi_80 = FALSE;
gi_88 = FALSE;
gi_104 = FALSE;
gi_92 = FALSE;
return (0);
}
int deinit() {
Deinit();
return (0);
}
int start() {
UpdateInfo(AccountBalance(), AccountEquity(), NormalizeDouble(Bid, Digits), NormalizeDouble(Ask, Digits));
gi_84 = FALSE;
TrySleepForPause();
Lock();
int li_0 = GetCommandCount();
if (li_0 > 0) HandleCommand(li_0);
TryRefreshBuddyOrderList();
Unlock();
if (gi_84) {
if (gi_92) SetPause(1);
RaiseOrderChanged();
}
if ((gi_88 && Ask >= gd_96) || (gi_104 && Bid 0) break;
Sleep(500);
}
}
}
void TryRefreshBuddyOrderList() {
int order_total_0 = OrdersTotal();
int count_4 = 0;
int count_8 = 0;
for (int pos_12 = 0; pos_12 < order_total_0; pos_12++) {
OrderSelect(pos_12, SELECT_BY_POS);
if (OrderType() < OP_BUYLIMIT) count_4++;
else count_8++;
}
if (gi_76 != count_4 || gi_80 != count_8) {
ResetOrder(order_total_0);
gi_76 = count_4;
gi_80 = count_8;
}
}
void HandleCommand(int ai_0) {
int li_4;
for (int count_8 = 0; count_8 < ai_0; count_8++) {
li_4 = GetCommand(count_8);
switch (li_4) {
case 0:
OpenOrder(count_8);
break;
case 2:
CloseAll();
break;
case 3:
OrderSelect(GetTicket(count_8), SELECT_BY_TICKET);
if (OrderType() < OP_BUYLIMIT) OrderClose(GetTicket(count_8), OrderLots(), Bid, 10, Black);
else OrderDelete(GetTicket(count_8), Black);
break;
case 4:
OrderSelect(GetTicket(count_8), SELECT_BY_TICKET);
if (OrderType() < OP_BUYLIMIT) OrderModify(GetTicket(count_8), OrderOpenPrice(), GetSL(count_8), GetTP(count_8), OrderExpiration(), Black);
else OrderModify(GetTicket(count_8), GetPrice(count_8), GetSL(count_8), GetTP(count_8), OrderExpiration(), Black);
ResetOrder(OrdersTotal());
break;
case 5:
gi_88 = TRUE;
gd_96 = GetPrice(count_8);
break;
case 6:
gi_88 = FALSE;
break;
case 7:
gi_104 = TRUE;
gd_108 = GetPrice(count_8);
break;
case 8:
gi_104 = FALSE;
break;
case 9:
gi_92 = TRUE;
break;
case 10:
gi_92 = FALSE;
break;
case 11:
gi_116 = Time[0];
gi_120 = TRUE;
}
}
ClearCommand();
}
void OpenOrder(int ai_0) {
switch (GetType(ai_0)) {
case 0:
OrderSend(Symbol(), OP_BUY, GetLot(ai_0), Ask, 10, GetSL(ai_0), GetTP(ai_0), 0, 0, 0, Black);
return;
case 1:
OrderSend(Symbol(), OP_SELL, GetLot(ai_0), Ask, 10, GetSL(ai_0), GetTP(ai_0), 0, 0, 0, Black);
return;
case 2:
OrderSend(Symbol(), OP_BUYLIMIT, GetLot(ai_0), GetPrice(ai_0), 10, GetSL(ai_0), GetTP(ai_0), 0, 0, 0, Black);
return;
case 3:
OrderSend(Symbol(), OP_SELLLIMIT, GetLot(ai_0), GetPrice(ai_0), 10, GetSL(ai_0), GetTP(ai_0), 0, 0, 0, Black);
return;
case 4:
OrderSend(Symbol(), OP_BUYSTOP, GetLot(ai_0), GetPrice(ai_0), 10, GetSL(ai_0), GetTP(ai_0), 0, 0, 0, Black);
return;
case 5:
OrderSend(Symbol(), OP_SELLSTOP, GetLot(ai_0), GetPrice(ai_0), 10, GetSL(ai_0), GetTP(ai_0), 0, 0, 0, Black);
return;
return;
}
}
void ResetOrder(int ai_0) {
ClearOrder();
for (int pos_4 = 0; pos_4 < ai_0; pos_4++) {
OrderSelect(pos_4, SELECT_BY_POS);
AddOrder(OrderTicket(), OrderType(), NormalizeDouble(OrderLots(), 2), NormalizeDouble(OrderOpenPrice(), Digits), NormalizeDouble(OrderStopLoss(), Digits), NormalizeDouble(OrderTakeProfit(),
Digits));
}
gi_84 = TRUE;
}
void CloseAll() {
int order_total_0;
bool li_4;
while (true) {
li_4 = TRUE;
order_total_0 = OrdersTotal();
for (int pos_8 = 0; pos_8 < order_total_0; pos_8++) {
OrderSelect(pos_8, SELECT_BY_POS);
if (OrderType() == OP_BUY || OrderType() == OP_SELL) {
OrderClose(OrderTicket(), OrderLots(), Bid, 10, Black);
li_4 = FALSE;
break;
}
}
if (!(li_4)) continue;
break;
}
}
作者:
瑞福康
时间:
2018-1-11 01:06
Only replies earn the coins
[attach]12472[/attach]
作者:
forex995
时间:
2018-1-11 01:58
謝謝~~~支持楼主
作者:
人民币
时间:
2018-1-11 03:29
仔细看看。。
作者:
koko1180
时间:
2018-1-11 05:03
学习学习
作者:
koko1180
时间:
2018-1-11 06:16
学习学习
作者:
简单爱
时间:
2018-1-11 07:50
看看看看
作者:
gwy
时间:
2018-1-11 09:21
作者:
s336
时间:
2018-1-11 10:49
l路过,
[attach]12473[/attach]
[attach]12473[/attach]
[attach]12473[/attach]
作者:
黃小翔
时间:
2018-1-11 11:03
仔细看看。。
作者:
oiio00
时间:
2018-1-11 11:10
回帖後跳轉到最後一頁
作者:
oiio00
时间:
2018-1-11 12:12
回帖後跳轉到最後一頁
作者:
oiio00
时间:
2018-1-11 12:21
回帖後跳轉到最後一頁
作者:
oiio00
时间:
2018-1-11 13:08
回帖後跳轉到最後一頁
作者:
红颜
时间:
2018-1-11 14:13
u盾较大;大跌
欢迎光临 顺水外汇EA交易网MT4 (http://waterforex.com/)
Powered by Discuz! X3.2