//+------------------------------------------------------------------+ //| baiso1.mq4 | //| Copyright 2016, MetaQuotes Software Corp. | //| https://www.mql5.com | //+------------------------------------------------------------------+ #property copyright "Copyright 2016, MetaQuotes Software Corp." #property link "https://www.mql5.com" #property version "1.00" #property strict //+------------------------------------------------------------------+ //| Expert initialization function | // NOI KHAI BAO BIEN extern double khoiLuong= 0.01; double stoploss = 0; double takeprofit = 0; extern string ghichu = "hello"; color maucualenh = clrRed; extern int loaiLenh = OP_BUY; double giavaolenh=0; datetime thoigiangiaodich; //+------------------------------------------------------------------+ int OnInit() { //--- //--- return(INIT_SUCCEEDED); } //+------------------------------------------------------------------+ //| Expert deinitialization function | //+------------------------------------------------------------------+ void OnDeinit(const int reason) { //--- } //+------------------------------------------------------------------+ //| Expert tick function | //+------------------------------------------------------------------+ void OnTick() { //--- /* 1.28741 --> GU Point() // pip = 10 * Point // sl = 20*pip ==> 20 * 10*Point // stoploss = 1.28976 */ // datetime a = iTime(Symbol(),15,1);Comment(a);//Print(a); if(OrdersTotal()>0){return;} // chi cho vao 1 lenh // vao lenh vao lenh vao dau nen moi if(iTime(Symbol(),15,0) == thoigiangiaodich){return;} thoigiangiaodich = iTime(Symbol(),15,0); if( Close[1]>Open[1] ){ loaiLenh = OP_BUY; } if(Close[1]