请教MQ语言的问题,请高手帮忙
datetime TimePrev=30;
............省略几行....
int start()
{
//close/Open
if (TimePrev==Time[0]) return(0);
TimePrev=Time[0];
//MA SET
double fast1=iMA(NULL,0,mafastperiod,mafastshift,mafastmethod,mafastprice,1);
double fast2=iMA(NULL,0,mafastperiod,mafastshift,mafastmethod,mafastprice,2);
double slow1=iMA(NULL,0,maslowperiod,maslowshift,maslowmethod,maslowprice,1);
double slow2=iMA(NULL,0,maslowperiod,maslowshift,maslowmethod,maslowprice,2);
..............省略
做个是一个均线的金叉和死叉做为买卖依据。
请教下,
if (TimePrev==Time[0]) return(0);
TimePrev=Time[0];
这两行如解释?
这个程序经过编译后,放入自动交易,会出现不部分金叉死叉不交易的情况。如何去编写,可以达到不遗漏任何一次金叉死叉?
谢谢
采用的
mafastshift= -1
maslowshift=1
是不是因为平移造成的?
如果高手愿意指点请加QQ,小弟不甚感激。