Attachments forums

List of attachments posted on this forum.


All files on forums: 135976

Re: Trend Direction Force Index Indicators MT4

mrtools, Tue Jan 30, 2024 4:53 am

moey_dw wrote: Tue Jan 02, 2024 6:57 pm In the Pinescript book the := is called the reassignment operator which is used to assign a new value to a previously declared variable.

SYNTAX

Code: Select all

<var_name> := <new_value>
EXAMPLE

Code: Select all

//@version=5
indicator("My script")

myVar = 10

if close > open
    // Modifies the existing global scope `myVar` variable by changing its value from 10 to 20.
    myVar := 20
    // Creates a new `myVar` variable local to the `if` condition and unreachable from the global scope.
    // Does not affect the `myVar` declared in global scope.
    myVar = 30

plot(myVar)
Does this help us at all? 🙏 🤔
Can you please check if this version is close, it is at least refreshing and seems better.
All files in topic