Thân gởi diễn đàn
Mình mới tập code EA, nhưng mới code lệnh OderSend thì báo lỗi
Mọi người xem dùm nhe
//+------------------------------------------------------------------+
//| 20170727 - test nen dophin.mq4 |
//| WALLRIO |
//| [email protected] |
//+------------------------------------------------------------------+
#property copyright "WALLRIO"
#property link "[email protected]"
#property version "1.00"
#property strict
//vung dat bien
extern int TP =50; // Chot loi 50 pip.
extern int SL =50 ; // Dung Lo 50 pip.
extern double lot = 0.1;
double pip;
extern int MagicNumber;
//+------------------------------------------------------------------+
//| Expert initialization function |
//+------------------------------------------------------------------+
int OnInit()
{
//---
//---
return(INIT_SUCCEEDED);
}
//+------------------------------------------------------------------+
//| Expert deinitialization function |
//+------------------------------------------------------------------+
void OnDeinit(const int reason)
{
//---
}
//+------------------------------------------------------------------+
//| Expert tick function |
//+------------------------------------------------------------------+
void OnTick()
{
// trend tang
if ( iMA(NULL,0,12,0,MODE_SMMA,PRICE_MEDIAN,0)>iMA(NULL,0,50,0,MODE_SMMA,PRICE_MEDIAN,0)&&
iClose(NULL,0,1)>iHigh (NULL,0,2) &&
iLow(NULL,0,1)<iOpen(NULL,0,2) &&
iOpen(NULL,0,2)>iClose(NULL,0,2) &&
iOpen(NULL,0,1)<iClose(NULL,0,2))
{
int ticket=OrderSend(Symbol(),OP_BUY,lot,Ask,7,Ask-SL*pip,Bid+TP*pip," LENH BUY",10001,0,clrGreen);
}
//---
}
//+------------------------------------------------------------------+
Mong mọi người giúp để em làm cái máy in tiền xu kiếm sữa cho con ạ
Em có đính kèm file cho tiện luôn
Mình mới tập code EA, nhưng mới code lệnh OderSend thì báo lỗi
Mọi người xem dùm nhe
//+------------------------------------------------------------------+
//| 20170727 - test nen dophin.mq4 |
//| WALLRIO |
//| [email protected] |
//+------------------------------------------------------------------+
#property copyright "WALLRIO"
#property link "[email protected]"
#property version "1.00"
#property strict
//vung dat bien
extern int TP =50; // Chot loi 50 pip.
extern int SL =50 ; // Dung Lo 50 pip.
extern double lot = 0.1;
double pip;
extern int MagicNumber;
//+------------------------------------------------------------------+
//| Expert initialization function |
//+------------------------------------------------------------------+
int OnInit()
{
//---
//---
return(INIT_SUCCEEDED);
}
//+------------------------------------------------------------------+
//| Expert deinitialization function |
//+------------------------------------------------------------------+
void OnDeinit(const int reason)
{
//---
}
//+------------------------------------------------------------------+
//| Expert tick function |
//+------------------------------------------------------------------+
void OnTick()
{
// trend tang
if ( iMA(NULL,0,12,0,MODE_SMMA,PRICE_MEDIAN,0)>iMA(NULL,0,50,0,MODE_SMMA,PRICE_MEDIAN,0)&&
iClose(NULL,0,1)>iHigh (NULL,0,2) &&
iLow(NULL,0,1)<iOpen(NULL,0,2) &&
iOpen(NULL,0,2)>iClose(NULL,0,2) &&
iOpen(NULL,0,1)<iClose(NULL,0,2))
{
int ticket=OrderSend(Symbol(),OP_BUY,lot,Ask,7,Ask-SL*pip,Bid+TP*pip," LENH BUY",10001,0,clrGreen);
}
//---
}
//+------------------------------------------------------------------+
Mong mọi người giúp để em làm cái máy in tiền xu kiếm sữa cho con ạ
Em có đính kèm file cho tiện luôn