請問有誰知道我代碼錯在哪里了嗎?研究了幾天不知道哪里錯了
作者:金字塔 來源:cxh99.com 發(fā)布時間:2015年10月11日
- 咨詢內(nèi)容:
//今天開盤跳空昨天,同時要第一個30分鐘收陽 就下一個30分鐘的開盤進場 止損12,止盈100,走出10點成本止損
//中間變量N:=barslast(date<>ref(date,1))+1;preDayHigh:ref(hhv(h,N),N); //昨日最高價preDayLOW:ref(LLv(L,N),N);//昨日最低價A:=VALUEWHEN(TIME=094500,CLOSE);B:=VALUEWHEN(DATE<>REF(DATE,1),OPEN);
//交易系統(tǒng)if CLOSE>=(enterprice+12*mindiff) and holding<0 then sellshort(1,1,market);if llv(l,enterbars+1)<(enterprice-10*mindiff) and h>=enterprice and holding<0 then sellshort(1,1,market);if enterprice-l>=100 and holding<0 then sellshort(1,1,market);if OPEN>preDayHigh AND A>B AND TIME<101500 and holding=0 then buy(1,1,market);if CLOSE<=(enterprice+12*mindiff) and holding>0 then sell(1,1,market);if hhv(h,enterbars+1)>(enterprice+10*mindiff) and l<=enterprice and holding>0 then sell(1,1,market);if h-enterprice>100 and holding>0 then sell(1,1,market);if OPEN<preDayLOW AND A<B AND TIME<101500 and holding=0 then BUYSHORT(1,1,market);
請問有誰知道我代碼錯在哪里了嗎?研究了幾天不知道哪里錯了,謝謝謝謝!
- 金字塔客服:
A:=VALUEWHEN(TIME=094500,CLOSE);
//A的取值有問題把,:=VALUEWHEN(TIME=094500,CLOSE);
- 用戶回復:
A:=VALUEWHEN(TIME=094500,CLOSE);
//A的取值有問題把,:=VALUEWHEN(TIME=094500,CLOSE);
因為是在30分鐘里面,所以我就取了時間=094500的收盤價,請問這樣取錯了嗎?應該怎么修改呢?謝謝!
- 網(wǎng)友回復:
不是寫錯了,對應CLOSE前面符號的寫的時候輸入法有問題
函數(shù)應該是以淡藍色顯示
- 網(wǎng)友回復:
是藍色顯示的
因為我測試了,進場是對的,但是都成本止損了,該止盈100的時候沒有止盈100,而全部都是成本止損了能幫忙看看止盈的代碼那里是不是寫錯了啊???