definition of variables periods and multiplie instead of 10 and 3
//inputs
periods = 10 //ATR period
multiplier = 3 //ATR multiplier
changeATR = 1 //Change ATR Calculation Method ?
Showsignals = 1 //Show Buy/Sell Signals ?
highlighting = 1 //Highlighter On/Off
///////////////////
atr = averagetruerange[periods](close)
up = high – multiplier*atr
up1 = up[1]
if close[1] > up1 then
up = max(up,up1)
else
up = up
endif
dn = low + multiplier*atr
dn1 = dn[1]
if close[1] < dn1 then
dn = min(dn,dn1)
else
dn = dn
endif
once trend = 1
if trend = -1 and close > dn1 then
trend = 1
elsif trend = 1 and close < up1 then
trend = -1
else
trend = trend
endif
if trend = 1 then
mysupertrend = up
r=0
g=255
b=0
else
mysupertrend = dn
r=255
g=0
b=0
endif
buysignal = trend=1 and trend[1]=-1
sellsignal = trend=-1 and trend[1]=1
if buysignal then
drawtext(“▲”,barindex,mysupertrend)coloured(“green”)
drawtext(“Buy”,barindex,mysupertrend-0.3*tr)coloured(“green”)
elsif sellsignal then
drawtext(“▼”,barindex,mysupertrend)coloured(“red”)
drawtext(“Sell”,barindex,mysupertrend+0.3*tr)coloured(“red”)
endif
mplot = (open+close+high+low)/4
colorbetween(mplot,mysupertrend,r,g,b,40)
return mysupertrend coloured(r,g,b)style(line,2)
JSParticipant
Veteran
Hi,
You can change all input values yourself:
For example:
Periods=10 //ATR period
Just change the number 10 to a value of your choice:
Example: Periods=20 //ATR period
Of course, this also applies to the other input values…
That’s i know, i want to change that with out to axit at code
@js
It doesn’t work , the changes are not made at settings , only when i change inside the code
JSParticipant
Veteran
In the code comment out the following lines:
// periods = 10
// multiply = 3
It’s hard to help when you don’t know the basic operations of the program…
Ok, I’ll try it tonight, after work, thanks.
Now it works, thank you all