Rss & SiteMap

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

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

标题:请帮写个加仓模型

1楼
qaz88 发表于:2015/4/29 10:34:56
老师好!请帮写个加仓模型.做罗纹钢.要求如下:
MACD指标金叉开多.死叉开空.周期一分钟.金叉开多买入1手.设置止盈20个点.止损10.如止损平仓.下次开空2手设止盈20止损10.一直等有盈利20点平仓出局.下次又重开仓1手.(毎次止损平仓加倍反向买入)(每次止盈出局又重新按MACD金叉及死叉开多空仓1手)
2楼
jinzhe 发表于:2015/4/29 10:43:39
处理中请稍等
3楼
pyd 发表于:2015/4/29 10:51:39
macd里谁和谁的金叉死叉?
4楼
qaz88 发表于:2015/4/29 10:57:13

MACD指标做罗纹模型当指标金叉开多.死叉开空.周期一分钟.金叉开多买入1手.设置止盈20个点.止损10.如止损平仓.下次开空2手设止盈20止损10.一直等有盈利20点平仓出局.下次又重开仓1手.(毎次止损平仓加倍反向买入)(每次止盈出局又重新按MACD金叉及死叉开多空仓1手)
5楼
pyd 发表于:2015/4/29 11:10:24
macd里diff和dea的金叉死叉吗?
6楼
qaz88 发表于:2015/4/29 11:16:35
对的
7楼
pyd 发表于:2015/4/29 11:40:29

VARIABLE:n=0,m=0,ks=1,ds=1;
p:=26;
s:=12;
m:=9;
DIFF : EMA(CLOSE,S) - EMA(CLOSE,P);
DEA  : EMA(DIFF,M);
MACD1 : 2*(DIFF-DEA),COLORSTICK;
jc:cross(diff,dea);
sc:cross(dea,diff);

if jc and holding=0 then begin
buy(1,ds,market);
end
if h-enterprice>=20  and enterbars>0 then begin
sell(holding>0,holding,market);//多盈
n:=0;
end
if n=0 then ks:=1;
if enterprice-l>=10  and enterbars>0 then begin //多损
sell(holding>0,holding,market);
n:=1;
end
if n=1 then ks:=2;
if sc  then begin
buyshort(holding=0,ks,market);
end


if enterprice-l>=20 and enterbars>0 then begin
sellshort(holding<0,holding,market);//空赢
m:=0;
end
if m=0 then ds:=1;
if h-enterprice>=10 and enterbars>0 then begin
sellshort(holding<0,holding,market);//空损
m:=1;
end
if m=1 then ds:=2;

[此贴子已经被作者于2015/4/29 13:03:01编辑过]
8楼
qaz88 发表于:2015/4/29 12:17:25
老师在编写吗??
9楼
pyd 发表于:2015/4/29 13:03:32

VARIABLE:n=0,m=0,ks=1,ds=1;
p:=26;
s:=12;
m:=9;
DIFF : EMA(CLOSE,S) - EMA(CLOSE,P);
DEA  : EMA(DIFF,M);
MACD1 : 2*(DIFF-DEA),COLORSTICK;
jc:cross(diff,dea);
sc:cross(dea,diff);

if jc and holding=0 then begin
buy(1,ds,market);
end
if h-enterprice>=20  and enterbars>0 then begin
sell(holding>0,holding,market);//多盈
n:=0;
end
if n=0 then ks:=1;
if enterprice-l>=10  and enterbars>0 then begin //多损
sell(holding>0,holding,market);
n:=1;
end
if n=1 then ks:=2;
if sc  then begin
buyshort(holding=0,ks,market);
end


if enterprice-l>=20 and enterbars>0 then begin
sellshort(holding<0,holding,market);//空赢
m:=0;
end
if m=0 then ds:=1;
if h-enterprice>=10 and enterbars>0 then begin
sellshort(holding<0,holding,market);//空损
m:=1;
end
if m=1 then ds:=2;

 

10楼
qaz88 发表于:2015/4/29 14:29:21
老师在编写吗??
共13 条记录, 每页显示 10 条, 页签: [1] [2]


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