Recipe 2: Draw A Line that Connects All the High Values
What do we want to see?
A series of line segments that connects the high value for each candle tick:
How do I use ScriptIQ to draw a line that connects all the high values? (2 steps, if building on Recipe 1)
From Recipe 1 you should understand the following example:
study("Indicator Name here") # This is how and where you name the indicator. value = 100 # This is the y-axis value you draw at each date value. plot(value, color: "yellow") # This draws you a yellow line between each 100 value for each date along the x-axis. # And the # symbol is how I place notes here for # you so that if you copy and paste my notes into the ScriptIQ panel, # then they will not break your indicator. :) # Feel free to delete any comment lines that start with a #.
Now here is where we really begin the first step
value = 100with
HighValue = dataset("High")and then hit Apply.
study("High Value Line") HighValue = dataset("High") plot(value, color:"yellow") # Uh oh! Do not hit Apply yet. # We need to complete step 2 and fix your plot.
plot(value, color: "yellow")to
plot(HighValue, color: "yellow"), and now you should have the following line completed:
study("High Value Line") HighValue = dataset("High") plot(HighValue, color:"yellow")
Click and hold for 2 seconds on your new yellow "High Value Line" and drag it onto your main chart.
Congratulations, you have just drawn your High Value Line indicator!
Recipe 2 Secret
dataset("___") to grab data that may not be visible for each x-axis date.
For instance, if you have a candle chart displayed then you know there is Open, High, Low, and Close data, but you do not see a data table. Use
dataset("your value") to tell the computer to get your desired values. If the value does not exist, then nothing will show up.
For our examples, the following values are hidden but do exist:
- Open, accessible with dataset("Open")
- High, accessible with dataset("High")
- Low, accessible with dataset("Low")
- Close, accessible with dataset("Close")
- Volume, accessible with dataset("Volume")
To know what data is accessible with ScriptIQ contact your provider.
Now let's have some fun drawing new indicators by accessing hidden data.
Here I create a tunnel with "High" and "Low" values like so:
study("High Low Tunnel") TopOfTunnel= dataset("High") + 5 BottomOfTunnel = dataset("Low") - 5 plot(TopOfTunnel, color: "green") plot(BottomOfTunnel, color: "red")
Adding 5 will move the top line higher 5 points for a bigger tunnel.
Subtracting 5 will move the bottom line lower 5 points for a bigger tunnel.
- 2 steps learned to easily use the hidden high value data to make a High Value Line indicator
- 1 secret learned to access more hidden data for making a variety of indicators