Rss & SiteMap

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

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

标题:请教个策略编写问题

1楼
just1 发表于:2013/5/8 15:17:10
So.J  15:14:15
请教个策略编写问题
A,B两条均线 
在A上穿B后5个周期内 出现A下穿B时 开空 20个点止盈,5个点止损
在A下穿B后5个周期内 出现A上穿B时 开多 20个点止盈,5个点止损
2楼
jinzhe 发表于:2013/5/8 15:20:11
反过来思考,在a下穿b的时候,判断之前5个周期是否存在a上穿b,这个会写吗?
3楼
jj_king 发表于:2013/5/8 16:09:05
A:=cross(均线1,均线2);
B:=cross(均线2,均线1);
AA:=barslast(A);
BB:=barslast(B);
if A=1 and AA<5 then buy(1,1,market);
if B=1 and BB<5 then buyshort(1,1,market);

if holding>0 and enterprice-c>5*mindiff then sell(1,0,market);
if holding>0 and c-enterprice>20*mindiff then sell(1,0,market);
if holding<0 and enterprice-c>20*mindiff then sellshort(1,0,market);
if holding<0 and c-enterprice>5*mindiff then sellshort(1,0,market);
[此贴子已经被作者于2013-5-8 16:10:54编辑过]
4楼
jj_king 发表于:2013/5/8 16:11:56
请问这么写是错在哪里了?
5楼
jinzhe 发表于:2013/5/8 16:20:48

a=1 and bb<5

b=1 and aa<5

这样才是

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


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