Rss & SiteMap

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

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

标题:[求助]只加一次仓

1楼
宁静致远1 发表于:2016/12/7 14:27:47
老师这是开平仓条件,在持仓的情况下,再次符合开仓条件加仓,而且只加一次仓,加仓手数为M,该怎么表达?
if  DEA>0   and macd>0 and macd>ref(macd,1)  and abb  then buy(holding=0,ss,marketr);
if   macd<0  and abb  and holding>0 then sell(1,0,marketr);
if  DEA<0   and macd<0 and macd<ref(macd,1)  and abb  then buyshort(holding=0,ss,marketr);
if  macd>0  and abb  and holding<0 then sellshort(1,0,marketr);
2楼
jinzhe 发表于:2016/12/7 14:32:24
if  DEA>0   and macd>0 and macd>ref(macd,1)  and abb  then buy(holding<=ss,ss,marketr);
if   macd<0  and abb  and holding>0 then sell(1,0,marketr);
if  DEA<0   and macd<0 and macd<ref(macd,1)  and abb  then buyshort(holding<=abs(ss),ss,marketr);
if  macd>0  and abb  and holding<0 then sellshort(1,0,marketr);

3楼
宁静致远1 发表于:2016/12/7 15:23:49
再麻烦一下老师,这是开平仓条件,在开仓走完第5根K线依然盈利的情况下,则加仓M手,而且只加一次仓,该怎么表达?
if  DEA>0   and macd>0 and macd>ref(macd,1)  and abb  then buy(holding=0,ss,marketr);
if   macd<0  and abb  and holding>0 then sell(1,0,marketr);
if  DEA<0   and macd<0 and macd<ref(macd,1)  and abb  then buyshort(holding=0,ss,marketr);
if  macd>0  and abb  and holding<0 then sellshort(1,0,marketr);
4楼
jinzhe 发表于:2016/12/7 15:29:27
if  DEA>0   and macd>0 and macd>ref(macd,1)  and abb  then buy(holding=0,ss,marketr);
if  DEA>0   and macd>0 and macd>ref(macd,1)  and abb and holding=ss and openprofit>0 and enterbars=5  then buy(holding=ss,ss,marketr);
if   macd<0  and abb  and holding>0 then sell(1,0,marketr);
if  DEA<0   and macd<0 and macd<ref(macd,1)  and abb  then buyshort(holding=0,ss,marketr);
if  DEA<0   and macd<0 and macd<ref(macd,1)  and abb and holding=-ss and openrpfit>0 and enterbars=5  then buyshort(holding=-ss,ss,marketr);
if  macd>0  and abb  and holding<0 then sellshort(1,0,marketr);

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


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