day open

day open最新版

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

13 人已下载 手机查看

//+——————————————————————+
//| day open.mq4 |
//| Copyright 2014, MetaQuotes Software Corp. |
//| http://www.mql5.com |
//+——————————————————————+
#property copyright “Copyright 2014, MetaQuotes Software Corp.”
#property link “http://www.mql5.com”
#property version “1.00”
#property strict
extern double LOT=0.01;
extern int Profit=10;
int bars;
bool trade;
//+——————————————————————+
//| Expert initialization function |
//+——————————————————————+
int OnInit()
{
trade=false;
bars=iBars(Symbol(),PERIOD_D1);
return(INIT_SUCCEEDED);
}
//+——————————————————————+
//| Expert deinitialization function |
//+——————————————————————+
void OnDeinit(const int reason)
{
//—

}
//+——————————————————————+
//| Expert tick function |
//+——————————————————————+
void OnTick()
{
if (bars!=iBars(Symbol(),PERIOD_D1)){bars=iBars(Symbol(),PERIOD_D1);trade=true;}

if (trade){
OrderSend(Symbol(),OP_BUY,LOT,Ask,2,0,0,NULL,0123456,0,clrRed);
OrderSend(Symbol(),OP_SELL,LOT,Bid,2,0,0,NULL,0123456,0,clrRed);
trade=false;
}

int tot=OrdersTotal();

for(int i=0; i<=tot;i++)
{OrderSelect(i,SELECT_BY_POS,MODE_TRADES);
if (OrderSymbol()==Symbol() &&OrderMagicNumber()==0123456)
{
if(OrderType()==OP_BUY){if (Bid>= OrderOpenPrice()+Profit*Point)OrderClose(OrderTicket(),LOT,Bid,2,clrAqua);}

if(OrderType()==OP_SELL){if (Ask<= OrderOpenPrice()-Profit*Point)OrderClose(OrderTicket(),LOT,Ask,2,clrAqua);}
}

}

}
//+——————————————————————+

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

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

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

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

相关资源

暂无评论

暂无评论...