|
如果我想用hourly bar chart, 然後計算每條bar的open, 超過open*1+0.001就buy, 相反是sellshort, 請問這樣寫對嗎?
vars: F(0.001), R(0.1), hh(0), ll(0), oo(0), cc(0);
[IntrabarOrderGeneration=True]
if date<>date[1] then begin
hh=high;
ll=low;
oo=open;
cc=close;
end;
condition5=cc[1] < cc[1]*(1+F);
condition6=cc[1] > cc[1]*(1-F);
if marketposition=0 then begin
if condition5 then buy("Long") next bar at cc[1]*(1+F) stop;
if condition6 then sellshort("Put") next bar at cc[1]*(1-F) stop;
end;
|
|