均線走平並上揚時買進
input:blen(37),slen(32),s1(0.0125);
value1=Average(close,blen);
value2=Average(close,slen);
if value1[4]>value1[3] and value1[3]>value1[2]
and value1[1]>=value1[2]and value1[0]>=value1[1] then begin
buy next bar at market;
end;
if value1[4]<value1[3] and value1[3]<value1[2]
and value1[1]<=value1[2]and value1[0]<=value1[1] then begin
sellshort next bar at market;
end;
if marketposition>0 then
sell next bar at entryprice*(1-s1) stop;
if marketposition<0 then
buytocover next bar at entryprice*(1+s1) stop;
condition1=dayofweek(date)=3 and dayofmonth(date)>14 and 22<dayofmonth(date);
if condition1 then begin
if time>1314 then begin
sell this bar at Close;
buytocover this bar on close;
end;
end;
沒有留言:
張貼留言