打开APP
userphoto
未登录

开通VIP,畅享免费电子书等14项超值服

开通VIP
海龟交易系统和程式码(2) - 交易逻辑及策略探讨 - 策略交易高峰会 EasyLangu...



  1. input: InitialBalance(500000);

  2. vars: N(0), StopLoss(1), DV(0), BB(0), AccountBalance(0), DollarRisk(0), LTT(0), Tracker(0), LastTrade(0), HBP(0),

  3. LBP(0);

  4. if marketposition = 0 then begin BB = 0;

  5. N = AvgTrueRange(20); DV= N*BigPointValue; AccountBalance =InitialBalance;

  6. DV = N * BigPointValue; AccountBalance =InitialBalance + netprofit;

  7. DollarRisk =AccountBalance * .01; LTT =IntPortion(DollarRisk/DV);

  8. StopLoss = 2 * DV * LTT;

  9. if LastTrade = -1 then begin

  10. buy LTT shares next barhighest(h,20) or higher;

  11. buy LTT shares next barhighest(h,20) + (0.5*N) or higher;

  12. buy LTT shares next barhighest(h,20) + (1.0*N) or higher;

  13. buy LTT shares next barhighest(h,20) + (1.5*N) or higher;

  14. sellshort LTT shares nextbar lowest(l,20) or lower;

  15. sellshort LTT shares nextbar lowest(l,20) - (0.5*N) or lower;

  16. sellshort LTT shares nextbar lowest(l,20) - (1.0*N) or lower;

  17. sellshort LTT shares nextbar lowest(l,20) - (1.5*N) or lower;

  18. end;

  19. // LONG 20

  20. if LastTrade = -1 and marketposition =1 then begin

  21. BB = BB + 1;

  22. if currentshares = LTT then begin

  23. buy LTT shares next barhighest(h,20)[BB] + (0.5*N) or higher;

  24. buy LTT shares next barhighest(h,20)[BB] + (1.0*N) or higher;

  25. buy LTT shares next barhighest(h,20)[BB]+ (1.5*N) or higher;

  26. end;

  27. if currentshares = LTT * 2 then begin

  28. buy LTT shares next barhighest(h,20)[BB] + (1.0*N) or higher;

  29. buy LTT shares next barhighest(h,20)[BB] + (1.5*N) or higher;

  30. end;

  31. if currentshares = LTT * 3 then

  32. buy LTT shares next barhighest(h,20)[BB] + (1.5*N) or higher;

  33. end;

  34. sell ("out-S") next barlowest(l,10) or lower;




  35. // SHORT 20

  36. if LastTrade = -1 and marketposition =-1 then begin

  37. BB = BB + 1; if currentshares = LTTthen begin

  38. sellshort LTTshares next bar lowest(l,20)[BB] - (0.5*N) or lower;

  39. sellshort LTTshares next bar lowest(l,20)[BB] - (1.0*N) or lower;

  40. sellshort LTTshares next bar lowest(l,20)[BB] - (1.5*N) or lower;

  41. end;

  42. if currentshares = LTT * 2 then begin

  43. sellshort LTT shares nextbar lowest(l,20)[BB] - (1.0*N) or lower;

  44. sellshort LTT shares nextbar lowest(l,20)[BB] - (1.5*N) or lower;

  45. end;

  46. if currentshares = LTT * 3 then

  47. sellshort LTT shares nextbar lowest(l,20)[BB] - (1.5*N) or lower;

  48. end;
本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请点击举报
打开APP,阅读全文并永久保存 查看更多类似文章
猜你喜欢
类似文章
【热】打开小程序,算一算2024你的财运
[转载]改进版海龟交易法则代码(MC&TS)
●海龜交易系統
fwh3358-布林极限BB指标是一个牛市中不错的抄底指标
BB 这个指标源码(通达信自带的)
布林极限%BB和布林极限宽Band width
High levels of urate in blood associated with lower risk of Parkinson's disease
更多类似文章 >>
生活服务
热点新闻
分享 收藏 导长图 关注 下载文章
绑定账号成功
后续可登录账号畅享VIP特权!
如果VIP功能使用有故障,
可点击这里联系客服!

联系客服