Rss & SiteMap

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

专业程序化软件提供商
共94 条记录, 每页显示 10 条, 页签: [1] [2][3][4][5][6][7][8] ...[10]
[浏览完整版]

标题:程序代码编写

1楼
shisudaoren 发表于:2016/8/16 10:36:46
当出现连续两根上涨阳线时,且两根阳线中某一根阳线的收盘价减去开盘价大于参数A,且两根阳线的上影线B(B为参数)小于参数A,且两根K线的成交量大于参数C,则在第三根K线开盘时开多单,止损设置在两根K线的最低价,止盈设置为开仓价加某参数D。

请版主帮忙写一下,有什么不足之处请版主指出。谢谢。
2楼
jinzhe 发表于:2016/8/16 10:43:55

a:=5;
b:=10;
cc:=15;
d:=15;
if ref(all(c>o,2) and c>ref(c,1) and any(c-o,2)>a  and all(h-c<b,2) and all(vol>cc,2),1) then buy(holding=0,1,market);
if L<ref(ref(llv(l,2),1),enterbars) then sell(1,0,market);
if c>enterprice+d then sell(1,0,market);

3楼
shisudaoren 发表于:2016/8/16 10:59:00
请楼主在代码旁边注释一下,本人比较愚笨,最好用的话注释一下,非常感谢版主。
4楼
jinzhe 发表于:2016/8/16 11:11:41

当出现连续两根上涨阳线时,且两根阳线中某一根阳线的收盘价减去开盘价大于参数A,且两根阳线的上影线B(B为参数)小于参数A,且两根K线的成交量大于参数C,则在第三根K线开盘时开多单,

ref(all(c>o,2) and c>ref(c,1) and any(c-o,2)>a  and all(h-c<b,2) and all(vol>cc,2),1)

 

all(c>o,2) 连续两根阳线 c>ref(c,1)上涨了 any(c-o,2)>a某一根阳线的收盘价减去开盘价大于参数A  all(h-c<b,2)这里不能什么参数b和参数a,上影线是能算出来的,所以当作上影线小于参数b了  all(vol>cc,2)且两根K线的成交量大于参数C 

最外面的ref(,1)用来实现满足前面的条件后在第三根k线开仓

[此贴子已经被作者于2016-8-16 11:12:03编辑过]
5楼
shisudaoren 发表于:2016/8/16 11:17:09
a:=5;
b:=10;
cc:=15;
d:=15;
这些是你已经假设的参数是吗?
6楼
jinzhe 发表于:2016/8/16 11:19:33
是的,不然编译不过
7楼
shisudaoren 发表于:2016/8/16 11:32:03
当出现连续两根下跌阴线线时,且两根阴线中某一根阴线的开盘价减去收盘价大于参数A,且两根阳线的下影线小于参数A,且两根K线的成交量大于参数C,则在第三根K线开盘时开空单,止损设置在两根K线的最最高价,止盈设置为开仓价加某参数D。
以上是出现阴线的情况,可以把这两种程序一起写出来吗?请版主把这两种程序一起写出来,然后加上注解。非常感谢版主。

8楼
jinzhe 发表于:2016/8/16 12:55:41
按照上面的代码请用户自行翻转
9楼
shisudaoren 发表于:2016/8/16 14:08:48

a:=5;
b:=10;
cc:=15;
d:=15;
if ref(all(c>o,2) and c>ref(c,1) and any(c-o,2)>a  and all(h-c<b,2) and all(vol>cc,2),1) then buy(holding=0,1,market);
if L<ref(ref(llv(l,2),1),enterbars) then sell(1,0,market);
if c>enterprice+d then sell(1,0,market);

f ref(all(c<o,2) and c<ref(c,1) and any(o-c,2)>a  and all(c-l<b,2) and all(vol>cc,2),1) then sell(holding=0,1,market);
if h>ref(ref(llv(h,2),1),enterbars) then buy(1,0,market);
if c<enterprice+d then buy(1,0,market);

请版主检查一下是否有错误,谢谢。


10楼
jinzhe 发表于:2016/8/16 14:32:04
 if ref(all(c<o,2) and c<ref(c,1) and any(o-c,2)>a  and all(c-l<b,2) and all(vol>cc,2),1) then buyshort(holding=0,1,market);
if h>ref(ref(hhv(h,2),1),enterbars) then sellshort(1,0,market);
if c>enterprice+d then short(1,0,market);
共94 条记录, 每页显示 10 条, 页签: [1] [2][3][4][5][6][7][8] ...[10]


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