Rss & SiteMap

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

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

标题:[求助]以当前K线最低或者最高值与均线距离作为进场条件,该怎么写

1楼
一叶知秋 发表于:2014/4/8 16:59:48

[求助]以当前K线最低或者最高值与均线距离作为进场条件或离场条件,该怎么写

比如在20均线上方 最低价大于均线,距离均线10个点,开仓做多,最低价跌破均线止损

     在20均线下方 最高价小于均线,距离均线10个点,开仓做空,最高价上破均线止损

对代码不熟悉,最好能详细些

2楼
jinzhe 发表于:2014/4/8 17:16:54

ma20:ma(c,20);

duo:l>ma20 and l-ma20>=10*mindiff;

kong:h<ma20 and ma20-h>=10*mindiff;

if duo then buy(holding=0,1,market);

if kong then buyshort(holding=0,1,market);

if cross(ma20,l) and holding>0 then sell(1,0,market);

if cross(h,ma20)  and holding<0 then sellshort(1,0,market);

 

 

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


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