In the iCustom call you have to include the external parameters of the indicator.
XtrendDown = iCustom(NULL,Trend_TF,"XSuperTrend", "", "", 10, 1.7, 2,1);
In the iCustom call you have to include the external parameters of the indicator.
XtrendDown = iCustom(NULL,Trend_TF,"XSuperTrend", "", "", 10, 1.7, 2,1);
Only if the default values in the Indicator are not suitable . . .
Thanks RaptorUK
Yes of course. Unfortunately I did not write my question clear enough.
In my opinion this is only necessary if I wanted to changed those parameters in the EA. I do not want them to be changed, so the indicator is using the params from the indicator code itself. -- at least the EA is correctly detecting the correct trend, either bearish or bullish. So this is working as expected.
But my problem is rather to get the values from the support trend line (the red or green vertical lines). They are actually specifying the current stop loss levels of this particular trend. The indicator is writing them to particular values of this particular trend.
I'm getting up and downtrend from buffer 1 and 2, but how can I get the trend (support) line values?
Thank you
I'm getting up and downtrend from buffer 1 and 2, but how can I get the trend (support) line values?
Buffer 0 ? The best way to determine what you need . . . put the Indicator on a chart and examine it's buffers using the Data Window ( Ctrl + D ) then you can see what buffers you need and what kind of values you can expect . . .
Thanks RaptorUK
Well, it was as usual much easier than I thought. The data windows pointed me to the solution. The opposite buffer has the value for the current support trend line in it. So uptrend has support line for the downtrend and vice versa. I always looked after other buffers than 1 and 2. Thanks again to show me the right direction to the solution!
Thanks RaptorUK
Well, it was as usual much easier than I thought. The data windows pointed me to the solution. The opposite buffer has the value for the current support trend line in it. So uptrend has support line for the downtrend and vice versa. I always looked after other buffers than 1 and 2. Thanks again to show me the right direction to the solution!
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Dear mql4 forum
I'm currently trying to build my first EA. Everything goes well, except that I am not able to read the values for support red / green trendlines from the indicator (please verify the print-screen)
Even though I can get the current trend with (Trend_TF = variable of desired timeframe)
XtrendDown = iCustom(NULL,Trend_TF,"XSuperTrend",2,1);
XtrendUp = iCustom(NULL,Trend_TF,"XSuperTrend",1,1);
I'm not able to get the trendlines which I plan to use together with the current spread as SL for the trades.
Thank you in Advance.
The code from Xaphod'd indicator is follows: