当前位置:网站首页>Common content of pine script script

Common content of pine script script

2022-06-24 03:44:00 A fat yard makes a strong man

1、 Set indicator name

study(" My indicators ") // Index name 

 Insert picture description here

2、 Draw line

plot(close, color=osc_color, style=line, linewidth=2)

Four parameters , Data in sequence 、 Color 、 type 、 Line width , I wish there were other parameters that are not commonly used , In addition to data parameters , Anything else can be omitted .
among style There are several types :

  • line: curve
  • histogram: Histogram
  • Others need to be explored
    Official explanation :
    style (plot_style) Type of plot. Possible values are: plot.style_line, plot.style_stepline, plot.style_stepline_diamond, plot.style_histogram, plot.style_cross, plot.style_area, plot.style_columns, plot.style_circles, plot.style_linebr, plot.style_areabr. Default value is plot.style_line.

3、 Fill between lines

p1 = plot(open)
p2 = plot(close)
fill(p1, p2, color=color.new(color.green, 90))

 Insert picture description here
There's a lot more , Continue to update later ...

3、 Parameter input

Generally speaking , We don't need to define variables , Just use it directly , As shown on the left of the following code . But variables always have an input source , That is parameter setting , Use input function .

length = input.int(9, minval=1)
length2 = input.int(2, minval=1)
length3 = input.int(3, minval=1)

 Insert picture description here

原网站

版权声明
本文为[A fat yard makes a strong man]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/175/202206232337063977.html