請教以下2個開倉條件的寫法。
1、昨日開盤價-昨日收盤價>30,今日開盤價開在昨日開盤價與昨日收盤價之間,當C<=昨收盤價,賣開倉。
2、2、昨日開盤價-昨日收盤價>30,今日開盤價開在昨日收盤價之下,今日第一根K線的開盤價-今日第一根K線的收盤價>20,當C<=今日第一根K線收盤價,賣開倉。
[此貼子已經被作者于2014/6/24 16:24:19編輯過]
zo:=CALLSTOCK('if00',vtopen,6,-1);
zc:=CALLSTOCK('if00',vtclose,6,-1);
jo:=VALUEWHEN(TODAYBAR=1,o);
jc:=VALUEWHEN(TODAYBAR=1,c);
t1:=(zo<jo and jo<zc) or (zc<jo and jo<zo);
if zo-zc>30 and t1 and c<=zc THEN
buyshort(holding=0,1,market);
if zo-zc>30 and jo<zc and jo-jc>20 and c<=jc then
buyshort(holding=0,1,market);