1、问题1,开盘价格大于2300时,开仓做多。开盘价格小于2100时,开仓做空。公式如何写?
2、问题2,以开盘价格做为条件,如果开盘价格点在昨天的收盘价之上,开多单。
如果开盘价格点在昨天的收盘价之下,开空单。
1.
if open<2300 then buy(holding=0,1,market);
if open<2100 then buyshort(holding=0,1,market);
2.
if open>ref(close,todaybar) then buy(holding=0,1,market);
if open<ref(close,todaybar) then buyshort(holding=0,1,market);