以之前前輩提供的方法做個開始的條件設定
抓出基本的價位與生效日的價位
if
marketposition=0 and
Body>40
then begin
value1=high;
value2=low+10;
value3=barnumber;
end;
if marketposition<>0 and Body>40 and barssinceentry>5
then begin
value1=high;
value2=low+10;
value3=barnumber;
end;
這邊是買賣的訊號不是否有邏輯上的錯誤
訊號好像都不甚正確
買
if marketposition=0 and high >value1 and (barssinceentry>5 or kbar=5)
then begin
buy ("Buy") this bar at close;
end;
買方反手
if marketposition=1 and low <value2 and (barssinceentry>5 or kbar=5)
then begin
Sell this bar at close;
sellshort ("bh_s") this bar at close;
end;
空
if marketposition=0 and low <value2 and (barssinceentry>5 or kbar=5)
then begin
sellshort ("short") this bar at close;
end;
空方反手
if marketposition=-1 and high >value1 and (barssinceentry>5 or kbar=5)
then begin
buytocover this bar at close;
buy ("BH_b") this bar at close;
end;