Rss & SiteMap

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

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

标题:分组指令问题

1楼
muxia5568 发表于:2016/5/6 14:42:20

请教老师;一个开仓指令是否可以对应多个平仓指令?

比如a为开仓,b,c,d都要平a,是否可以?

 

variable:n=0,m=0;

if a and holding=0 and n=0 then begin

    sell.......;

    n:=1;

end

if b and holdig=0 and n=1 then begin

    buy......;

    n:=0;

end

if c and holding>0 and n=1 then begin

   sell.......;

   n:=0;

end

if d and holding>0 and n=1 then begin

   sell.......;

   n:=0;

end
谢谢

2楼
jinzhe 发表于:2016/5/6 14:43:11

可以

这段代码要表达什么意思?

3楼
muxia5568 发表于:2016/5/6 15:33:41
前面的编写错了,这样编写对吗?请老师指点。 比如a为开仓,b,c,d都要平a, variable:n=0,m=0; if a and holding=0 and n=0 then begin sell.......; n:=1; end if b and holdig=0 and n=1 then begin sell.......; n:=0; end if c and holding>0 and n=1 then begin sell.......; n:=0; end if d and holding>0 and n=1 then begin sell.......; n:=0; end
4楼
jinzhe 发表于:2016/5/6 15:44:00
这代码你怎么写了4个平的
5楼
muxia5568 发表于:2016/5/6 16:24:20
马虎了,谢谢!

再请教老师编写问题;

从最新价大于布林线上轨起至前根K线,ma5始终大于ma15,当根K线MA5下穿ma15,

 老师的解答;

‘’先把系统自带的boll代码抄过来,然后写下面的代码:

nn:=barslast(c>upper);

ref(all(ma5>ma15,nn+1),1) and cross(ma15,ma5)’’

 

对应的这句这样写对吗?

 

 

从最新价小于布林线下轨起至前根K线,ma5始终小于ma15,当根K线MA5上穿ma15,

hh:=barslast(c<lower);
ref(all(ma5<ma15,hh+1),1) and cross(ma5,ma15)

 

谢谢

6楼
jinzhe 发表于:2016/5/6 16:28:49
对,写得很好
共6 条记录, 每页显示 10 条, 页签: [1]


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