Rank: Newbie
Groups: Registered, Registered Users Joined: 3/5/2009(UTC) Posts: 2
|
Hi, I am trying to find the high value of a low occurred within the last 5 periods
{ LowPeriod will contain how many periods ago the low occurred } LowPeriod := llvbars(C,5);
{ CurHigh should contain the High value of the bar that presented the Lowest value} CurHigh := ref(H, LowPeriod);
This should work, but I am given an error message that the ref() function can accept the Period value just as a constant, not as a variable. How can I solve this in a different way?
Thanks in advance Renato
|
|
|
|
Rank: Advanced Member
Groups: Registered, Registered Users Joined: 9/26/2005(UTC) Posts: 185 Location: Brazil
|
Hi,
You can solve your problem by using the variable REF function found in the forum DLL
CurHigh:= ExtFml( "Forum.Ref", H, LowPeriod);
You can freely download the latest version from the download section:
http://forum.equis.com/f...ng_files/entry19695.aspx
Best regards, Bulli
|
|
|
|
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)
|
I think you might find the ValueWhen() function will work faster than the external function call:
{ LowPeriod will contain how many periods ago the low occurred } LowPeriod := llvbars(C,5);
{ CurHigh should contain the High value of the bar that presented the Lowest value} CurHigh := ValueWhen(1, LowPeriod=0, H);
Hope this helps.
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.