[MT4指标]平仓报警代码
平仓报警代码//+------------------------------------------------------------------+
//| AlertCloseOrder.mq4 |
//| Copyright ? 2010, Vladimir Hlystov |
//| http://cmillion.narod.ru |
//+------------------------------------------------------------------+
#property copyright \"Copyright ? 2010, Vladimir Hlystov\"
#property link \"http://cmillion.narod.ru\"
#property indicator_chart_window
int Orders;
//+------------------------------------------------------------------+
int start()
{
if (Orders>OrdersTotal()) AlertOrder();
Orders=OrdersTotal();
return(0);
}
//+------------------------------------------------------------------+
void AlertOrder()
{
string txt;
double OCP;
int i=OrdersHistoryTotal()-1;
if(OrderSelect(i,SELECT_BY_POS,MODE_HISTORY)==true)
{
OCP=OrderClosePrice();
if (OCP==OrderStopLoss() ) txt=\"SL\";
if (OCP==OrderTakeProfit()) txt=\"TP\";
Alert(\"Order N \",OrderTicket(),\" close in \",txt,\" \",
DoubleToStr(OCP,Digits),\" profit \",DoubleToStr(OrderProfit(),2));
} }
//+------------------------------------------------------------------+
发表于:2014-06-27 16:18只看该作者
2楼
你好,看了你的帖子还是不会弄,你能不能帮我弄一下,谢谢,我的QQ:282975688
韬客社区www.talkfx.co
发表于:2015-08-30 08:31只看该作者
3楼
平仓报警代码
韬客社区www.talkfx.co