欢迎使用金字塔普通技术服务论坛,您可以在相关区域发表技术支持贴。
我司技术服务人员将优先处理 VIP客服论坛 服务贴,普通区问题处理速度慢,请耐心等待。谢谢您对我们的支持与理解。


金字塔客服中心 - 专业程序化交易软件提供商金字塔软件公式模型编写问题提交 → [原创]合约属性设置公式

   

欢迎使用金字塔普通技术服务论坛,您可以在相关区域发表技术支持贴。
我司技术服务人员将优先处理 VIP客服论坛 服务贴,普通区问题处理速度慢,请耐心等待。谢谢您对我们的支持与理解。    


  共有5175人关注过本帖树形打印复制链接

主题:[原创]合约属性设置公式

帅哥哟,离线,有人找我吗?
z7c9
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:小飞侠 帖子:1882 积分:3310 威望:0 精华:15 注册:2010/3/15 13:11:56
[原创]合约属性设置公式  发帖心情 Post By:2010/11/26 21:33:14    Post IP:114.241.166.3[只看该作者]

阅读版:

以下内容为程序代码:

1 if strcmp(marketlabel,'SQ')=0 then begin
2     label:=strleft(stklabel,2);
3     
4     if strcmp(label,'CU')=0 then begin
5         commission:=100;
6         marginlevel:=0.15;
7         goto s1@;
8     end;
9     
10     if strcmp(label,'ZN')=0 then begin
11         commission:=12;
12         marginlevel:=0.16;
13         goto s1@;
14     end;
15     
16     if strcmp(label,'AL')=0 then begin    
17         commission:=6;
18         marginlevel:=0.13;
19         goto s1@;
20     end;
21     
22     if strcmp(label,'AU')=0 then begin
23         commission:=45;
24         marginlevel:=0.13;
25         goto s1@;
26     end;
27     
28     if strcmp(label,'RB')=0 then begin    
29         commission:=7;
30         marginlevel:=0.14;
31         goto s1@;
32     end;
33         
34     if strcmp(label,'RU')=0 then begin    
35         commission:=24;
36         marginlevel:=0.16;
37         goto s1@;
38     end;    
39     
40     if strcmp(label,'FU')=0 then begin
41         commission:=3;
42         marginlevel:=0.14;
43         goto s1@;
44     end;
45     
46     if strcmp(label,'WR')=0 then begin
47         commission:=7;
48         marginlevel:=0.15;
49         goto s1@;
50     end;
51 end;
52
53 if strcmp(marketlabel,'DQ')=0 then begin
54     label:=strleft(stklabel,1);
55     
56     if strcmp(label,'M')=0 then begin
57         commission:=5;
58         marginlevel:=0.13;
59         goto s1@;
60     end;
61     
62     if strcmp(label,'A')=0 then begin
63         commission:=6;
64         marginlevel:=0.13;
65         goto s1@;
66     end;
67     
68     if strcmp(label,'C')=0 then begin
69         commission:=3;
70         marginlevel:=0.12;
71         goto s1@;
72     end;
73     
74     if strcmp(label,'Y')=0 then begin
75         commission:=8;
76         marginlevel:=0.13;
77         goto s1@;
78     end;
79     
80     if strcmp(label,'P')=0 then begin
81         commission:=6;
82         marginlevel:=0.15;
83         goto s1@;
84     end;
85     
86     if strcmp(label,'L')=0 then begin
87         commission:=12;
88         marginlevel:=0.15;
89         goto s1@;
90     end;
91     
92     if strcmp(label,'V')=0 then begin
93         commission:=12;
94         marginlevel:=0.15;
95         goto s1@;
96     end;
97     
98     if strcmp(label,'B')=0 then begin
99         commission:=6;
100         marginlevel:=0.15;
101         goto s1@;
102     end;
103 end;
104
105 if strcmp(marketlabel,'ZQ')=0 then begin
106     label:=strleft(stklabel,2);
107     
108     if strcmp(label,'SR')=0 then begin
109         commission:=6;
110         marginlevel:=0.16;
111         goto s1@;
112     end;
113     
114     if strcmp(label,'CF')=0 then begin
115         commission:=12;
116         marginlevel:=0.16;
117         goto s1@;
118     end;
119     
120     if strcmp(label,'TA')=0 then begin
121         commission:=8;
122         marginlevel:=0.16;
123         goto s1@;
124     end;
125     
126     if strcmp(label,'RO')=0 then begin
127         commission:=6;
128         marginlevel:=0.16;
129         goto s1@;
130     end;
131     
132     if strcmp(label,'ER')=0 then begin
133         commission:=3;
134         marginlevel:=0.13;
135         goto s1@;
136     end;
137     
138     if strcmp(label,'WS')=0 then begin
139         commission:=3;
140         marginlevel:=0.13;
141         goto s1@;
142     end;
143     
144     if strcmp(label,'WT')=0 then begin
145         commission:=3;
146         marginlevel:=0.15;
147         goto s1@;
148     end;
149 end;
150
151 if strcmp(marketlabel,'ZJ')=0 then begin
152     label:=strleft(stklabel,2);
153     
154     if strcmp(label,'IF')=0 then begin    
155         commission:=150;
156         marginlevel:=0.2;
157         goto s2@;
158     end;
159 end;
160
161 s1@;
162 begintime:=time>=092000 and time<=145500;
163 endtime:=time>=150000;
164 goto s@;
165
166 s2@;
167 begintime:=time>=093500 and time<=151000;
168 endtime:=time>=151500;
169 goto s@;
170
171 s@;
172

 

