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

Notification

Icon
Error

Options
Go to last post Go to first unread
pakki  
#1 Posted : Friday, July 19, 2013 5:27:00 AM(UTC)
pakki

Rank: Member

Groups: Registered, Registered Users
Joined: 8/19/2011(UTC)
Posts: 16

Hi,

I want to use a variable in ref()for my custom indicator, which i couldn't, hence i downloaded the
Forum DLL. Also here it seems that i cannot use the negative values.

My requirement is, i want to highlight the previous trough based on a condition on the latest trough.
I know i can use valuewhen()to get the previous trough's value, but i want to highlight the previous trough in its position. Trying to break this since a week's time.

Please helpme guys.

Thanks for your patient listening and would appreciate ur help in this regard

Pakki.
haddison  
#2 Posted : Friday, July 19, 2013 8:32:44 AM(UTC)
haddison

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers
Joined: 3/6/2010(UTC)
Posts: 113
Location: London

ExtFml("Forum20.Ref", C, 1)

is the same as

Ref(C,-1)

There is no need to put a minus sign.

pakki  
#3 Posted : Friday, July 19, 2013 9:00:02 AM(UTC)
pakki

Rank: Member

Groups: Registered, Registered Users
Joined: 8/19/2011(UTC)
Posts: 16

Thanks haddison,

You are right, i did try using ur tip.

Here is my code:

tb:=If(base<>0,BarsSince(su<>0),0);
ExtFml( "Forum.Ref", base<>0, tb);

here su is the series of troughs, where ever there is a trough, the value is 1, otherwise zero
and base is the condition, when the latest peak is greater than earlier peak, the value is 1, otherwise zero.
I am trying to move the base value, whenever it is true to the earliest trough position.

i thing the formula is self-referencing, i am only getting zeroes as output.

Please help me

Thanks Pakki.



mstt  
#4 Posted : Friday, July 19, 2013 3:04:28 PM(UTC)
mstt

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers
Joined: 7/25/2005(UTC)
Posts: 1,042

Was thanked: 57 time(s) in 54 post(s)
Hi pakki

The Forum DLL Ref function uses the opposite polarity from the standard Ref() function. Negative values in the DLL-based function reference future data rather than past data.

With regard to why your formula doesn't work properly, it's difficult to troubleshoot it when critical elements of the formula is missing. I'm referring to the "base" and "su" variables and I just don't see their definitions. Please provide all the relevant facts when asking for help. Thanks.

Roy
pakki  
#5 Posted : Friday, July 19, 2013 10:12:30 PM(UTC)
pakki

Rank: Member

Groups: Registered, Registered Users
Joined: 8/19/2011(UTC)
Posts: 16

Thanks Roy,

Here is the complete code for ur reference,

ssu:=Stoch( 12, 9);
tr:=Trough(1,ssu,0.05);
su:=If(tr=ssu,1,0); ---- gives me series of troughs

sre:=Stoch( 12, 9);
pk:=Peak(1,sre,0.05);
re:=If(pk=sre,1,0);---- gives me series of peaks
su;re;

---compare two latest peaks for their "close", find such latest trough on satisfying condition
c0:=ValueWhen(1,re<>0,CLOSE);
c1:=ValueWhen(2,re<>0,CLOSE);
base:=c0>=c1 AND re<>0;

---find the no of bars since trough existed from the latest peak where the condition is true.
tb:=If(base<>0,BarsSince(su<>0),0);
ExtFml( "Forum.Ref", base<>0, tb);

My requirement is to "highlight the previous trough in its position" once the condition is satisfied on the latest peak. I am trying to move the bars to previous trough by knowing the no of barssince the earlier trough existed.


Regards

Pakki



pakki  
#6 Posted : Tuesday, July 23, 2013 10:05:00 PM(UTC)
pakki

Rank: Member

Groups: Registered, Registered Users
Joined: 8/19/2011(UTC)
Posts: 16

Please help me guys, i think i am almost there, but not there yet in this.

Thanks
Pakki
Laisze  
#7 Posted : Saturday, July 27, 2013 9:39:54 PM(UTC)
Laisze

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers
Joined: 11/18/2007(UTC)
Posts: 96
Location: HK

pakki wrote:
once the condition is satisfied on the latest peak


Oooh... ur so close with that system based on latest peak, Pakki....
Please let me know when u detect the current market peak, so I can short it immediately.
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.