Reference
Plots and chart colors
Everything that draws one value per bar. Call these at the top level of your script.
barcolor(color, offset=0, editable=true, show_last=na, title="", display="all")
Colors the candles. Call at the top level of the script.
Returns: nothing
| Parameter | Type | Notes |
|---|---|---|
color | color | |
offset | int | Default 0 |
editable | bool | Default true |
show_last | int | Default na |
title | string | Default "" |
display | string | Default "all" |
bgcolor(color, offset=0, editable=true, show_last=na, title="", display="all")
Colors the chart background of each bar. Call at the top level of the script.
Returns: nothing
| Parameter | Type | Notes |
|---|---|---|
color | color | |
offset | int | Default 0 |
editable | bool | Default true |
show_last | int | Default na |
title | string | Default "" |
display | string | Default "all" |
fill(plot1, plot2, color=na, title="", editable=true, show_last=na, fillgaps=false, display="all")
Fills the space between two plots or two hlines. Call at the top level of the script.
Returns: nothing
| Parameter | Type | Notes |
|---|---|---|
plot1 | any | |
plot2 | any | |
color | color | Default na |
title | string | Default "" |
editable | bool | Default true |
show_last | int | Default na |
fillgaps | bool | Default false |
display | string | Default "all" |
hline(price, title="", color=#787b86, linestyle="dashed", linewidth=1, editable=true, display="all")
Draws a horizontal line at a fixed price. Call at the top level of the script.
Returns: hlineid
| Parameter | Type | Notes |
|---|---|---|
price | num | |
title | string | Default "" |
color | color | Default #787b86 |
linestyle | string | Default "dashed" |
linewidth | int | Default 1 |
editable | bool | Default true |
display | string | Default "all" |
plot(series, title="", color=na, linewidth=1, style="line", trackprice=false, histbase=0, offset=0, join=false, editable=true, show_last=na, display="all", format="", precision=na)
Draws a series as a line (or histogram, columns, circles, area...). Call at the top level of the script.
Returns: plotid
| Parameter | Type | Notes |
|---|---|---|
series | num | |
title | string | Default "" |
color | color | Default na |
linewidth | int | Default 1 |
style | string | Default "line" |
trackprice | bool | Default false |
histbase | float | Default 0 |
offset | int | Default 0 |
join | bool | Default false |
editable | bool | Default true |
show_last | int | Default na |
display | string | Default "all" |
format | string | Default "" |
precision | int | Default na |
plotarrow(series, title="", colorup=#089981, colordown=#f23645, offset=0, minheight=5, maxheight=100, editable=true, show_last=na, display="all")
Draws up arrows for positive values and down arrows for negative values. Call at the top level of the script.
Returns: nothing
| Parameter | Type | Notes |
|---|---|---|
series | num | |
title | string | Default "" |
colorup | color | Default #089981 |
colordown | color | Default #f23645 |
offset | int | Default 0 |
minheight | int | Default 5 |
maxheight | int | Default 100 |
editable | bool | Default true |
show_last | int | Default na |
display | string | Default "all" |
plotbar(open, high, low, close, title="", color=na, editable=true, show_last=na, display="all")
Draws OHLC bars. Call at the top level of the script.
Returns: nothing
| Parameter | Type | Notes |
|---|---|---|
open | num | |
high | num | |
low | num | |
close | num | |
title | string | Default "" |
color | color | Default na |
editable | bool | Default true |
show_last | int | Default na |
display | string | Default "all" |
plotcandle(open, high, low, close, title="", color=na, wickcolor=na, editable=true, show_last=na, bordercolor=na, display="all")
Draws candles. Call at the top level of the script.
Returns: nothing
| Parameter | Type | Notes |
|---|---|---|
open | num | |
high | num | |
low | num | |
close | num | |
title | string | Default "" |
color | color | Default na |
wickcolor | color | Default na |
editable | bool | Default true |
show_last | int | Default na |
bordercolor | color | Default na |
display | string | Default "all" |
plotchar(series, title="", char="•", location="abovebar", color=na, offset=0, text="", textcolor=na, editable=true, size="auto", show_last=na, display="all")
Draws a character on bars where series is true (or not na). Call at the top level of the script.
Returns: nothing
| Parameter | Type | Notes |
|---|---|---|
series | any | |
title | string | Default "" |
char | string | Default "•" |
location | string | Default "abovebar" |
color | color | Default na |
offset | int | Default 0 |
text | string | Default "" |
textcolor | color | Default na |
editable | bool | Default true |
size | string | Default "auto" |
show_last | int | Default na |
display | string | Default "all" |
plotshape(series, title="", style="circle", location="abovebar", color=na, offset=0, text="", textcolor=na, editable=true, size="auto", show_last=na, display="all")
Draws a shape on bars where series is true (or not na). Call at the top level of the script.
Returns: nothing
| Parameter | Type | Notes |
|---|---|---|
series | any | |
title | string | Default "" |
style | string | Default "circle" |
location | string | Default "abovebar" |
color | color | Default na |
offset | int | Default 0 |
text | string | Default "" |
textcolor | color | Default na |
editable | bool | Default true |
size | string | Default "auto" |
show_last | int | Default na |
display | string | Default "all" |
Education only. Not financial advice. Examples are teaching samples, not trading results.
