以文本方式查看主题

-  金字塔客服中心 - 专业程序化交易软件提供商  (http://222.73.7.161/bbs/index.asp)
--  公式模型编写问题提交  (http://222.73.7.161/bbs/list.asp?boardid=4)
----  [原创]移动止损后台交易模板  (http://222.73.7.161/bbs/dispbbs.asp?boardid=4&id=3619)

--  作者:z7c9
--  发布时间:2010/11/1 17:18:23
--  [原创]移动止损后台交易模板
以下内容为程序代码:

1 input:stopnum(20,5,50,5);
2 runmode:1;
3
4 if tholding=0 then begin
5     extgbdataset(\'stopprice\',low-stopnum*mindiff);
6     tbuy(1,1,lmt,close);
7 end;
8
9 if tholding>0 then begin
10     if low-stopnum*mindiff>extgbdata(\'stopprice\') then
11         extgbdataset(\'stopprice\',low-stopnum*mindiff);
12     
13     if low<=extgbdata(\'stopprice\') then begin
14         tsell(1,tholding,lmt,extgbdata(\'stopprice\')),orderqueue;
15         tbuyshort(1,1,lmt,extgbdata(\'stopprice\')),orderqueue;
16     end;
17 end;
18
19 if tholding<0 then begin
20     if high+stopnum*mindiff<extgbdata(\'stopprice\') then
21         extgbdataset(\'stopprice\',high+stopnum*mindiff);
22     
23     if high>=extgbdata(\'stopprice\') then begin
24         tsellshort(1,tholding,lmt,extgbdata(\'stopprice\')),orderqueue;
25         tbuy(1,1,lmt,extgbdata(\'stopprice\')),orderqueue;
26     end;    
27 end;
28

--  作者:CITSCWB
--  发布时间:2010/11/7 10:32:00
--  

通不过


--  作者:admin
--  发布时间:2010/11/7 10:39:02
--  
将代码前面序号去掉
--  作者:guotx2010
--  发布时间:2011/1/9 1:36:45
--  
学习了
--  作者:xian_0_9
--  发布时间:2011/1/13 21:19:08
--  
...一下就奖励5个金币。。真好啊。
--  作者:szstock2002
--  发布时间:2011/1/14 17:35:08
--  


 input:stopnum(20,5,50,5);
 runmode:1;
 
 if tholding=0 then begin
     extgbdataset(\'stopprice\',low-stopnum*mindiff);
     tbuy(1,1,lmt,close);
 end;
 
 if tholding>0 then begin
     if low-stopnum*mindiff>extgbdata(\'stopprice\') then
         extgbdataset(\'stopprice\',low-stopnum*mindiff);
     
     if low<=extgbdata(\'stopprice\') then begin
         tsell(1,tholding,lmt,extgbdata(\'stopprice\')),orderqueue;
         tbuyshort(1,1,lmt,extgbdata(\'stopprice\')),orderqueue;
     end;
 end;

 if tholding<0 then begin
     if high+stopnum*mindiff<extgbdata(\'stopprice\') then
         extgbdataset(\'stopprice\',high+stopnum*mindiff);
    
     if high>=extgbdata(\'stopprice\') then begin
         tsellshort(1,tholding,lmt,extgbdata(\'stopprice\')),orderqueue;
         tbuy(1,1,lmt,extgbdata(\'stopprice\')),orderqueue;
     end;    
 end;

 

 

无法通过!


--  作者:xian_0_9
--  发布时间:2011/1/14 21:49:10
--  

大于号小于号都改成半角就好了。


--  作者:伍星亮
--  发布时间:2011/2/17 17:33:46
--  

哦,原来是这个问题


--  作者:淡定688
--  发布时间:2011/4/28 15:33:56
--  

努力学习!看不懂!


--  作者:xian_0_9
--  发布时间:2011/4/29 22:26:20
--  

只能是在后台运行啊。

[此贴子已经被作者于2011-4-29 22:38:34编辑过]