: | : | :期货程序化 | :期货程序化研究 | :期货量化学习 | :期货量化 |
返回列表 发帖

[TS源码] 我们的 "涡轮增压罗素日间交易系统 "需要调整吗?【原文+程式码】

[TS源码] 我们的 "涡轮增压罗素日间交易系统 "需要调整吗?【原文+程式码】

本帖隐藏的内容需要回复才可以浏览

论坛官方微信、群(期货热点、量化探讨、开户与绑定实盘)
 
期货论坛 - 版权/免责声明   1.本站发布源码(包括函数、指标、策略等)均属开放源码,用意在于让使用者学习程序化语法撰写,使用者可以任意修改语法內容并调整参数。仅限用于个人学习使用,请勿转载、滥用,严禁私自连接实盘账户交易
  2.本站发布资讯(包括文章、视频、历史记录、教材、评论、资讯、交易方案等)均系转载自网络主流媒体,内容仅为作者当日个人观点,本网转载此文出于传递更多信息之目的,并不意味着赞同其观点或证实其描述。本网不对该类信息或数据做任何保证。不对您构成任何投资建议,不能依靠信息而取代自身独立判断,不对因使用本篇文章所诉信息或观点等导致的损失承担任何责任。
  3.本站发布资源(包括书籍、杂志、文档、软件等)均从互联网搜索而来,仅供个人免费交流学习,不可用作商业用途,本站不对显示的内容承担任何责任。请在下载后24小时内删除。如果喜欢,请购买正版,谢谢合作!
  4.龙听期货论坛原创文章属本网版权作品,转载须注明来源“龙听期货论坛”,违者本网将保留追究其相关法律责任的权力。本论坛除发布原创文章外,亦致力于优秀财经文章的交流分享,部分文章推送时若未能及时与原作者取得联系并涉及版权问题时,请及时联系删除。联系方式:http://www.qhlt.cn/thread-262-1-1.html
如何访问权限为100/255贴子:/thread-37840-1-1.html;注册后仍无法回复:/thread-23-1-1.html;微信/QQ群:/thread-262-1-1.html;网盘链接失效解决办法:/thread-93307-1-1.html

11

TOP

学习!
为了赚钱,冲啊!

TOP

  1. inputs: atrLen(10),stopAmtPoints(10.00),offSetAmt(.2),profitObj1(5),endTradeTime(1530);

  2. vars: atrAmt(0),smallRange(false),canBuy(true),canSell(true),stb(0),sts(0),tkpS(0),tkpL(0),yesTrueRange(0); vars: buysToday(0),sellsToday(0),j(0),longLossPt(0),shortLossPt(0);

  3. {Plot on 5 minute day session - programmed by George Pruitt}
  4. {I used the OpenD(),HighD(),LowD(),CloseD() functions to get the prior day’s highs and lows and closes }

  5. value1 = 0;

  6. for j = 1 to atrLen begin
  7. value1 = value1 + maxList(closeD(j+1),highD(j)) - minList(closeD(j+1),lowD(j));
  8. end;

  9. atrAmt = value1/atrLen;

  10. yesTrueRange = maxList(closeD(2),highD(1)) - minList(closeD(2),lowD(1));
  11. smallRange = yesTrueRange < atrAmt;

  12. if(date<>date[1]) then // first bar of the day begin
  13. canBuy = false;
  14. canSell = false;
  15. buysToday = 0;
  16. sellsToday = 0;
  17. end;

  18. if marketPosition = 1 then buysToday = 1; // if we already bot then no more buys
  19. if marketPosition =-1 then sellsToday = 1;

  20. stb = openD(0) + offSetAmt * atrAmt;
  21. sts = openD(0) - offSetAmt * atrAmt;

  22. if(closeD(1)>=closeD(2) and smallRange) then canBuy = true;
  23. if(closeD(1)<closeD(2) and smallRange) then canSell = true;

  24. if(canBuy and buysToday = 0 and time < endTradeTime) then buy(“SFOBuy”) 2 contracts next bar stb stop;
  25. if(canSell and sellsToday = 0 and time < endTradeTime ) then sellShort(“SFOSell”) 2 contracts next bar sts stop;

  26. if currentContracts = 2 and marketPosition = 1 and highD(0) > entryPrice + profitObj1 then sell(“LongProf1”) 1 contract next bar at highD(0) - 5 stop;
  27. if currentContracts = 2 and marketPosition =-1 and lowD(0) < entryPrice - profitObj1 then buyToCover(“ShrtProf1”) 1 contract next bar at lowD(0) + 5 stop;

  28. if currentContracts = 1 then sell(“L-BreakEven”) next bar at entryPrice stop;
  29. if currentContracts = 1 then buyToCover(“S-BreakEven”) next bar at entryPrice stop;

  30. if marketPosition = 1 then sell(“MM-L-Out”) next bar at entryPrice - stopAmtPoints stop;
  31. if marketPosition =-1 then buyToCover(“MM-S-Out”) next bar at entryPrice + stopAmtPoints stop; setExitOnClose;
复制代码
如何访问权限为100/255贴子:/thread-37840-1-1.html;注册后仍无法回复:/thread-23-1-1.html;微信/QQ群:/thread-262-1-1.html;网盘链接失效解决办法:/thread-93307-1-1.html

TOP

返回列表