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 : Sunday, October 2, 2011 9:02:28 AM(UTC)
pakki

Rank: Member

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

Hi, I have a custom indicator for determining the support lines. The indicator has value if there is support and no value if there is no support. Using this,i am trying to draw last two support horizontal lines for the last two values from the indicator as support. How do i code this? Thanks in advance. Pakki
jjstein  
#2 Posted : Sunday, October 2, 2011 10:36:57 AM(UTC)
jjstein

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers
Joined: 5/13/2005(UTC)
Posts: 715
Location: Midwest, USA

Was thanked: 1 time(s) in 1 post(s)
Post your code.

pakki  
#3 Posted : Sunday, October 2, 2011 10:26:29 PM(UTC)
pakki

Rank: Member

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

Hi jjstein, Horizontal:=Valuewhen(1, condition, indicator value); Horizontal; This gives the horizontal values continuously, but i want this, only for last two values. Thanks, Pakki
jjstein  
#4 Posted : Monday, October 3, 2011 2:13:58 PM(UTC)
jjstein

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers
Joined: 5/13/2005(UTC)
Posts: 715
Location: Midwest, USA

Was thanked: 1 time(s) in 1 post(s)
So...you want to plot a line for the last two bars only, at the value specified by "condition", is that right?

jjstein  
#5 Posted : Monday, October 3, 2011 2:38:05 PM(UTC)
jjstein

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers
Joined: 5/13/2005(UTC)
Posts: 715
Location: Midwest, USA

Was thanked: 1 time(s) in 1 post(s)
Also -- What is the condition?

pakki  
#6 Posted : Monday, October 3, 2011 9:29:31 PM(UTC)
pakki

Rank: Member

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

Yes that's right, i want for only last Values, Also the condition is condition is if indicator.value 0, i want these last two values of the indicator to be shown as horizontal lines. Pakki
jjstein  
#7 Posted : Wednesday, October 5, 2011 11:48:13 AM(UTC)
jjstein

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers
Joined: 5/13/2005(UTC)
Posts: 715
Location: Midwest, USA

Was thanked: 1 time(s) in 1 post(s)
Pakki -- Try this:

Lookback:=Input("Lookback",2,500,21);
Length:=Input("Length",2,50,2);

Horizontal:=LLV(C,Lookback);
FirstX:=LastValue(Cum(1))-Length-1;
Support:=If(BarsSince(Cum(1)=FirstX)>-1,
LastValue(Horizontal),
0);

Support;


pakki  
#8 Posted : Friday, October 7, 2011 8:24:22 AM(UTC)
pakki

Rank: Member

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

Johnathan, Great help it has been. Appreciate that. Thanks pakki
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.