Rss & SiteMap

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

专业程序化软件提供商
共14 条记录, 每页显示 10 条, 页签: [1] [2]
[浏览完整版]

标题:求助

1楼
zouyingsheng 发表于:2011/8/5 11:22:04
后台程序同一策略针对不同品种在同一账户里的tholding2要怎么来定义?
2楼
董小球 发表于:2011/8/5 11:28:26

TSELLHOLDINGEX( , , )

有这样的函数,可以设置参数,

你看看后台交易函数列表里的解释

3楼
zouyingsheng 发表于:2011/8/5 15:10:31
帮我写一个5日均线上穿10日均线时开多平空 rb01和m05和ta01 的后台程序,指定资金账号是12202822,让我参考一下,谢谢!!
4楼
just 发表于:2011/8/5 15:42:45

ma5:ma(c,5);
ma10:ma(c,10);
sp:=cross (ma5,ma10);
bp:=cross (ma10,ma5);

long:=  tholding<=0 and sp;
if long then begin
tsellshort(1,0,0,0,mkt,'12202822');
tbuy(1,1,0,0,mkt,'12202822');
end

short:= tholding>=0 and bp;

if short then begin
tsell(1,0,0,0,mkt,'12202822');
tbuyshort(1,1,0,0,mkt,'12202822');
end

[此贴子已经被作者于2011-8-5 15:56:09编辑过]
5楼
zouyingsheng 发表于:2011/8/5 15:53:02
rb01和m05和ta01 三品种的持仓不会混起来吗?
6楼
王锋 发表于:2011/8/5 15:57:30

他们是顺序依次调用的,不会混的。

你试试用DEBUGOUT函数调试一下输出,看看效果

7楼
just 发表于:2011/8/5 16:21:54

ma5:ma(c,5);
ma10:ma(c,10);
sp:=cross (ma5,ma10);
bp:=cross (ma10,ma5);

long:=  tholding<=0 and sp;
if long then begin
tsellshort(1,0,mkt,0,0,'12202822');
tbuy(1,1,mkt,0,0,'12202822');
end

short:= tholding>=0 and bp;

if short then begin
tsell(1,0,mkt,0,0,'12202822');
tbuyshort(1,1,mkt,0,0,'12202822');
end

前面写错了图片点击可在新窗口打开查看
8楼
zouyingsheng 发表于:2011/8/8 9:27:27

ma42:ma(c,60);

long1:=  tholding<0 and c>ma42;
long2:=  tholding=0 and c>ma42 and ma42>ref(ma42,1);
 

tsellshort(long1,0,0,0,mkt,'800794');
tbuy(long2,1,0,0,mkt,'800794');

 

short1:= tholding>0 and c<ma42;
short2:= tholding=0 and c<ma42 and ma42<ref(ma42,1);

tsell(short1,0,0,0,mkt,'800794');
tbuyshort(short2,1,0,0,mkt,'800794');

请帮我看一下,这个程序在后台会预警账户不会开仓,错在哪啦

9楼
just 发表于:2011/8/8 9:30:15
tsell(short1,0,0,0,mkt,'800794');
tbuyshort(short2,1,0,0,mkt,'800794'); 你犯了跟我一样的错误图片点击可在新窗口打开查看
10楼
zouyingsheng 发表于:2011/8/8 9:33:06

那要怎么改呢

共14 条记录, 每页显示 10 条, 页签: [1] [2]


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