Step 2: Basic Syntax and Structure

FXC911 – Forex & Crypto News & Insights

Basic Concepts

Pine Script syntax is similar to other programming languages but is designed specifically for time-series data.

Variables and Data Types

Pine Script supports several data types, including integers, floats, and booleans.

//@version=5
indicator("Basic Variables", overlay=true)
var int myInteger = 105
var float myFloat = 105.384
var bool myBoolean = true
plot(myInteger, title="Integer Value", color=color.red)
plot(myFloat, title="Float Value", color=color.green)
Variables and Data Types

Comments and Documentation

Comments in Pine Script start with //.

//@version=5
indicator("Comments Example", overlay=true)
// This is a single line comment
plot(close, title="Close Price", color=color.blue)
Comments and Documentation

Visit me on:

Last updated