拷贝版:

if strcmp(marketlabel,'SQ')=0 then begin
label:=strleft(stklabel,2);

if strcmp(label,'CU')=0 then begin
commission:=100;
marginlevel:=0.15;
goto s1@;
end;

if strcmp(label,'ZN')=0 then begin
commission:=12;
marginlevel:=0.16;
goto s1@;
end;

if strcmp(label,'AL')=0 then begin
commission:=6;
marginlevel:=0.13;
goto s1@;
end;

if strcmp(label,'AU')=0 then begin
commission:=45;
marginlevel:=0.13;
goto s1@;
end;

if strcmp(label,'RB')=0 then begin
commission:=7;
marginlevel:=0.14;
goto s1@;
end;

if strcmp(label,'RU')=0 then begin
commission:=24;
marginlevel:=0.16;
goto s1@;
end;

if strcmp(label,'FU')=0 then begin
commission:=3;
marginlevel:=0.14;
goto s1@;
end;

if strcmp(label,'WR')=0 then begin
commission:=7;
marginlevel:=0.15;
goto s1@;
end;
end;

if strcmp(marketlabel,'DQ')=0 then begin
label:=strleft(stklabel,1);

if strcmp(label,'M')=0 then begin
commission:=5;
marginlevel:=0.13;
goto s1@;
end;

if strcmp(label,'A')=0 then begin
commission:=6;
marginlevel:=0.13;
goto s1@;
end;

if strcmp(label,'C')=0 then begin
commission:=3;
marginlevel:=0.12;
goto s1@;
end;

if strcmp(label,'Y')=0 then begin
commission:=8;
marginlevel:=0.13;
goto s1@;
end;

if strcmp(label,'P')=0 then begin
commission:=6;
marginlevel:=0.15;
goto s1@;
end;

if strcmp(label,'L')=0 then begin
commission:=12;
marginlevel:=0.15;
goto s1@;
end;

if strcmp(label,'V')=0 then begin
commission:=12;
marginlevel:=0.15;
goto s1@;
end;

if strcmp(label,'B')=0 then begin
commission:=6;
marginlevel:=0.15;
goto s1@;
end;
end;

if strcmp(marketlabel,'ZQ')=0 then begin
label:=strleft(stklabel,2);

if strcmp(label,'SR')=0 then begin
commission:=6;
marginlevel:=0.16;
goto s1@;
end;

if strcmp(label,'CF')=0 then begin
commission:=12;
marginlevel:=0.16;
goto s1@;
end;

if strcmp(label,'TA')=0 then begin
commission:=8;
marginlevel:=0.16;
goto s1@;
end;

if strcmp(label,'RO')=0 then begin
commission:=6;
marginlevel:=0.16;
goto s1@;
end;

if strcmp(label,'ER')=0 then begin
commission:=3;
marginlevel:=0.13;
goto s1@;
end;

if strcmp(label,'WS')=0 then begin
commission:=3;
marginlevel:=0.13;
goto s1@;
end;

if strcmp(label,'WT')=0 then begin
commission:=3;
marginlevel:=0.15;
goto s1@;
end;
end;

if strcmp(marketlabel,'ZJ')=0 then begin
label:=strleft(stklabel,2);

if strcmp(label,'IF')=0 then begin
commission:=150;
marginlevel:=0.2;
goto s2@;
end;
end;

s1@;
begintime:=time>=092000 and time<=145500;
endtime:=time>=150000;
goto s@;

s2@;
begintime:=time>=093500 and time<=151000;
endtime:=time>=151500;
goto s@;

s@;


 回到顶部
帅哥哟,离线,有人找我吗?
yanggaga0
  2楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:新手上路 帖子:19 积分:154 威望:0 精华:0 注册:2010/5/24 11:09:28
[求助]请问连续AND和OR函数语句是怎么理解的  发帖心情 Post By:2010/11/30 14:45:55    Post IP:218.56.38.45[只看该作者]

水平浅,没有看懂,请教一下,这个公式的目的和效果是什么呢?


 回到顶部