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
SuperTrend [SOLVED]
- rrams
- Posts: 128
- Joined: 10 Feb 2011
- Location: USA
- Has thanked: 7 times
- Been thanked: 70 times
- Contact:
Re: SuperTrend
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)));