您现在的位置:程序化交易>> 期货公式>> 金字塔等>> 金字塔模型>>正文内容

金字塔超简单海龟代码,供入门者学习[金字塔模型]

//超简单海龟代码,供入门者学习,

h10:ref(hhv(h,10),1),colorgreen;//前10根K线高点
l10:ref(llv(l,10),1),colorgreen;//前10根K线低点
h20:ref(hhv(h,20),1),colorred;//前20根K线高点
l20:ref(llv(l,20),1),colorred;//前20根K线低点。
 
long:=cross(c,h20);//价格上穿前20根线高点,做多条件
longend:=cross(l10,c);//价格跌破前10根K线低点,做多终止条件
 
short:=cross(l20,c);//价格跌破前20根K线低点,做空条件
shortend:=cross(c,h10);//价格上穿前10根K线高点,做空终止条件
if holding=0 then begin//建仓代码 来源 www.cxh99.com
buy(long,1,thisclose);
buyshort(short,1,thisclose);
end
 
if holding<>0 then begin//平仓代码
sell(longend,1,thisclose);
sellshort(shortend,1,thisclose);
end

 

 

有思路,想编写各种指标公式,程序化交易模型,选股公式,预警公式的朋友

可联系技术人员 QQ: 511411198  有需要帮忙请点击这里留言!!!进行 有偿 编写!不贵!点击查看价格!

 


【字体: 】【打印文章】【查看评论

相关文章

    没有相关内容