FXCloud

Triple Switch

86 0 12
Closely follows the lows or highs of a position while waiting for confirmed reversals by candle close
Remove from Favorite Scripts Add to Favorite Scripts
study("Triple Switch", overlay=true)
WTC=input(true,title="Wait Until Close",type=bool)
Pips=input(0.0020,title="Close Past", minval=0.00001)
Longsource= WTC?close:low
Shortsource= WTC?close:high
Longstart= iff(high>=highest(high,2),lowest(low,2),Longstart[1])
Shortstart= iff(low<=lowest(low,2),highest(high,2),Shortstart[1])
Switchtolong=iff ((Shortsource-Pips)>=Shortstart and (Shortsource-Pips)[1]<Shortstart[1] , 1 ,  0)
Switchtoshort=iff ((Longsource+Pips)<=Longstart and (Longsource+Pips)[1]>Longstart[1] ,  1 ,  0)
direction= iff (na(direction[1]), 0, 
            iff (direction[1]<=0 and Switchtolong, 1, 
            iff (direction[1]>=0 and Switchtoshort, -1, direction[1])))
Tripleswitch= direction>0?Longstart:Shortstart
plot(Tripleswitch, color=direction>0?green:red, style=line, linewidth=2)
English
English (UK)
English (IN)
Deutsch
Français
Español
Italiano
Polski
Türkçe
Русский
Português
Bahasa Indonesia
Bahasa Melayu
ภาษาไทย
Tiếng Việt
日本語
한국어
简体
台灣
Home Stock Screener Forex Signal Finder Cryptocurrency Signal Finder Economic Calendar How It Works Chart Features House Rules Moderators Website & Broker Solutions Widgets Stock Charting Library Feature Request Blog & News FAQ Help & Wiki Twitter
Profile Profile Settings Account and Billing My Support Tickets Contact Support Ideas Published Followers Following Private Messages Chat Sign Out