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

Notification

Icon
Error

Options
Go to last post Go to first unread
vladimir  
#1 Posted : Tuesday, May 19, 2015 11:26:54 AM(UTC)
vladimir

Rank: Advanced Member

Groups: Registered, Registered Users
Joined: 7/1/2007(UTC)
Posts: 33

Hi

Looking to scan for hidden RSI divergence.

Found some code, twisted it and exploration end up

without any result. Must be some logic or coding problem.

Could someone kindly help to check what is wrong.

Thank

 

RSI buying signal in filter

If(RSI(9) < HHV(RSI(9), 14) AND Close > HHV(close, 14), 1, 0) OR

if(Close > LLV(close, 14) AND RSI(9) < LLV(RSI(9), 14), 1, 0)

 

 

 

MS Support  
#2 Posted : Tuesday, May 19, 2015 10:01:30 PM(UTC)
MS Support

Rank: Advanced Member

Groups: Moderators, Registered, Registered Users, Subscribers
Joined: 10/8/2010(UTC)
Posts: 1,960

Thanks: 92 times
Was thanked: 155 time(s) in 150 post(s)
I am by no means an 'expert' formula writer so I can't vouch for the validity of your formula in general, I can tell you a couple issues you might encounter. HHV and LLV both include the 'current bar' in their # of periods. So C > HHV(C,14) would never be true, because the Close could not be greater than itself. To deal with this, you can either use the REF function around the HHV / LLV functions, or you can use Greater Than or Equal To / Less Than or Equal To operators instead: >= or <= A slightly modified formula using the REF function listed below: If(RSI(9) < Ref(HHV(RSI(9),14),-1) AND CLOSE > Ref(HHV(CLOSE,14),-1),1,0) OR If(CLOSE > Ref(LLV(CLOSE,14),-1) AND RSI(9) < Ref(LLV(RSI(9),14),-1),1,0) As a general rule, whenever you encounter problems with formulas, it is best to break the formula up into it's individual parts, and plot them as an indicator. By doing so, if you were to create an indicator with: C > HHV(C,14) as the formula, you would see that it remains at 0 all the time, meaning your formula could never be true while it contains the above criteria.
vladimir  
#3 Posted : Wednesday, May 20, 2015 4:10:40 PM(UTC)
vladimir

Rank: Advanced Member

Groups: Registered, Registered Users
Joined: 7/1/2007(UTC)
Posts: 33

Hi Support Thank a lot for your reply and help especially why my code is not working plus advise how to debug.
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.