以文本方式查看主题

-  金字塔客服中心 - 专业程序化交易软件提供商  (http://weistock.com/bbs/index.asp)
--  金字塔软件问题提交  (http://weistock.com/bbs/list.asp?boardid=2)
----  [分享]日内趋势线的划法  (http://weistock.com/bbs/dispbbs.asp?boardid=2&id=48833)

--  作者:qwe123
--  发布时间:2013/2/24 16:15:39
--  [分享]日内趋势线的划法
//交易控制变量
variable:a1=0;
variable:a2=0;
variable:c1=0;

n1:=0.8;
n2:=2;

//*******************************
r1:=barslast(date<>ref(date,1)),linethick0;
r2:=ref(o,r1);
partline(r1>0,r2);

//*******************************
if barpos=1 then a2:=c;
if r1=0 and c>=o then
begin
a1:=barpos;
a2:=l-n2;
c1:=1;
end

if r1=0 and c<o then
begin
a1:=barpos;
a2:=h+n2;
c1:=-1;
end
r10:if(c1>0,a2+n1*(barpos-a1),a2-n1*(barpos-a1));

//----------------------------
if c1>0 and c<r10 then
begin
a1:=barpos;
a2:=h+n2;
c1:=-1;
end
if c1<0 and c>r10 then
begin
a1:=barpos;
a2:=l-n2;
c1:=1;
end

这个小程序是用来在日内划趋势线的;
1.如果把r10改为r10:if(c1>0,a2+n1*(barpos-a1)*(barpos-a1),a2-n1*(barpos-a1)*(barpos-a1));就变成抛物线了,注意n1的调整;
2.可根据k线的变化把n1做成动态的(对直线而言n1就是斜率);
3.可根据趋势线r10,画出通道线;
4.可根据趋势线可以做出很多的交易策略,大家各显神通吧,如果效果好把测试报告贴出来欣赏一下。


[此贴子已经被作者于2013-2-24 16:16:11编辑过]

--  作者:qwe123
--  发布时间:2013/2/24 16:21:28
--  

--  作者:qwe123
--  发布时间:2013/2/24 16:22:14
--  

图片点击可在新窗口打开查看此主题相关图片如下:qq截图20130224162004.png
图片点击可在新窗口打开查看
直线趋势线图
[此贴子已经被作者于2013-2-24 16:22:40编辑过]