Topic: N-Days Range Switch indicator request

Hello

Here are the codes of :

2 days range switch
If(C>Ref(Max(H,Ref(H,-1)),-1),Min(L,Ref(L,-1)),If(C<Ref(Min(L,Ref(L,-1)),-1),Max(H,Ref(H,-1)),PREV))

3 days range switch
If(C>Ref(Max(H,Max(Ref(H,-1),Ref(H,-2))),-1),Min(L,Min(Ref(L,-1),Ref(L,-2))),If(C<Ref(Min(L,Min(Ref(L,-1),Ref(L,-2))),-1),Max(H,Max(Ref(H,-1),Ref(H,-2))),PREV))

4 days range switch
If(C>Ref(Max(Max(H,Ref(H,-3)),Max(Ref(H,-1),Ref(H,-2))),-1),Min(Min(L,Ref(L,-3)),Min(Ref(L,-1),Ref(L,-2))),If(C<Ref(Min(Min(L,Ref(L,-3)),Min(Ref(L,-1),Ref(L,-2))),-1),Max(Max(H,Ref(H,-3)),Max(Ref(H,-1),Ref(H,-2))),PREV))

It seams good for all 4 slots
codes in metastock
Any FSb code for it

Thanks in advance

Post's attachments

4day switch.png
4day switch.png 6.22 kb, 2 downloads since 2013-03-21 

You don't have the permssions to download the attachments of this post.