I add this line in the code: (just before runmedian(limit);)
if(limit<period)limit=period;
because the indicator did not redraw on a new candle (as well as the current one)
with this I force the indicator recalculate the lastest candles and fill the working buffer, else the current and new candles will not have enough info to evaluate the median value.
Right. Good remark. We could also correct the function itself :
for (cursor=limit;cursor>=0;cursor--) {
->
for (cursor=MathMax(limit,period);cursor>=0;cursor--) {
willgart:
I add this line in the code: (just before runmedian(limit);)
if(limit<period)limit=period;
because the indicator did not redraw on a new candle (as well as the current one)
with this I force the indicator recalculate the lastest candles and fill the working buffer, else the current and new candles will not have enough info to evaluate the median value.
In metatrader 4 the median stops drawing, refresh doesn't work. The only way
to let it redraw is to open the indicators list and adjust the median and press
ok. Could there be an update please?
Later.....Oh sorry, I copied the text now and it worked, thank you. But the
text isn't in the download yet.
When I use an expert advisor generator then this indicator doesn't work, I load it as a custom indicator but it doesn't work. It doesn't give any buy and sell signals. It is too difficult for me to understand how to edit all these things. Run median seems like a very good indicator. Is there anybody that can adjust this indicator so that it can be easily implemented for expert advisors?
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
I add this line in the code: (just before runmedian(limit);)
if(limit<period)limit=period;
because the indicator did not redraw on a new candle (as well as the current one)
with this I force the indicator recalculate the lastest candles and fill the working buffer, else the current and new candles will not have enough info to evaluate the median value.
for (cursor=limit;cursor>=0;cursor--) {
->
for (cursor=MathMax(limit,period);cursor>=0;cursor--) {I add this line in the code: (just before runmedian(limit);)
if(limit<period)limit=period;
because the indicator did not redraw on a new candle (as well as the current one)
with this I force the indicator recalculate the lastest candles and fill the working buffer, else the current and new candles will not have enough info to evaluate the median value.
In metatrader 4 the median stops drawing, refresh doesn't work. The only way to let it redraw is to open the indicators list and adjust the median and press ok. Could there be an update please?
Later.....Oh sorry, I copied the text now and it worked, thank you. But the text isn't in the download yet.
Я все же не могу получить значения индикатора.
Print(iCustom(NULL,0,"RunMedian",RMA_period,"",0,0));
Возвращает: 2147483647.0
///----
I still can't get the values indicator.
returns: 2147483647.0