Rss & SiteMap

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

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

标题:连续三根长下影K如何写?

1楼
cc20388 发表于:2018/5/30 10:33:31

请问老师:能否发建立一组代码,其内容是连续三根长下影K线和连续三根长上影K线,如可以,请求提供,谢谢!!!

 

2楼
FireScript 发表于:2018/5/30 11:26:13
 count(h>c and h>o,3)  上影线

count(l<c and l<o and l<h,3)  下影线


主要是利用count 函数以及上下影线的定义即可。
3楼
cc20388 发表于:2018/5/30 11:41:11
FireScript老师,谢谢您的解答。我的意思是连续三根长下影K线,构成开多条件,连续三根长上影K线,构成开空条件,能否设计成这样的代码?
4楼
FireScript 发表于:2018/5/30 13:15:59


buycond:count(h>c and h>o,3)=3;
sellcond:count(l<c and l<o and l<h,3)=3;

if buycond then
begin
sellshort(holding<0,holding,market);
buy(holding=0,1,market);
end

if sellcond then
begin
sell(holding>0,holding,market);
buyshort(holding=0,1,market);
end

图表虚拟持仓不能同时持有多空,因此开多前平空 开空前平多。
5楼
cc20388 发表于:2018/5/30 15:17:48
谢谢老师!
共5 条记录, 每页显示 10 条, 页签: [1]


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