等级: 免费版
- 注册:
- 2022-4-2
- 曾用名:
|
楼主 |
发表于 2023-5-22 09:54
|
显示全部楼层
随便拿一个单均线策略测的都还是有问题的
input:n1(10,1,100,1);
ma1:ma(AMOUNT/vol/MULTIPLIER,n1);
//计算开仓手数
//仓位定义
lot:=round(15*10000/(oclose*multiplier));
//定义交易条件
bpkcond:=c>ma1;//当前周期多头
spkcond:=c<ma1;//当前周期空头
//交易系统
//开平仓
if bpkcond then begin
sellshort(holding<0,holding,thisclose);
buy(holding=0,lot,thisclose);
end
if spkcond then begin
sell(holding>0,holding,thisclose);
buyshort(holding=0,lot,thisclose);
end
当前持仓:holding,colorgray,linethick0;
当前资产:asset,noaxis,colorgray;
|
|