EA for Set TP-SL

EA for Set TP-SL最新版

官方版无广告141

更新日期:2022-03-02分类标签: 语言:中文平台:没限制

17 人已下载 手机查看

//+——————————————————————+
//| EA for Set TP-SL.mq4 |
//| |
//| |
//+——————————————————————+
#property copyright “”
#property link “”

int order_total;
int cb = 0;
int cs = 0;
int cbs = 0;
int css = 0;
int ticket_b;
int ticket_s;
double op_b;
double op_s;
extern int SL = 29;
extern int TP = 10;

int init()
{
if(MarketInfo(“EURUSD”,MODE_DIGITS)==5){
SL = SL*10;
TP = TP*10;
}
return(0);
}

int start()
{
order_total = OrdersTotal();
cb = false;
cs = false;
cbs = false;
css = false;
for(int i = order_total; i >= 0; i–){
if(OrderSelect(i,SELECT_BY_POS) == true && OrderSymbol() == Symbol()){
if(OrderType() == OP_BUY){
cb = true;
ticket_b = OrderTicket();
op_b = NormalizeDouble(OrderOpenPrice(), Digits);
Modify_order();
}
if(OrderType() == OP_SELL){
cs = true;
ticket_s = OrderTicket();
op_s = NormalizeDouble(OrderOpenPrice(), Digits);
Modify_order();
}
}
}

return(0);
}

void Modify_order() {
if (cb == TRUE) {
if(OrderStopLoss()==0 && OrderTakeProfit()==0){
OrderModify(ticket_b, 0, op_b-SL*Point, op_b+TP*Point, 0, 0);
}
}
if (cs == TRUE) {
if(OrderStopLoss()==0 && OrderTakeProfit()==0){
OrderModify(ticket_s, 0, op_s+SL*Point, op_s-TP*Point, 0, 0);
}
}
}

 

如果你对文件有了解,请帮助投票!

If you are familiar with the file, please help vote!

平均评分 0 / 5. 投票数: 0

到目前为止还没有投票!成为第一位投票人。

相关资源

暂无评论

暂无评论...
Ads Blocker Image Powered by Code Help Pro

检测到广告拦截程序!!!Ads Blocker Detected!!!

我们检测到您正在使用扩展来屏蔽广告。请通过禁用这些广告屏蔽程序或者把网站加入白名单来支持我们。

We have detected that you are using an extension to block advertisements. Please support us by disabling these advertising blocking programs or adding the website to the whitelist.