SuperTrend  [SOLVED]

Questions about MultiCharts and user contributed studies.
neerav
Posts: 2
Joined: 29 Sep 2013

SuperTrend  [SOLVED]

Postby neerav » 26 Sep 2016

Hi everybody
I am trying to call the SuperTrend Function in a signal: I type SuperTrend(10,3,10) ( = ATRLength, ATRMult, Strength) but the Compiler replies "Invalid number of parameters. 4 parameter(s) expected"
What is the fourth parameter missing?
Thanks

User avatar
rrams
Posts: 128
Joined: 10 Feb 2011
Location: USA
Has thanked: 7 times
Been thanked: 70 times
Contact:

Re: SuperTrend

Postby rrams » 26 Sep 2016

The fourth parameter is just a reference to a variable that will hold a number indicating whether the trend is up or down. The function itself returns the trend value.

Code: Select all

vars:
strend(0),
st(0);
st=SuperTrend(10, 3, 10, strend);
Plot1(st, "Up"); { plot this hidden }
Plot2(st, "Down"); { plot this hidden }
Plot3(st, "SuperTrend", iff(strend=1, GetPlotColor(1), GetPlotColor(2)));

neerav
Posts: 2
Joined: 29 Sep 2013

Re: SuperTrend

Postby neerav » 27 Sep 2016

Great, thanks; I added the Var "strend(0)" and it works !


Return to “MultiCharts”