




已阅读5页,还剩7页未读, 继续免费阅读
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
悟多公式DLL部分源码这个已经超出了证券软件自带编程函数外的东东如果这里有计算机软件 编程专业的 应该一看就懂但如果会计算机编程 如果对缠师的文章理解不了 或着说千人千缠用计算机编程语言去写 也就不一定是原味了 1 处理kxian顶底的源代码23 function kxian(pData:pTagCALCINFO):integer;stdcall;export;4 const quekou:single=0.005;5 var6 i,j,k,m,n:integer;7 h,h1,h2,h3,h4,h5,h6,h7:single;8 tj1,tj2,tj3,tj4:boolean;9 begin1011 if (pData.m_pfParam1 nil) and (pData.m_pfParam2 nil) then12 begin13 adjustkline(pdata); /处理包含关系;14 firstduan:=true;15 prtype:=pdata.m_dataType;1617 case prtype of18 MIN1_DATA: /119 biquekou:=quekou;20 MIN5_DATA: /521 biquekou:=quekou*3;22 MIN15_DATA: /1523 biquekou:=Quekou*6 ;24 MIN30_DATA: /3025 biquekou:=quekou*9;26 MIN60_DATA:/ 6027 biquekou:=quekou*18;28 DAY_DATA: /day29 biquekou:=quekou*30;30 WEEK_DATA: /周线31 biquekou:=quekou*90;32 MONTH_DATA:33 biquekou:=quekou*250;34 YEAR_DATA:35 biquekou:=quekou*1000;36 MULTIday_DATA:37 biquekou:=quekou*500;38 MULTmin_DATA:39 biquekou:=quekou*20;40 else41 biquekou:=quekou*500;4243 end;44 /标出顶和底45 pr0.flag:=0;46 prprnum-1.flag:=0;47 for i:=1 to prnum-2 do48 begin4950 h:=pr.hprice;51 j:=i-1;52 h1:=prj.hprice;53 while (h=h1) and (j0) do/取前一个不同的高值54 begin55 j:=j-1;56 h1:=prj.hprice;57 end;58 m:=j;59 if j0 then j:=j-1;60 h2:=prj.hprice;6162 while (h1=h2) and (j0) do/最前2个不同的值63 begin64 j:=j-1;65 h2:=prj.hprice;66 end;67 if j0 then j:=j-1;68 h3:=prj.hprice;69 while (h2=h3) and (j0) do/取前3个不同的值70 begin71 j:=j-1;72 h3:=prj.hprice;73 end;747576 k:=i+1;77 h4:=prk.hprice;78 while (h=h4) and (kprnum-1) do /后一个不同高值79 begin80 k:=k+1;81 h4:=prk.hprice;82 end;83 n:=k;84 if (kprnum-1) then k:=k+1;85 h5:=prk.hprice;86 while (h4=h5) and (kprnum-1) do /后2个不同高值87 begin88 k:=k+1;89 h5:=prk.hprice;90 end;91 if (kprnum-1) then k:=k+1;92 h6:=prk.hprice;93 while (h5=h6) and (k=prnum) or (n+3=prnum) then break;99100 tj1:=false;tj2:=false;101 tj3:=false;tj4:=false;102 if (h=h1) and (h=h2) and (h=h3) and (h=h4)103 and (h=h5) and (h=h6) then /判断顶底104 tj1:=true;105106 if m=3 then h7:=prm-3.hprice else h7:=pr0.hprice;107108 if (h=h1) and (h=h2) and109 (h=h3) and (h=h7) and110 (h=prn.hprice) and (h=prn+1.hprice) and111 (h=prn+2.hprice) and (h=prn+3.hprice) then112 tj2:=true;113114 if not (tj1 and tj2) then115 begin116117 h:=pr.lprice;118 j:=i-1;119 h1:=prj.lprice;120 while (h=h1) and (j0) do/取前一个不同的低值121 begin122 j:=j-1;123 h1:=prj.lprice;124 end;125 m:=j;126 if j0 then j:=j-1;127 h2:=prj.lprice;128 while (h1=h2) and (j0) do/最前2个不同的值129 begin130 j:=j-1;131 h2:=prj.lprice;132 end;133 if j0 then j:=j-1;134 h3:=prj.lprice;135 while (h2=h3) and (j0) do/取前3个不同的值136 begin137 j:=j-1;138 h3:=prj.lprice;139 end;140141142143 k:=i+1;144 h4:=prk.lprice;145 while (h=h4) and (kprnum-1) do /后1个不同低值146 begin147 k:=k+1;148 h4:=prk.lprice;149 end;150 n:=k;151 if (kprnum-1) then k:=k+1;152 h5:=prk.lprice;153 while (h4=h5) and (kprnum-1) do /后2个不同高值154 begin155 k:=k+1;156 h5:=prk.lprice;157 end;158 if (kprnum-1) then k:=k+1;159 h6:=prk.lprice;160 while (h5=h6) and (k=prnum) or (n+3=prnum) then break;166167 if (h=h1) and (h=h2) and (h=h3) and (h=h4)168 and (h=h5) and (h=3 then h7:=prm-3.lprice else h7:=pr0.lprice;172173 if (h=h1) and (h=h2) and (h=h3) and (h=h7) and174 (h=prn.lprice) and (h=prn+1.lprice) and175 (h=prn+2.lprice) and (h=prn+3.lprice) then176 tj4:=true;177 end;178179 if tj1 and tj2 then180 pr.flag:=1181 else182 if tj3 and tj4 then183 pr.flag:=-1184 else185 pr.flag:=0;186187 end;/end for188189190 for i:=1 to prnum-2 do /检查几个包含后重复的。191 begin192193194 m:=pr.flag;195 if m= 1 then196 begin197 if pdata.m_pData.m_fHigh=pr.hprice then198 begin199 pr.flag:=1;200 j:=i+1; /如果前面的相同,只标最后一个201 h:=prj.hprice;202 while (h=pr.hprice) and (jprnum-1) do203 begin204 j:=j+1;205 h:=prj.hprice;206 end;207 for k:=i+1 to (j-1) do208 begin209 prk.flag:=0;210 end;211 end212 else213 pr.flag:=0;214 end;215 if m= -1 then216 begin217 if pdata.m_pData.m_fLow=pr.lprice then218 begin219 pr.flag:=-1;220 j:=i+1; /如果前面的相同,只标最后一个221 h:=prj.lprice;222 while (h=pr.lprice) and (jprnum-1) do223 begin224 j:=j+1;225 h:=prj.lprice;226 end;227 for k:=i+1 to (j-1) do228 begin229 prk.flag:=0;230 end;231 end232 else233 pr.flag:=0;234 end;235 end;/end 检查重复的236237 adjustdd(1,prnum-2);238239 checkhl();240241242 for i:=0 to prnum-1 do243 pdata.m_pResultBuf:=pr.flag;244245 result:=1;246 end / end if NULL247 else248 result:=0;249250251 end;252253254255 处理笔关系的源代码256257 function bi(pData:pTagCALCINFO):integer;stdcall;export;258 var259 i,j,k,l,m,n:integer;260 p1,p2,s:single;261 ctfg,bictfg:boolean;262 buf:array0.9 of single;263 begin264265 /adjustdd(1,prnum-2); /合并多顶连续266 /找和后面不构成一笔的情况267 /去掉后面一个,然后再同取高值或低值268 i:=1;269 while i(prnum-1) do270 begin271272273 k:=pri.flag;274 if k0 then275 begin276 j:=i+1;277 l:=prj.flag;278 while (l=0) and (j= 4 then311 break;312 end;/end for313314315 bictfg:=false;316 /缺口处理过程317318 begin319320 s:=0;321 if pri.flag=-1 then/向上322 begin323 for k:=i to j-1 do324 begin325 p1:=pdata.m_pdatak.m_fHigh;326 p2:=pdata.m_pdatak+1.m_fLow;327 / p1:=prk.hprice;328 / p2:=prk+1.lprice;329 if p2p1 then330 s:=(p2/p1 -1)+s;331 end;332 end333 else/向下334 begin335 for k:=i to j-1 do336 begin337 / p1:=prk.lprice;338 / p2:=prk+1.hprice;339340 p1:=pdata.m_pdatak.m_flow;341 p2:=pdata.m_pdatak+1.m_fhigh;342 if p1p2 then343 s:=abs(p2/p1 -1)+s;344 end;345 end;346347 if s=biQUEKOU then348 bictfg:=true;349350 end;351352353 if m=4 then/包含后大于4根,再次判断354 begin355 if j-i =4 then /不包含,至少5根356 begin357 if prtypeMIN5_DATA then /5分钟分笔幅度太小的,舍掉358 bictfg:=True359 else360 begin361 if prj.flag=1 then362 begin363 s:=(prj.hprice-pri.lprice)/pri.lprice;364 if (j-i=6) or (s=0.008) then365 bictfg:=true;366 end;367368 if prj.flag=-1 then369 begin370 s:=(pri.hprice-prj.lprice)/pri.hprice;371 if (j-i=6) or (s=0.008) then372 bictfg:=true;373 end;374 end;375 end;376 end;/ end m=4377 if not bictfg then /如果不是一笔,进行下面的处理378 begin379 k:=i;380 l:=prk.flag;381 k:=k+1;382 while (lprk.flag) and (k=p2 then /前顶比后顶高;389 begin390 prj.flag:=0;391 prk.flag:=0;392 end393 else/前顶比后顶矮394 begin395 pri.flag:=0; /先把自己去掉396 n:=j;397 m:=prn.flag;398 n:=n-1;399 while (mprn.flag) and (n0) do400 n:=n-1;401 p1:=prn.lprice;402 p2:=prj.lprice;403 if p1p2 then404 begin405 prj.flag:=0;406 end407 else408 prn.flag:=0;409 end;/end else410 i:=i-1;411 end;412 if l=-1 then413 begin414 p1:=pri.lprice;415 p2:=prk.lprice;416 if p1=p2 then /前底比后底矮417 begin418 prj.flag:=0;419 prk.flag:=0;420421 end422 else/前底比后底高423 begin424 pri.flag:=0;425 n:=j;426 m:=prn.flag;427 n:=n-1;428 while (mprn.flag) and (n0) do429 n:=n-1;430 p1:=prn.hprice;431 p2:=prj.hprice;432 if p1p2 then433 prj.flag:=0434 else435 prn.flag:=0;436 end;437 i:=i-1;438 end;439440 end;441 end;/ end if k0;442443 i:=i+1;444 end; / end while;445446 447 /检查第一笔448 i:=0;449 while
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 《2025年红薯交易合同》
- 2025YY公司劳动合同范本标准版
- 2025年白茶考试题及答案
- 学校应聘保洁考试题及答案
- 2025年苏州文化知识试卷及答案
- 2025年会考地理安徽真题及答案
- 2025成都物业管理服务合同示范文本
- 科四理论模拟试题及答案
- 衡水声屏障板施工方案
- 水费催收行动方案范本
- 人教版八年级上册历史复习提纲
- 深化新时代教育评价改革总体方案
- 结构生物学01章-结构生物学绪论(一)课件
- 25手术室护理实践指南
- 日语的拨音促音和长音
- 门诊质量控制指标
- YY/T 0661-2008外科植入物用聚(L-乳酸)树脂的标准规范
- GB/T 13253-2006橡胶中锰含量的测定原子吸收光谱法
- 英语文章 the giver每章概述
- 二年级上册数学乘法练习题
- (完整)广州版小学英语三至六年级单词表
评论
0/150
提交评论