Example - Switching Line

Example of manipulating a float series to:

• switch from one source to another
• maintain a level by referencing itself

This script publication is intended for:

• Educational Purposes

Who is it for?

Anyone who wants to learn how to change the position or state of an active float series.
Release Notes: Made a small simplification to the boolean checks, although the original implemention was not exactly "wrong", there was indeed no need for the use of the pre-initiation using the var keyword.

Thanks @PineCoders for pointing it out.

Open-source script

In true TradingView spirit, the author of this script has published it open-source, so traders can understand and verify it. Cheers to the author! You may use it for free, but reuse of this code in a publication is governed by House Rules. You can favorite it to use it on a chart.

Want to use this script on a chart?
If you like what I do, consider buying me a nice fresh cup of tea :)



Nice tutorial, I see you are switching things up a bit )
+1 Reply
JayRogers allanster
@allanster, be careful - I may feel an urge to "LoL" and/or "RofL" in your general direction, sir. ;p
+1 Reply

thank you
JayRogers sametborsa
@sametborsa, You're welcome :)
This is very interesting .... thanks for the share
JayRogers fannytradz
@fannytradz, you're welcome :)
Oh, the irony. I was just thinking about how I need to figure this out the other day and now you share this, I forget what I was going to use it on! Ahah!
JayRogers burgercrisis
@burgercrisis, I'm sure it will come back to you at a completely inapropriate time, these things usually do!
+1 Reply
burgercrisis JayRogers
For real! I'm trying to do a hike every day I can, it really helps the brain. Although I also need to write things down in my phone when I think of them...
+1 Reply
JayRogers burgercrisis
@burgercrisis, Think i need to take a leaf outta your book with the hiking (or similar) sounds like a good plan.
Home Stock Screener Forex Screener Crypto Screener Economic Calendar About Chart Features Pricing Refer a friend House Rules Help Center Website & Broker Solutions Widgets Charting Solutions Lightweight Charting Library Blog & News Twitter
Profile Profile Settings Account and Billing Referred friends Coins My Support Tickets Help Center Private Messages Chat Sign Out