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.
|