找回密码
 注册
搜索
查看: 401|回复: 5

[原创] Trade Gold Via Regression Divergence

[复制链接]
发表于 2009-8-13 09:44 PM | 显示全部楼层 |阅读模式


贡献一个indicator, tradestation里自己写的,看了intermarket analysis受的启发, 中间的是gold and silver regression divergence, 最下面是it的normalized后的.
data1 = @GC, data2 = @SI,  chgLength = 15, corrLength = 300;

chg1 = 100*percentchange(close of data1, chgLength);
chg2 = 100*percentchange(close of data2, chgLength);

correl = correlation(chg1, chg2, corrLength);
sd1 = standarddev(chg1, corrLength, 2);
sd2 = standarddev(chg2, corrLength, 2);

predict = (correl*sd1/sd2)*chg2;
diver = predict - chg1;
plot1(xaverage(diver,3), "Regression");

buy when normalized indicator rise above 80 and turning down, sell when it goes down below 20 and turning up.
很简单,效果不错。 可以不用silver, 用xau, 或者dxy(negative correlation).
Gold Regression.jpg
发表于 2009-8-13 09:52 PM | 显示全部楼层
good, thanks!
回复 鲜花 鸡蛋

使用道具 举报

发表于 2009-8-13 10:02 PM | 显示全部楼层
回复 鲜花 鸡蛋

使用道具 举报

发表于 2009-8-13 10:27 PM | 显示全部楼层
Ding! Could you please predict current indicator for gold? thanks
回复 鲜花 鸡蛋

使用道具 举报

发表于 2009-8-14 03:49 AM | 显示全部楼层
nice! thanks!

but i feel the period is too short from buy to sell if my understanding is right. it would look better if you can mark enter/exit points on the chart.
回复 鲜花 鸡蛋

使用道具 举报

 楼主| 发表于 2009-8-14 01:41 PM | 显示全部楼层
let me try write it as a strategy this weekend.
回复 鲜花 鸡蛋

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

手机版|小黑屋|www.hutong9.net

GMT-5, 2025-3-6 08:33 PM , Processed in 0.054485 second(s), 18 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表