Rss & SiteMap

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

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

标题:布林线策略结合macd编写问题

1楼
beckham6666 发表于:2014/5/13 11:24:23
老师,请教一下:
1、当价格上涨,diff走低,且价格在布林线上轨,做空。当价格在3根k线以上跌至中轨,平仓。当价格在3根k线以内跌至中轨,持有到跌破布林线下轨,平仓。
2、当价格下跌,diff走高,且价格在布林线下轨,做多。当价格在3根k线以上涨至中轨,平仓。当价格在3根k线以内涨至中轨,持有到涨至布林线上轨,平仓。

新手上路,请多多指教  谢谢
2楼
jinzhe 发表于:2014/5/13 13:24:56

当价格在3根k线以上跌至中轨

解释一下这个是一种什么样的状态

3楼
beckham6666 发表于:2014/5/13 13:53:10
就是比较缓慢的跌倒中轨位置,不是急跌。我定义了3根k线的时间。
4楼
jinzhe 发表于:2014/5/13 14:19:37
开仓后3根k线之内跌倒中规的位置吗?
5楼
beckham6666 发表于:2014/5/13 15:16:54
是开仓后,3根K线以外跌至中轨,平仓    3根k线以内跌至中轨,继续持有,跌至下轨后,平仓。
6楼
jinzhe 发表于:2014/5/13 15:45:17

m:=26;
n:=2;
s1:=12;
p1:=26;
m1:=9;
MID :  MA(CLOSE,M);
UPPER: MID + N*STD(CLOSE,M);
LOWER: MID - N*STD(CLOSE,M);//这个是系统自带的boll指标

DIFF : EMA(CLOSE,S1) - EMA(CLOSE,P1);
DEA  : EMA(DIFF,M1);
MACD1 : 2*(DIFF-DEA);//这个是系统自带的macd指标

shoushu:=1;//下单手数

if h>ref(h,1) and diff<ref(diff,1) and l<upper and h>upper then buyshort(holding=0,shoushu,market);
if enterbars>3 and l<mid and h>mid then sellshort(1,shoushu,market);
if enterbars>3 and l<lower and h>lower and ref(count(l<mid and h>mid,3),1) then sellshort(1,shoushu,market);

if h>ref(h,1) and diff>ref(diff,1) and l<lower and h>lower then buy(holding=0,shoushu,market);
if enterbars>3 and l<mid and h>mid then sell(1,shoushu,market);
if enterbars>3 and l<lower and h>lower and ref(count(l<mid and h>mid,3),1) then sell(1,shoushu,market);

7楼
beckham6666 发表于:2014/5/14 15:58:35
老师,我有点不太明白 ref(count(l<mid and h>mid,3),1) 这个语句的含义 
8楼
jinzhe 发表于:2014/5/14 16:04:22

少些了一点

count(l<mid and h>mid,3)>=1

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


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