Rss & SiteMap

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

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

标题:[求助]持仓与反手,急~~

1楼
msy0985 发表于:2011/10/25 21:41:32

if holding>0 and (ek2) then begin
  sell(1,holding,limitr,c),ORDERQUEUE;
  buyshort(1 and time>091000,ss,limitr,c),ORDERQUEUE;
end

if holding<0 and (ed2) then begin
  sellshort(1,holding,limitr,c),ORDERQUEUE;
  buy(1 and time>091000,ss,limitr,c),ORDERQUEUE;
end

 

buy(ed1 and holding=0,ss,limitr,c);
buyshort(ek1 and holding=0,ss,limitr,c);

buy((d4) and holding=0,ss,limitr,c);
buyshort((k4) and holding=0,ss,limitr,c);

 

是这样:  当d4 k4持仓 遇到ed2 ek2不反手

2楼
just 发表于:2011/10/26 9:24:30

不清楚楼主的 D4 K4等条件是什么,所以我自己随意的定义了下,测试结果是有反手的

ek2:=cross (ma(c,5),ma(c,10));
ed2:=cross (ma(c,10),ma(c,5));
ss:=10;
ed1:=c>ref(c,1);
ek1:=c<ref(c,1);
d4:=c>o;
k4:=c<h;

if holding>0 and (ek2) then begin
  sell(1,holding,limitr,c),ORDERQUEUE;
  buyshort(time>091000,ss,limitr,c),ORDERQUEUE;
end

if holding<0 and (ed2) then begin
  sellshort(1,holding,limitr,c),ORDERQUEUE;
  buy(time>091000,ss,limitr,c),ORDERQUEUE;
end

 

 

buy((d4) and holding=0,ss,limitr,c);
buyshort((k4) and holding=0,ss,limitr,c);

[此贴子已经被作者于2011-10-26 9:53:02编辑过]
3楼
msy0985 发表于:2011/10/26 10:25:37
您误解了,我写的是 我需要得到的答案
4楼
just 发表于:2011/10/26 10:37:39

 

反手1:=ed1 and time>091000;

反手2:=ek1 and time>091000;

if holding>0 and (ek2) then begin
  sell(1,holding,limitr,c),ORDERQUEUE;
  buyshort(反手1,ss,limitr,c),ORDERQUEUE;
end

if holding<0 and (ed2) then begin
  sellshort(1,holding,limitr,c),ORDERQUEUE;
  buy(反手2,ss,limitr,c),ORDERQUEUE;
end

 

buy(ed1 and holding=0,ss,limitr,c);
buyshort(ek1 and holding=0,ss,limitr,c);

buy((d4) and holding=0,ss,limitr,c);
buyshort((k4) and holding=0,ss,limitr,c);

 

是这样:  当d4 k4持仓 遇到ed2 ek2不反手

 

是这个意思吗?

[此贴子已经被作者于2011-10-26 10:38:28编辑过]
共4 条记录, 每页显示 10 条, 页签: [1]


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