很麻烦的时间问题,谢谢帮忙!

 

double time1;

if(MacdCurrent>SignalCurrent && MacdPrevious<SignalPrevious &&MaCurrent>MaPrevious)

{

time1==timecurrent();

}

这一段是想当MACD发生cross时,记录它的时间,接下来,我想尝试着做的事是: 加入一个开仓条件,当满足第二个开仓条件时,它的时间,与time1之间的差值少过3600m.可不可以这样写呀:

if(MacdCurrent>SignalCurrent && MacdPrevious<SignalPrevious && MaCurrent>MaPrevious)

{

time1==timecurrent();

}

if(MacdCurrent<0 && timecurrent()-time1<3600)

{ ordersent....开仓

}

麻烦各位若有时间帮忙看一下,因为我这样写了,但程序却把两个IF语句分开来,只把第二个IF做为开仓条件,时间上也没起任何作用.

原因: