2评论

0收藏

根据账户余额计算开仓手数

avatar 老周 | 2496 人阅读 | 2 人评论 | 2017-03-21

该函数根据账户余额动态计算开仓手数。

  1. int LotSize()
  2. // The function opens a short position with lot size=volume
  3. {
  4. if (AccountBalance()>=50) lot=0.02;
  5. if (AccountBalance()>=100) lot=0.04;
  6. if (AccountBalance()>=200) lot=0.08;
  7. if (AccountBalance()>=300) lot=0.12;
  8. if (AccountBalance()>=400) lot=0.16;
  9. if (AccountBalance()>=500) lot=0.2;
  10. if (AccountBalance()>=600) lot=0.24;
  11. if (AccountBalance()>=700) lot=0.28;
  12. if (AccountBalance()>=800) lot=0.32;
  13. if (AccountBalance()>=900) lot=0.36;
  14. if (AccountBalance()>=1000) lot=0.4;
  15. if (AccountBalance()>=1500) lot=0.6;
  16. if (AccountBalance()>=2000) lot=0.8;
  17. if (AccountBalance()>=2500) lot=1.0;
  18. if (AccountBalance()>=3000) lot=1.2;
  19. if (AccountBalance()>=3500) lot=1.4;
  20. if (AccountBalance()>=4000) lot=1.6;
  21. if (AccountBalance()>=4500) lot=1.8;
  22. if (AccountBalance()>=5000) lot=2.0;
  23. if (AccountBalance()>=5500) lot=2.2;
  24. if (AccountBalance()>=6000) lot=2.4;
  25. if (AccountBalance()>=7000) lot=2.8;
  26. if (AccountBalance()>=8000) lot=3.2;
  27. if (AccountBalance()>=9000) lot=3.6;
  28. if (AccountBalance()>=10000) lot=4.0;
  29. if (AccountBalance()>=15000) lot=6.0;
  30. if (AccountBalance()>=20000) lot=8.0;
  31. if (AccountBalance()>=30000) lot=12;
  32. if (AccountBalance()>=40000) lot=16;
  33. if (AccountBalance()>=50000) lot=20;
  34. if (AccountBalance()>=60000) lot=24;
  35. if (AccountBalance()>=70000) lot=28;
  36. if (AccountBalance()>=80000) lot=32;
  37. if (AccountBalance()>=90000) lot=36;
  38. if (AccountBalance()>=100000) lot=40;
  39. if (AccountBalance()>=200000) lot=80;
  40. }
复制代码


""
还没有人打赏,支持一下

评论|共 2 个

CJL

发表于 2018-6-4 11:33:14 | 显示全部楼层

66666666666

wellyu

发表于 2018-6-9 19:04:55 | 显示全部楼层

没有现实意义

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

EA之家评论守则