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