以文本方式查看主题

-  金字塔客服中心 - 专业程序化交易软件提供商  (http://weistock.com/bbs/index.asp)
--  公式模型编写问题提交  (http://weistock.com/bbs/list.asp?boardid=4)
----  [求助]黄金分割率 交易公式编写  (http://weistock.com/bbs/dispbbs.asp?boardid=4&id=154752)

--  作者:cewuya
--  发布时间:2017/6/5 15:45:41
--  [求助]黄金分割率 交易公式编写
金叉ma5穿ma10,买入, 以买入点前最低点,到目前高点的黄金分割0.618下破,卖出
--  作者:pyd
--  发布时间:2017/6/5 16:27:17
--  
以买入点前最低点是指买入那个k线的最低价?
--  作者:cewuya
--  发布时间:2017/6/5 16:47:57
--  
以,买入点之前一个波段的近期低点


--  作者:pyd
--  发布时间:2017/6/5 17:34:21
--  

波段怎么定义?


--  作者:cewuya
--  发布时间:2017/6/9 12:44:14
--  
10个周期内的最低和最高点,做黄金分割,可以吗?这两个点的0.618止损50%,跌破0.5,全部止损。
谢谢

--  作者:pyd
--  发布时间:2017/6/9 13:08:36
--  
ma5:ma(c,5);
ma10:ma(c,10);
jc:cross(ma5,ma10);
buy(jc and holding=0,手数,marketr);
ll:=ref(llv(l,10),enterbars+1);
hh:=hhv(h,enterbars+1);
if c<=hh-(1-0.68)*(hh-ll) and holding>0 then sell(1,50%,marketr);
if c<=hh-0.5*(hh-ll) and holding>0 then sell(1,holding,marketr)

--  作者:cewuya
--  发布时间:2017/6/13 13:55:46
--  
谢谢
--  作者:cewuya
--  发布时间:2017/6/15 8:53:57
--  
你好,

ma5:ma(c,5);
ma10:ma(c,10);
jc:cross(ma5,ma10);
buy(jc and holding=0,手数,marketr);
ll:=ref(llv(l,10),enterbars+1);
hh:=hhv(h,enterbars+1);
if c<=hh-(1-0.68)*(hh-ll) and holding>0 then sell(1,50%,marketr);
if c<=hh-0.5*(hh-ll) and holding>0 then sell(1,holding,marketr)
这个公式里,怎么加上,10根k线后,突破高点加仓1次,并且1天只能加仓一次,
止损条件的时候,加上4根k线后再执行止损条件,谢谢老师


--  作者:pyd
--  发布时间:2017/6/15 8:56:53
--  

编写中,但是建议楼主学习下编写教程:http://www.weistock.com/bbs/dispbbs.asp?boardid=16&Id=55132

 


--  作者:pyd
--  发布时间:2017/6/15 9:07:39
--  

VARIABLE:n=0;
ss:=1;//手数
ma5:ma(c,5);
ma10:ma(c,10);
jc:cross(ma5,ma10);
buy(jc and holding=0,ss,marketr);
if n=0 and enterbars>=10 and h>ref(hhv(h,enterbars),1) and holding>0 then begin //加仓
buy(1,1,marketr);
n:=1;
end
ll:=ref(llv(l,10),enterbars+1);
hh:=hhv(h,enterbars+1);

if c<=hh-(1-0.68)*(hh-ll) and holding>0 and enterbars>=4 then sell(1,50%,marketr);
if c<=hh-0.5*(hh-ll) and holding>0  and enterbars>=4 then sell(1,holding,marketr);

if time=closetime(0) then n:=0;

[此贴子已经被作者于2017/6/15 9:07:48编辑过]