公式编写中 怎么 获取 最近一次成交的 价格 方向 , enterPrice 取过来为-1
typebar(1,1)<typebar(1,3)最后一次为开多
typebar(1,1)>typebar(1,3)最后一次为开空
最近一次开仓价:enterprice,-1表示你前面没有开仓
if typebar(1,1)=typebar(1,3) 是不是平仓呢
if typebar(1,1)<typebar(1,3) then
DRAWTEXTEX(1,0,5,80, '开多 价格: '+NUMTOSTR(enterprice,0),COLORWHITE);
if typebar(1,1)>typebar(1,3) then
DRAWTEXTEX(1,0,5,80, '开空 价格: '+NUMTOSTR(enterprice,0),COLORWHITE);
if typebar(1,1)=typebar(1,3) then
DRAWTEXTEX(1,0,5,80, '平仓 价格: '+NUMTOSTR(EXITPRICE,0),COLORWHITE);
什么叫“是不是平仓”?
平仓是你的平仓条件和平仓语句决定的啊,和开多周期开空周期没有关系