logo
Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Options
Go to last post Go to first unread
gusi  
#1 Posted : Saturday, April 14, 2007 5:02:40 PM(UTC)
gusi

Rank: Newbie

Groups: Registered, Registered Users
Joined: 4/14/2007(UTC)
Posts: 3

Hello, like I can make an exploration that me of the average of the closings for years.
I want to make an exploration that does the following thing:

1) x= log (close/close of the previous day) in %. ( this is easy ).
2) y=average Arithmetics of x for years.
3) in the exploration in the column A to the values of y for year 2002.
in the exploration in the column B to the values of y for year 2003.
in the exploration in the column C to the values of y for year 2004.
in the exploration in the column D to the values of y for year 2005.
in the exploration in the column E to the values of y for year 2006.
in the exploration in the column F to the values of y for year 2007.

thanks,
sorry for my English, it is not my native language .

wabbit  
#2 Posted : Saturday, April 14, 2007 7:43:23 PM(UTC)
wabbit

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers, Unverified Users
Joined: 10/28/2004(UTC)
Posts: 3,111
Location: Perth, Western Australia

Was thanked: 16 time(s) in 16 post(s)
Gusi,

Welcome to the Forum. Hopefully yuo will find the information here useful and the people friendly.

Try this code for your problem:

Code:

{Column A 2002}
yyyy:=2002;

x:= log(close/Ref(close,-1));
cumx:=Cum((Year()=yyyy)*x);
counter:=Cum(Year()=yyyy);
y:=cumx/counter;


{Column B 2003}

yyyy:=2003;


x:= log(close/Ref(close,-1));

cumx:=Cum((Year()=yyyy)*x);

counter:=Cum(Year()=yyyy);

y:=cumx/counter;



etc



Hope this helps.

wabbit [:D]

gusi  
#3 Posted : Sunday, April 15, 2007 6:35:07 AM(UTC)
gusi

Rank: Newbie

Groups: Registered, Registered Users
Joined: 4/14/2007(UTC)
Posts: 3

thanks, thanks
gusi  
#4 Posted : Sunday, April 15, 2007 6:42:54 AM(UTC)
gusi

Rank: Newbie

Groups: Registered, Registered Users
Joined: 4/14/2007(UTC)
Posts: 3

Hello wabbit,

the results in the columns is N/A ?

sorry

wabbit  
#5 Posted : Sunday, April 15, 2007 6:54:43 AM(UTC)
wabbit

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers, Unverified Users
Joined: 10/28/2004(UTC)
Posts: 3,111
Location: Perth, Western Australia

Was thanked: 16 time(s) in 16 post(s)
This sounds like another "load minimum data" problem....

Please UNCHECK load minimum data and load at least 5 years of data (or however far back you are looking). There are about 255 trading days per year, so 5 years of data is about 1275 bars, but just load 5000 bars instead.

Let me know if this solves the problem.


wabbit [:D]


wabbit  
#6 Posted : Sunday, April 15, 2007 6:57:06 AM(UTC)
wabbit

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers, Unverified Users
Joined: 10/28/2004(UTC)
Posts: 3,111
Location: Perth, Western Australia

Was thanked: 16 time(s) in 16 post(s)
...and I just noticed we didnt assign any values to the column!

try this:

Code:

{Column A 2002}
yyyy:=2002;

x:= log(close/Ref(close,-1));
cumx:=Cum((Year()=yyyy)*x);
counter:=Cum(Year()=yyyy);
y:=cumx/counter;
{plot/return}
y

{Column B 2003}

yyyy:=2003;


x:= log(close/Ref(close,-1));

cumx:=Cum((Year()=yyyy)*x);

counter:=Cum(Year()=yyyy);

y:=cumx/counter;

{plot/return}

y




etc



wabbit [:D]


Jose  
#7 Posted : Sunday, April 15, 2007 11:55:07 AM(UTC)
Jose

Rank: Advanced Member

Groups: Registered, Registered Users
Joined: 1/19/2005(UTC)
Posts: 1,065
Location: Koh Pha-Ngan, Earth

Was thanked: 2 time(s) in 2 post(s)
Wabbit, you may need to add some division-by-zero error traps at the last counter division code lines. jose '-)
wabbit  
#8 Posted : Sunday, April 15, 2007 6:51:30 PM(UTC)
wabbit

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers, Unverified Users
Joined: 10/28/2004(UTC)
Posts: 3,111
Location: Perth, Western Australia

Was thanked: 16 time(s) in 16 post(s)
If I hadn't just finished a very nice bottle of red last night, the OP might have got some error trapping routines. Cest la vie. Executed through the explorer there are no DB0 errors, only if it plotted as an indicator.

wabbit [:D]


Users browsing this topic
Guest (Hidden)
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.