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

Notification

Icon
Error

Options
Go to last post Go to first unread
analyst1012  
#1 Posted : Thursday, July 22, 2010 12:50:18 AM(UTC)
analyst1012

Rank: Member

Groups: Registered, Registered Users, Subscribers
Joined: 12/3/2007(UTC)
Posts: 18
Location: Singapore

Hi I would like to generate a report using explorer on daily data that should contain the last close, change over day, month and year in the same report. I did this using the following formula. Col A: close Col B: ROC(CLOSE,1,percent) Col C: 100*(CLOSE - Fml("Lastmonthclose"))/Fml("Lastmonthclose") Lastmonthclose is a custom indicator with formula as follows d := HHV(If(Month()=LastValue(Month()-1),DayOfMonth(),0),50); month1 := Ref(Month(),-1); yr := Year(); ValueWhen(1,DayOfMonth()=d AND Month() = month1 AND Year() = yr, CLOSE) Col D: 100 * (CLOSE - Fml("Lastyearclose"))/Fml("Lastyearclose") Lastyearclose formula: d := HHV((If(Month()=12,DayOfMonth(),0)),500); m := 12; yr := Ref(Year(),-1); ValueWhen(1,DayOfMonth() = d AND Month() = m AND Year() = yr, CLOSE) I am new to formula language, which you would guessed seeing my formulas. I guess there should be a better way to obtain “previous month close” and “previous year close”. Assistance please! Also pls help me in adding columns that shall return, low in 2009 and low since 1980 on charts. many thanks for the help. rgds.
wabbit  
#2 Posted : Thursday, July 22, 2010 6:47:04 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)
If you're going back calendar months/years, I think the easiest solution is to find the first traded bar this month/year, then look at the previous bar (or the first bar of the chart if in the first charted month/year).

Something like:
Code:

{find close of previous month}
mm:=Month();

{first traded bar this month}
newMonth:=mm<>Ref(mm,-1);

{close of previous month}
ValueWhen(1,Cum(1)=2 OR newMonth,Ref(C,-1));



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.