以文本方式查看主题

-  金字塔客服中心 - 专业程序化交易软件提供商  (http://weistock.com/bbs/index.asp)
--  公式模型编写问题提交  (http://weistock.com/bbs/list.asp?boardid=4)
----  [原创]合约属性设置公式  (http://weistock.com/bbs/dispbbs.asp?boardid=4&id=4143)

--  作者:z7c9
--  发布时间:2010/11/26 21:33:14
--  [原创]合约属性设置公式

阅读版:

以下内容为程序代码:

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
--  发布时间:2010/11/30 14:45:55
--  [求助]请问连续AND和OR函数语句是怎么理解的

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