分析家公式网,提供指标公式,股票软件 用户登录  |  用户 注册

软件名称:[B]后台持仓同步的写法【金字塔软件 源码 贴图】[/B]
软件类型:国产软件
运行环境:Win2000/WinXP/Win2003/WinVista
软件语言:简体中文
授权方式:共享软件
软件大小:0 Bytes
官方主页:Home Page
更新时间:2016-05-10 04:18:34
软件简介:

最近怎么老是有人求助 后台持仓同步 的写法
这里简单写一下
//适用软件:金字塔

//注意:不勾选软件自带追单功能,此模型自带
//固定1秒轮询
cc:=holding;
if holding>0 and c<ref(c,1) then sell(1,1,market);
if holding<0 and c>ref(c,1) then sellshort(1,1,market);
if holding=0 and c>ref(c,1) then buy(1,1,market);
if holding=0 and c<ref(c,1) then buyshort(1,1,market);
if not(islastbar) or workmode<>1 then exit;
tm:=30;//撤单时间
ac:='800988';//下单账户
wt:=tremainqty(0,ac,stklabel);
buyhold:=tbuyholdingex(ac,stklabel,1);
sellhold:=tsellholdingex(ac,stklabel,1);
if wt>0.5 and tsubmit(0)>tm then tcancelex(1,0,ac,stklabel);//如果用软件自带的撤单功能,这句删除。
if wt<0.5 then begin
kc1:=max(cc,0)-buyhold;
kc2:=abs(min(cc,0))-sellhold;
if kc1<-0.5 then tsell(1,abs(kc1),mkt,0,0,ac),allowrepeat;
if kc2<-0.5 then tsellshort(1,abs(kc2),mkt,0,0,ac),allowrepeat;
if sellhold<0.5 and kc1>0.5 then tbuy(1,kc1,mkt,0,0,ac),allowrepeat;
if buyhold<0.5  and kc2>0.5 then tbuyshort(1,kc2,mkt,0,0,ac),allowrepeat;
end


[url=http://www.70822.com/soft/sort013/sort068/down-97970.html]后台持仓同步的写法【金字塔软件 源码 贴图】[/url]

关于本站 | 网站帮助 | 广告合作 | 声明 | 友情连接 | 网站地图 |
分析家公式网声明:本站所有股票公式软件资料均网上公开收集,如侵权请联系删帖。站内所有广告,均与本站无关!
Copyright © 2003-2024 70822.Com. All Rights Reserved .
页面执行时间:46.87500 毫秒