Rss & SiteMap

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

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

标题:[原创]对应平仓示例

1楼
xian_0_9 发表于:2011/9/13 11:19:01

以前在论坛求教了一个问题没有解决,现在自己解决了。发出来。

 

开仓条件为A对应平仓条件A1。开仓条件为B的话对应平仓条件为B1。

 

 

VARIABLE:aa=0;
VARIABLE:bb=0;
if holding=0 then aa:=0;
if holding=0 then bb:=0;

h20:ref(hhv(h,20),1);
l20:ref(llv(l,20),1);
ma2:ma(c,30);

A:=cross(c,h20);
A1:=cross(l20,c);
B:=cross(c,ma2);
B1:=cross(ma2,c);

if aa=1 and holding>0 and A1  then sell(1,holding,limitr,c);
if bb=1 and holding>0 and B1  then sell(1,holding,limitr,c);

if A and holding=0 then
begin
buy(1,1,limitr,c);
IF  A and  holding>0 THEN aa:=1;

end
if B and holding=0 then
begin
buy(1,1,limitr,c);
IF  B and  holding>0 THEN bb:=1;

end

2楼
msy0985 发表于:2011/9/13 20:47:15

不错奥

3楼
shy508 发表于:2011/9/13 22:08:40
顶!好啊!太有用了,学习了!
共3 条记录, 每页显示 10 条, 页签: [1]


Powered By Dvbbs Version 8.3.0
Processed in 0.01001 s, 2 queries.