程序化交易吧 关注:3,292贴子:8,505
  • 3回复贴,共1

rb_3mins_2MA,螺纹钢3分钟双均线探势策略mc源码

只看楼主收藏回复





500g程序交易源代码https://zhuanlan.zhihu.com/p/57502355
8G策略代码https://dwz.cn/xW6zpv5Q
LengthShort(9),LengthLong(45),BIASLength(6),n(2);
vars:
BIAS(0);
if Xaverage(close,LengthShort) crosses above Xaverage(close,LengthLong) then condition1=true;
value1=Xaverage(close,LengthShort)-Xaverage(close,LengthLong);
bias=XAverage(value1,n);
if condition1=true and Bias[2]>bias[1] and Bias[1] <Bias and Bias<BIASLength then begin
buy next bar at market;
end;
if Xaverage(close,LengthShort) crosses under Xaverage(close,LengthLong) then
begin
condition1=false;
sell next bar at market;
end;
if Xaverage(close,LengthShort) crosses below Xaverage(close,LengthLong) then condition2=true;
if condition2=true and Bias[2]<bias[1] and Bias[1] >Bias and Bias<BIASLength then
begin
sellshort next bar at market;
end;
if Xaverage(close,LengthShort) crosses above Xaverage(close,LengthLong) then
begin
condition2=false;
buytocover next bar at market;
end;


IP属地:云南1楼2019-04-02 16:45回复
    点个赞


    来自iPhone客户端2楼2019-04-20 13:52
    回复
      谢谢了,很好


      IP属地:湖北来自Android客户端3楼2019-04-23 09:57
      回复
        找不到


        来自Android客户端4楼2022-01-23 10:24
        回复