顺水外汇EA交易网MT4
标题:
盈利设定自动出场
[打印本页]
作者:
skyword
时间:
2014-7-4 13:59
00000000000000000000
作者:
wdsddjb
时间:
2014-7-4 19:54
乌克兰东部的冲突仍然在持续,求delta mt4版本
作者:
病毒体
时间:
2014-7-5 01:28
路过。。感谢分享。
作者:
人民币
时间:
2014-7-5 19:35
怎么样使用啊,如果可以用,就不用熬夜看
作者:
zhousteve
时间:
2014-7-7 17:29
是每个EA都有亮点!!!!!!
作者:
ygwylq
时间:
2014-7-10 21:48
标题:
盈利设定自动出场
/*
Generated by EX4-TO-MQ4 decompiler V4.0.220.2c []
Website: http://purebeam.biz
E-mail : purebeam@gmail.com
*/
#property copyright "Copyright ?2007, 520FX Corp."
#property link "http://www.520fx.com"
extern double 获利美元平仓数 = 50.0;
extern int SlipPoint = 3;
int gi_88 = 0;
int gi_unused_92 = 0;
int init() {
writetext("Logo", "Powered by www.520fx.com", 10, 10, Yellow, 14);
return (0);
}
int start() {
double ld_0;
if (gi_88 == TRUE) {
CloseAllOrder();
if (gi_88 == TRUE) return;
} else {
ld_0 = GetProfitsHolding();
writetext("Profit", "持仓总盈利:" + DoubleToStr(ld_0, 2), 10, 30, White, 16);
if (ld_0 > 获利美元平仓数) {
CloseAllOrder();
return (0);
}
}
return (0);
}
void writetext(string a_name_0, string a_text_8, int a_x_16, int a_y_20, color a_color_24, int a_fontsize_28) {
ObjectDelete(a_name_0);
ObjectCreate(a_name_0, OBJ_LABEL, 0, 0, 0);
ObjectSetText(a_name_0, a_text_8, a_fontsize_28, "Arial", a_color_24);
ObjectSet(a_name_0, OBJPROP_CORNER, 0);
ObjectSet(a_name_0, OBJPROP_XDISTANCE, a_x_16);
ObjectSet(a_name_0, OBJPROP_YDISTANCE, a_y_20);
}
double GetProfitsHolding() {
double ld_ret_4 = 0;
for (int l_pos_0 = 0; l_pos_0 < OrdersTotal(); l_pos_0++) {
OrderSelect(l_pos_0, SELECT_BY_POS, MODE_TRADES);
ld_ret_4 += OrderProfit();
}
return (ld_ret_4);
}
void CloseAllOrder() {
int lia_0[200];
gi_88 = FALSE;
int l_index_4 = 0;
for (int l_pos_8 = 0; l_pos_8 < OrdersTotal(); l_pos_8++) {
OrderSelect(l_pos_8, SELECT_BY_POS, MODE_TRADES);
l_index_4++;
lia_0[l_index_4] = OrderTicket();
Print("全部平仓! :", lia_0[l_index_4]);
}
if (l_index_4 != 0) {
for (l_pos_8 = 1; l_pos_8 <= l_index_4; l_pos_8++) {
OrderSelect(lia_0[l_pos_8], SELECT_BY_TICKET);
if (OrderType() == OP_BUY) {
if (OrderClose(OrderTicket(), OrderLots(), MarketInfo(OrderSymbol(), MODE_BID), SlipPoint) == 0) {
gi_88 = TRUE;
Print("多头平仓失败" + GetLastError());
}
}
if (OrderType() == OP_SELL) {
if (OrderClose(OrderTicket(), OrderLots(), MarketInfo(OrderSymbol(), MODE_ASK), SlipPoint) == 0) {
gi_88 = TRUE;
Print("空头平仓失败" + GetLastError());
}
}
}
}
}
作者:
蛐蛐
时间:
2014-7-28 17:54
谢谢分享
作者:
山丘
时间:
2014-9-8 11:07
谢谢谢谢谢
作者:
tanqingyuye
时间:
2014-9-29 18:09
要是增加亏损出场会完美
作者:
735269731
时间:
2014-11-23 17:28
楼主辛苦了
作者:
sxnrp
时间:
2015-4-22 14:41
520fx有你更精彩!
作者:
清野星_Phcp6
时间:
2016-3-8 11:39
盈利设定自动出场
作者:
hao0502
时间:
2016-3-13 22:21
盈利设定自动出场
作者:
hao0502
时间:
2016-8-24 23:48
看起来很强大的样子
欢迎光临 顺水外汇EA交易网MT4 (http://waterforex.com/)
Powered by Discuz! X3.2