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

Notification

Icon
Error

Options
Go to last post Go to first unread
klkoo  
#1 Posted : Saturday, January 12, 2008 9:51:07 AM(UTC)
klkoo

Rank: Member

Groups: Registered, Registered Users, Subscribers
Joined: 5/21/2005(UTC)
Posts: 16

Please find the below code for the break peak formula. When I insert the indicator in the price chart, it doesn't show the 2 lines to indicate the "TopBox" & "BottomBox".

Please verify any errors on the code provided.

LowL:=If(LOW=LLV(LOW,5),LOW,If(Ref(LOW,-1)=LLV(LOW,5),Ref(LOW,-1), If(Ref(LOW,-2)=LLV(LOW,5),Ref(LOW,-2),If(Ref(LOW,-3)=LLV(LOW,5),Ref(LOW,-3), If(Ref(LOW,-4)=LLV(LOW,5),Ref(LOW,-4),0)))));
NewH:=ValueWhen(1,HIGH>Ref(HHV(HIGH,5),-1),HIGH);
box1:=HHV(HIGH,3); box2:=ValueWhen(1,BarsSince(HIGH>Ref(HHV(HIGH,5),-1))=3 AND box1=true,NewH);
box3:=ValueWhen(1,BarsSince(HIGH>Ref(HHV(HIGH,5),-1))=3 AND box1=true,LowL);
TopBox:=box2;
BottomBox:=box3;
TopBox;
BottomBox;

wblam  
#2 Posted : Sunday, January 13, 2008 7:12:53 AM(UTC)
wblam

Rank: Advanced Member

Groups: Registered, Registered Users
Joined: 11/25/2006(UTC)
Posts: 79

klkoo wrote:

Please find the below code for the break peak formula. When I insert the indicator in the price chart, it doesn't show the 2 lines to indicate the "TopBox" & "BottomBox".

Please verify any errors on the code provided.

LowL:=If(LOW=LLV(LOW,5),LOW,If(Ref(LOW,-1)=LLV(LOW,5),Ref(LOW,-1), If(Ref(LOW,-2)=LLV(LOW,5),Ref(LOW,-2),If(Ref(LOW,-3)=LLV(LOW,5),Ref(LOW,-3), If(Ref(LOW,-4)=LLV(LOW,5),Ref(LOW,-4),0)))));
NewH:=ValueWhen(1,HIGH>Ref(HHV(HIGH,5),-1),HIGH);
box1:=HHV(HIGH,3); box2:=ValueWhen(1,BarsSince(HIGH>Ref(HHV(HIGH,5),-1))=3 AND box1=true,NewH);
box3:=ValueWhen(1,BarsSince(HIGH>Ref(HHV(HIGH,5),-1))=3 AND box1=true,LowL);
TopBox:=box2;
BottomBox:=box3;
TopBox;
BottomBox;

I think the error is the condition:

box1=true

which means HHV(HIGH,3)=1

The probability of this condition can fulfil is very low.

further more the other condition:

BarsSince(HIGH>Ref(HHV(HIGH,5),-1))=3

has to fulfil at the same time.

Hence most of the time you can not get any result.

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.