PureBytes Links
Trading Reference Links
|
The code you show looks like a calculation for a weighted 1 bar ROC. I did
not gather that was what you were looking for in your original post.
Jerry
-----Original Message-----
From: c [mailto:camacazi@xxxxxxxxxxx]
Sent: Sunday, March 28, 2004 10:05 PM
To: Gary Fritz; omega-list@xxxxxxxxxx
Subject: RE: From Spread's to indexes
Thanks Gary
Heres basically what i have done for now.....
d1percent=((close[1] of data1 - close of data1) / close of data1 )* 40/100;
d2percent=((close[1] of data2 - close of data2) / close of data2 )* 30/100;
d3percent=((close[1] of data3 - close of data3) / close of data3 )* 30/100;
and then
myindex=myindex+d1percent+d2percent+d3percent;
Works a treat.... any other ideas for improvement just let me know :O)
Cheers
Cameron
-----Original Message-----
From: Gary Fritz [mailto:fritz@xxxxxxxx]
Sent: Sunday, March 28, 2004 1:58 PM
To: omega-list@xxxxxxxxxx
Subject: Re: From Spread's to indexes
> i want to create my own index.... and i want to weight the individual
> components eg
> heating oil at ummmmmmmm say 40%
> crude oil at 30%
DAX at 30%
Set up HO in Data1, CL in Data2, DAX in Data3.
Now you could simply combine them by plotting (however you like):
0.40*Close of Data1 + 0.30*Close of Data2 + 0.30*Close of Data3
But that doesn't take their widely varying prices into account,
so e.g. CL (at about $35) will have almost 40x larger impact than
HO (at about $0.90). So you might want to scale them somehow,
maybe something like:
{ Get recent average value }
HO = Close of Data1;
CL = Close of Data2;
DAX = Close of Data3;
HOavg = average(HO, 100);
CLavg = average(CL, 100);
DAXavg = average(DAX, 100);
Index = 0.40*(HO/HOavg) + 0.30*(CL/CLavg) + 0.40*(DAX/DAXavg);
...or whatever calculation suits your fancy.
Gary
---
---
|