【金字塔策略源码】红黑三兵

0
回复
5174
查看
[复制链接]

39

主题

6

回帖

214

积分

超级版主

积分
214
来源: 2020-3-8 07:21:59 显示全部楼层 |阅读模式
  1. 1 runmode:0;
  2. 2
  3. 3 variable:myholding=0;
  4. 4
  5. 5 buycond:=ref(all(isup,3),1);
  6. 6 buyshortcond:=ref(all(isdown,3),1);
  7. 7
  8. 8 if myholding=0 and buycond then begin
  9. 9     lots:=cash(0)/(open*multiplier*0.1);
  10. 10     buy(1,lots,limitr,open);
  11. 11     myholding:=lots;
  12. 12 end
  13. 13
  14. 14 if myholding=0 and buyshortcond then begin
  15. 15     lots:=cash(0)/(open*multiplier*0.1);
  16. 16     buyshort(1,lots,limitr,open);
  17. 17     myholding:=-lots;
  18. 18 end
  19. 19
  20. 20 if myholding>0 and time=closetime(0) then begin
  21. 21     sell(1,myholding,limitr,close);
  22. 22     myholding:=0;
  23. 23 end
  24. 24
  25. 25 if myholding<0 and time=closetime(0) then begin
  26. 26     sellshort(1,myholding,limitr,close);
  27. 27     myholding:=0;
  28. 28 end
复制代码


回复

使用道具 举报

您需要登录后才可以回帖 登录 | 免费注册
关注微信