PineScript Basic

3 Types of Functions 1. Build-In Functions: like EMA/DMA. – always return values 2. Custom Functions: write yourself a function. 3. Annotation Functions: not have to return value, some return values. mostly used to drew something on charts. Identifiers (variables) All variables are vectors (same as arrays). Case sensitive. can Read more…

User Functions

How to create user function -> Cannot be used for drawing, just use by our code. -> No return value on pine script user function, the last line in the function is used as return value. -> Can create multi variables inside user function and use them outside the user Read more…

If Else Pinescript

Conditional Operator ? and the Function iff Conditional Ternary Operator calculates the first expression (condition) and returns a value either of the second operand (if the condition is true) or of the third operand (if the condition isfalse). Syntax: If ‘condition’ will be calculated to ‘true’, then result1 will be Read more…

pinescript cross() function

# See if values cross each other in TradingView Pine What makes variables in TradingView Pine unique is that they don’t contain just a single value. Instead they hold a series of values (TradingView Wiki, 2017), with one value for each price bar. This makes it for instance possible to Read more…