Rss & SiteMap

金字塔客服中心 - 专业程序化交易软件提供商 http://www.weistock.com/bbs/

专业程序化软件提供商
共86 条记录, 每页显示 10 条, 页签: [1] [2][3][4][5][6][7][8]
[浏览完整版]

标题:对应策略平仓

1楼
fxrock4 发表于:2016/12/27 14:05:06
kd1的单子用pd1平仓
kd2的单子用pd2平仓
开空同理。
老师如何编写,多谢。
2楼
jinzhe 发表于:2016/12/27 14:19:34
开多1和开多2是互斥(只有一个会开)还是能并行的(两个都能开,两个条件的单子并存)
3楼
fxrock4 发表于:2016/12/27 14:21:57
开仓要求互斥的。
4楼
jinzhe 发表于:2016/12/27 14:33:26

variable:bj=0;

 

if 开多条件1 and holding=0 and bj=0 then begin

     bj:=1;

     buy(1,1,thisclose);

end

 

if 开多条件2 and holding=0  and bj=0 then begin

    bj:=2;

    buy(1,1,thisclose);

end

 

 

if 平多条件1 and holding>0 and bj=1 then begin

   sell(1,0,thisclose);

   bj:=0;

end

 

if 平多条件2 and holding>0 and bj=2 then begin

   sell(1,0,thisclose);

   bj:=0;

end

 

用全局变量定义个BJ,BJ=0时可以开仓,=1时平开多条件1的仓,=2时平开多条件2的仓

5楼
fxrock4 发表于:2016/12/28 9:07:54
按此代码写的交易系统,如何再写一个对应的开多平多播放声音的代码。多谢
6楼
jinzhe 发表于:2016/12/28 9:13:02

if 平多条件1 and holding>0 and bj=1 then begin

   sell(1,0,thisclose);

   bj:=0;

   playsound(1,'声音文件1路径');

end

 

if 平多条件2 and holding>0 and bj=2 then begin

   sell(1,0,thisclose);

   bj:=0;

    playsound(2,'声音文件2路径');

end

7楼
fxrock4 发表于:2016/12/28 9:38:53
playsound(2,'D:\Weisoft Stock\mp3\平多.wmv');
照做了,还是没播放声音。
8楼
jinzhe 发表于:2016/12/28 9:44:11
你把声音文件所在的路径截图发一下
9楼
fxrock4 发表于:2016/12/28 9:58:20
好吧,上传了。
图片点击可在新窗口打开查看此主题相关图片如下:8.jpg
图片点击可在新窗口打开查看
10楼
jinzhe 发表于:2016/12/28 10:01:47
有没有MP3格式的?
共86 条记录, 每页显示 10 条, 页签: [1] [2][3][4][5][6][7][8]


Powered By Dvbbs Version 8.3.0
Processed in 0.01563 s, 3 queries.