//---- input parameters extern int period_ma=21; extern int period_adx=10; extern int filt=5; double muv; int t; //+------------------------------------------------------------------+ //| expert initialization function | //+------------------------------------------------------------------+ int init() { //----
//---- return(0); } //+------------------------------------------------------------------+ //| expert deinitialization function | //+------------------------------------------------------------------+ int deinit() { //----
//---- return(0); } //+------------------------------------------------------------------+ //| expert start function | //+------------------------------------------------------------------+ int start() { //---- if (OrdersTotal()==0) { muv=(iMA(Symbol(),PERIOD_M15,period_ma,0,MODE_LWMA,PRICE_CLOSE,1)-(High[1]-((High[1]-Low[1])/2)))*(-1)*100; double adx_main=iADX(Symbol(),PERIOD_M15,period_adx,PRICE_CLOSE,MODE_MAIN,0); double adx_min=iADX(Symbol(),PERIOD_M15,period_adx,PRICE_CLOSE,MODE_MINUSDI,0); double adx_plus=iADX(Symbol(),PERIOD_M15,period_adx,PRICE_CLOSE,MODE_PLUSDI,0); if (muv<0 && MathAbs(muv)>0.1 && adx_main>adx_min && adx_min>adx_plus) { t=OrderSend(Symbol(),OP_SELL,0.1,Bid,3,NULL,NULL,"My order #",16384,0,Green); Print (GetLastError()); } }
if (OrdersTotal()>0) { if (muv>0) { OrderSelect(t,SELECT_BY_TICKET,MODE_TRADES); OrderClose(t,0.1,Ask,3,Red); Print (GetLastError()); } } return(0); } //+------------------------------------------------------------------+
是否可以用一组不同的数据类型来声明一个数组?显然不是。"测试 "问题...可以这么说...
是否可以用一组不同的数据类型来声明一个数组?显然不是。"测试 "问题...可以这么说...
检查答案。没有。
我怎样才能让猫头鹰只在指定的时间工作,即从T1到T2?
我怎样才能让猫头鹰只在指定的时间工作,即从T1到T2?
我怎样才能让猫头鹰只在指定的时间工作,即从T1到T2?
也在这里...>> 'MetaEditor: Relying on the power of templates'.
有什么问题呢?
//+------------------------------------------------------------------+
//| ad+muv.mq4 |
//| Evgenio |
//| http://www.metaquotes.net |
//+------------------------------------------------------------------+
#property copyright "Evgenio"
#property link "http://www.metaquotes.net"
//---- input parameters
extern int period_ma=21;
extern int period_adx=10;
extern int filt=5;
double muv;
int t;
//+------------------------------------------------------------------+
//| expert initialization function |
//+------------------------------------------------------------------+
int init()
{
//----
//----
return(0);
}
//+------------------------------------------------------------------+
//| expert deinitialization function |
//+------------------------------------------------------------------+
int deinit()
{
//----
//----
return(0);
}
//+------------------------------------------------------------------+
//| expert start function |
//+------------------------------------------------------------------+
int start()
{
//----
if (OrdersTotal()==0)
{
muv=(iMA(Symbol(),PERIOD_M15,period_ma,0,MODE_LWMA,PRICE_CLOSE,1)-(High[1]-((High[1]-Low[1])/2)))*(-1)*100;
double adx_main=iADX(Symbol(),PERIOD_M15,period_adx,PRICE_CLOSE,MODE_MAIN,0);
double adx_min=iADX(Symbol(),PERIOD_M15,period_adx,PRICE_CLOSE,MODE_MINUSDI,0);
double adx_plus=iADX(Symbol(),PERIOD_M15,period_adx,PRICE_CLOSE,MODE_PLUSDI,0);
if (muv<0 && MathAbs(muv)>0.1 && adx_main>adx_min && adx_min>adx_plus)
{
t=OrderSend(Symbol(),OP_SELL,0.1,Bid,3,NULL,NULL,"My order #",16384,0,Green);
Print (GetLastError());
}
}
if (OrdersTotal()>0)
{
if (muv>0)
{
OrderSelect(t,SELECT_BY_TICKET,MODE_TRADES);
OrderClose(t,0.1,Ask,3,Red);
Print (GetLastError());
}
}
return(0);
}
//+------------------------------------------------------------------+
应在此结束