2 พ.ย. 2022 เวลา 09:42 • หุ้น & เศรษฐกิจ
ฝึกเขียน Pine Script บน Tradingview กัน Ep.01
indicator(title="Shed me the light",shorttitle='แกะรอยยุทธจักร',overlay=false,format=format.price,precision=1) //บอกว่า code นี้เป็นอะไร indicator , strategy or library
var greencandlecount = 0 //ตั้งตัวแปรแบบต่อเนื่อง
greencandlecount = 0 // ถ้าแบบนี้คือเริ่มใหม่ทุกครั้งที่ขึ้น bar ใหม่
drawshape=false
if close>open
greencandlecount:=greencandlecount+1
drawshape:=true
plot(greencandlecount,color=color.yellow)
plotshape(drawshape,'G')
ก็ลองเอาไปเล่นดู ตัวแปรแบบที่มี var ข้างหน้า กับไม่มีต่างกันอย่างไร
โฆษณา