Discussions
»
Special Interest Groups
»
Basic Coding Techniques
»
HiLo between dates with single date input not plotting correctly
Rank: Member
Groups: Registered, Registered Users Joined: 1/20/2007(UTC) Posts: 15
Was thanked: 1 time(s) in 1 post(s)
|
Hi Wabbit,
Need your help here. What's wrong with the following code? It's not plotting the high/low between the entered dates but plots the highest/lowest points on the chart.
-------------------------------------------------------------------------------------------------
{Date Inputs}
fmDate:=Input("Start yyyymmdd (0=last trade)",0,20201231,20060101); toDate:=Input("End yyyymmdd (0=last trade)",0,20201231,0);
{Period between dates} period:=ExtFml("Forum.DateRange", fmDate, toDate);
{High/Low}
hi:=Highest(ValueWhen(1,period,H));
lo:=Lowest(ValueWhen(1,period,L));
hi;lo
-------------------------------------------------------------------------------------------------
aksh
|
|
|
|
Rank: Advanced Member
Groups: Registered, Registered Users, Unverified Users Joined: 7/12/2007(UTC) Posts: 134 Location: Perth Western Australia
|
Hi aksh,
Wabbit is away until tomorrow at the earliest and will answer your question when he returns however this code should give you the results you are chasing.
perd1:=Input("Day",1,31,1); perd2:=Input("Month",1,12,1); perd3:=Input("Year",1900,2199,2006); perd4:= ValueWhen(1,(DayOfMonth()>=perd1 AND Month()=perd2 AND Year()=perd3),LastValue(Cum(1))-Cum(1)); perdHigh:=ExtFml("Forum.HHV",H,perd4); perdLow:=ExtFml("Forum.LLV",L,perd4); perdHigh; perdLow;
It is derived from code provided by *pp in post #24274 the link below.
Exploration to find out rising stock referencing a particular date
Cheers,
oz
|
|
|
|
Rank: Member
Groups: Registered, Registered Users Joined: 1/20/2007(UTC) Posts: 15
Was thanked: 1 time(s) in 1 post(s)
|
Thanks oz. I was actually trying to use Wabbit's single date input code for plotting Hi/Lo between any two intermediate dates entered by the user. It's not happening. I'm getting the highest/lowest points on the chart.
aksh
|
|
|
|
Users browsing this topic |
Guest (Hidden)
|
Discussions
»
Special Interest Groups
»
Basic Coding Techniques
»
HiLo between dates with single date input not plotting correctly
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.