FXPT_BuySellUnlimitedOrders

FXPT_BuySellUnlimitedOrders最新版

官方版无广告198

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

20 人已下载 手机查看

//+——————————————————————+
//| FXPT_BuySellUnlimitedOrders.mq4|
//| Developed by fxprotrader |
//| http://www.fxpro-trader.com” |
//+——————————————————————+
#property copyright “Copyright © 2011, fxprotrader”
#property link “http://www.fxpro-trader.com”
//——– HISTORY—————-
// v0.1 Initial release(013012)
//——————————–
//coded for Price
//http://www.forexfactory.com/showthread.php?p=5335422#post5335422

#property show_inputs

extern string TopComment1=”Check Symbol and Order type”;
extern string TopComment2=”Must select Buy or Sell”;
extern bool buyorder = FALSE;
extern bool sellorder = FALSE;
extern int NumberOfOrders = 5;
extern double Lots = 0.10;
extern int StopLoss = 40;
extern int TakeProfit= 20
extern int MagicNumber = 999;
extern string MyComment=””;
string TradeComment=”FXPT_BuySell “;
int Slippage=2;

double Poin;

//+——————————————————————+
//| Custom initialization function |
//+——————————————————————+
int init(){

if (Point == 0.00001) Poin = 0.0001;
else {
if (Point == 0.001) Poin = 0.01;
else Poin = Point;
}
return(0);
}
//+——————————————————————+
//| script program start function |
//+——————————————————————+
int start(){

double BP,SP,TP,SL,HashLn;
int ticket;
int c,x,err;
int NumberOfTries=5;

//BUY
if(buyorder == TRUE){

for(x=0;x<NumberOfOrders;x++){
for(c=0;c<NumberOfTries;c++){
RefreshRates();
SL=Ask-(StopLoss*Poin);
TP=Ask+(TakeProfit*Poin);
ticket=OrderSend(Symbol(),OP_BUY,Lots,Ask,Slippage,0,0,TradeComment+DoubleToStr(StopLoss,0)+”/”+DoubleToStr(TakeProfit,0)+” “+Period(),MagicNumber,0,Blue);
err=GetLastError();

if(ticket>0){
if(OrderSelect(ticket,SELECT_BY_TICKET,MODE_TRADES)){
OrderModify(ticket,OrderOpenPrice(),SL,TP,0,Blue);
}
}
if(err==0){break;}
else{
Print(“Errors opening BUY order err:”+err);
if(err==4 || err==137 ||err==146 || err==136){
Sleep(100);continue;//Busy errors
}
else{break;}//normal error

}

}//for error/NumberOfTries
}

return(ticket);

}

//sell
else if(sellorder == TRUE){

for(x=0;x<NumberOfOrders;x++){
for(c=0;c<NumberOfTries;c++){
RefreshRates();
SL=Bid+(StopLoss*Poin);
TP=Bid-(TakeProfit*Poin);
ticket=OrderSend(Symbol(),OP_SELL,Lots,Bid,Slippage,0,0,TradeComment+DoubleToStr(StopLoss,0)+”/”+DoubleToStr(TakeProfit,0)+” “+Period(),MagicNumber,0,Red);

err=GetLastError();
if(ticket>0){
if(OrderSelect(ticket,SELECT_BY_TICKET,MODE_TRADES)){
OrderModify(ticket,OrderOpenPrice(),SL,TP,0,Red);
}
}
if(err==0){break;}
else{
Print(“Errors opening SELL order err:”+err);
if(err==4 || err==137 ||err==146 || err==136){
Sleep(100);continue;//Busy errors
}
else{break;}//normal error
}
}//for error/NumberOfTries
}

return(ticket);
}
// }
}

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

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.