Rss & SiteMap

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

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

标题:一个布林通道,改成后台

1楼
么么 发表于:2015/12/10 14:31:41
 

variable:hh=0,ll=0;

MID : MA(CLOSE,26);
UPPER:MID + 2*STD(CLOSE,26);
LOWER:MID - 2*STD(CLOSE,26);

//平空开多--价格下穿上轨

if cross(UPPER,c) then
begin
sellshort(holding<0,1,market);
if holding=0 then
begin
buy(1,1,market);
ll:=low;
end
end

//价格超过开多这根K线的最低点时止损平多
if holding>0 and enterbars>1 then sell(c<ll,1,market);

//止盈条件是当价格上穿上轨时止盈平仓

scs:=cross(c,upper);

if holding>0 and enterbars>1 then sell(scs,1,market);

//平多开空--价格上穿上轨时

if cross(c,UPPER) then
begin
sell(holding>0,1,market);
if holding=0 then
begin
buyshort(1,1,market);
hh:=high;
end
end

//价格超过开空这根K线的最高点时止损平空
if holding<0 and enterbars>1 then sellshort(c>hh,1,market);

//止盈条件是当价格上穿下轨时止盈平仓。

scx:=cross(c,lower);

if holding<0 and enterbars>1 then sellshort(scx,1,market);


2楼
jinzhe 发表于:2015/12/10 14:37:36

globalvariable:hh=0,ll=0;

MID : MA(CLOSE,26);
UPPER:MID + 2*STD(CLOSE,26);
LOWER:MID - 2*STD(CLOSE,26);

//平空开多--价格下穿上轨

if cross(UPPER,c) then
begin
tsellshort(tholding<0,1,mkt);
if tholding=0 then
begin
tbuy(1,1,mkt);
ll:=low;
end
end

//价格超过开多这根K线的最低点时止损平多
if tholding>0 and tenterbars>1 then tsell(c<ll,1,mkt);

//止盈条件是当价格上穿上轨时止盈平仓

scs:=cross(c,upper);

if tholding>0 and tenterbars>1 then tsell(scs,1,mkt);

//平多开空--价格上穿上轨时

if cross(c,UPPER) then
begin
tsell(tholding>0,1,mkt);
if tholding=0 then
begin
tbuyshort(1,1,mkt);
hh:=high;
end
end

//价格超过开空这根K线的最高点时止损平空
if tholding<0 and tenterbars>1 then tsellshort(c>hh,1,mkt);

//止盈条件是当价格上穿下轨时止盈平仓。

scx:=cross(c,lower);

if tholding<0 and tenterbars>1 then tsellshort(scx,1,mkt);

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


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