哪位好心人能帮我把下面多单改成空单,我改了后总是下太多空单,不符合我的策略,谢谢!(我把 high和low ,BId和Ask,“<”和“>”互换,下单量却非常大,而且“(lowtime-Time[0])<=”个参数好象不管用)
- datetime hightime=0;
- double high0=0;
- datetime timebar=0;
- int onInit()
- {
- return(INIT_SUCCEEDED);
- }
- void onDeinit(const int reason)
- {
- }
- void onTick()
- {
- if(timebar!=Time[0])//每根新的k线产生 重新初始化记录的价格和时间
- {
- high0=0;
- hightime=0;
- timebar=Time[0];
- }
- if(NormalizeDouble(high0,Digits)<NormalizeDouble(High[0],Digits))
- {
- high0=NormalizeDouble(High[0],Digits);
- hightime=TimeCurrent();
- }
- if((High[0]-Open[0])>=50*Point && (hightime-Time[0])<=120)
- {
- bool a=OrderSend(Symbol(),OP_BUY,0.1,Ask,10,Bid-50*Point,Bid+50*Point,"开多单" ,12345,Red); //开多单
- }
- }
|