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 .
|
|
|
|
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]
|
|
|
|
Rank: Newbie
Groups: Registered, Registered Users Joined: 4/14/2007(UTC) Posts: 3
|
|
|
|
|
Rank: Newbie
Groups: Registered, Registered Users Joined: 4/14/2007(UTC) Posts: 3
|
Hello wabbit,
the results in the columns is N/A ?
sorry
|
|
|
|
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]
|
|
|
|
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]
|
|
|
|
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 '-)
|
|
|
|
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.