在A,B两个公式里面使用openprofit记录各自公式的理论浮动盈亏,然后引用出来进行比较
盈亏1:=stkindi();
盈亏2:=stkindi();
if 盈亏1>盈亏2 then begin
公式A
end
if 盈亏1<盈亏2 then begin
公式B
end
模型A
hh:=ma(high,30);
ll:=ma(low,30);
if cross(high,hh) then begin //平空
sellShort ( holding < 0 ,0 , limitr, c);
end
if cross(high,hh) then begin //开多
Buy ( holding= 0 , 1, limitr, c) ;
end
if cross(ll,low) then begin //平多
sell ( holding > 0 , 0 , limitr, c) ;
end
if cross(ll,low) then begin //开空
buyshort(holding = 0 , 1 , limitr, c) ;
end
模型B
LC := REF(CLOSE,1);
RSI1:=SMA(MAX(CLOSE-LC,0),7,1)/SMA(ABS(CLOSE-LC),7,1)*100;
if ref(rsi1,1)<30 and rsi1>ref(rsi1,1) then begin //平空
sellShort ( holding < 0 ,0 , limitr, c);
end
if ref(rsi1,1)<30 and rsi1>ref(rsi1,1) then begin //开多
Buy ( holding= 0 , 1, limitr, c) ;
end
if ref(rsi1,1)>70 and rsi1<ref(rsi1,1) then begin //平多
sell ( holding > 0 , 0 , limitr, c) ;
end
if ref(rsi1,1)>70 and rsi1<ref(rsi1,1) then begin //开空
buyshort(holding = 0 , 1 , limitr, c) ;
end
怎么用openprofit记录各自公式的理论浮动盈亏?
是不是还要在第三个公式里才能实现我说的想法?
用一个公式不能实现吗?
不好意思请问
怎么用openprofit记录各自公式的理论浮动盈亏?
把这个写每个公式的最后,
O1:openprofit;
然后引用o1