title: How to create an input template/preset for a custom pine script strategy?
body: <p>Is it possible hard code input templates into my pine script strategy?</p>
  <p>I need to switch between input presets like this: e.g. The built in Trend Line Tool allows you to save and load input templates (Template1, Template2, Trendline):</p>
  <p><a href="https://i.stack.imgur.com/n8sQU.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/n8sQU.jpg" alt="Input template example" /></a></p>
  <p>I wasn't able to find anything about this in the documentation.</p>
  <p>But I'd like to be able to hard code (or even just save) my own input templates, then switch between them at run time and tweak the values.</p>
  <hr />
  <p><strong>What I have already tried</strong></p>
  <p>Creating a drop down, then using the selection in if statements to:</p>
  <ol>
  <li>Update the variables which I use as the defVal for my inputs. [<strong>Fail:</strong> defVal only accepts const variables]</li>
  </ol>
  <pre><code>// Defaults
  defaultInput1 = 1
  
  If (template1)
      defaultInput1 := 999
      
  If (template2)
      defaultInput1 := 123
  
  // Throws exception, defaultInput1 must be const
  Input1 = input(defVal=defaultInput1, ...)
  </code></pre>
  <ol start="2">
  <li>Create seperate sets of duplicate inputs inside if statements. [<strong>Sort of fail:</strong> I hoped that only the selected inputs would be rendered, but it turns out they're all rendered at once. It works and I can edit the values, but I end up with a lot of duplicated inputs to scroll through).</li>
  </ol>
  <pre><code>// Defaults
  Input1 = 0
  Input2 = 0
  
  If (template1)
      Input1 := input(defVal=1, ...)
      Input2 := input(defVal=2, ...)
  
  If (template2)
      Input1 := input(defVal=500, ...)
      Input2 := input(defVal=123, ...)
          
  // ^ Ends up displaying all of the inputs on screen, regardless of which drop down option is selected. 
  </code></pre>