以文本方式查看主题

-  金字塔客服中心 - 专业程序化交易软件提供商  (http://www.weistock.com/bbs/index.asp)
--  策略编写求助区  (http://www.weistock.com/bbs/list.asp?boardid=11)
----  请老师帮忙写一个后台止损代码  (http://www.weistock.com/bbs/dispbbs.asp?boardid=11&id=158537)

--  作者:李小妞68
--  发布时间:2017/10/11 17:36:19
--  请老师帮忙写一个后台止损代码

请老师帮忙写一个后台止损代码,谢谢!

指定股票代码,指定执行时间,指定股价小于设定价,指定卖出数量

如:

卖出股票代码:002179

执行时间:14:56:30

当最新价<36.78

卖出数量:10000


--  作者:fly
--  发布时间:2017/11/6 11:06:05
--  
您的代码正在编写中,

后台程序化
周期:1分钟
[此贴子已经被作者于2017/11/6 11:15:05编辑过]

--  作者:banzhuan
--  发布时间:2017/11/8 16:09:14
--  
ma5:ma(close,5);
ma10:ma(close,10);

if strcmp(taccount( 1),\'60004696\') <> 0 then exit; //限定交易账户为60004696使用
if strcmp(stklabel , \'002179\')  <>0 then exit;//限定品种代码为002179,在后台程序化中需添加此监控品种

if cross(ma5,ma10) then  tbuy(1,100000,mkt);
if time=185630 and close<36.78 then tsell(1,10000,mkt);//使用金字塔时区
[此贴子已经被作者于2017/11/8 16:17:41编辑过]