Problem with indicators buffers not erasing when out of the period supposed to show + not updating parameters
benoitfon:
I am working on a polynomial regression indicator ( just did order 1 for the moment ).
But I've two problems I can't solve:
1. The indicator leave a trail after passing ( instead of erasing)
2. The parameters seems to not update correctly. ( When I reload the indicator everything is fine then when the time move, there is like an unwanted memory making the indicator fail.
After reset: (wanted result)
Before reset: (unwanted result) ( from strategy tester, but I saw the same problem in M1 )
And here is my script:
Just add these lines in your init():
SetIndexEmptyValue(0,0); SetIndexEmptyValue(1,0); SetIndexEmptyValue(2,0);
And these lines before your last 'for' loop:
ArrayInitialize(Buf_0,0); ArrayInitialize(Buf_1,0); ArrayInitialize(Buf_2,0);
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Hello,
I am working on a polynomial regression indicator ( just did order 1 for the moment ).
But I've two problems I can't solve:
1. The indicator leave a trail after passing ( instead of erasing)
2. The parameters seems to not update correctly. ( When I reload the indicator everything is fine then when the time move, there is like an unwanted memory making the indicator fail.
After reset: (wanted result)
MetaTrader Trading Platform Screenshots
AUDNZD, H1, 2019.08.07
OANDA DIVISION7, MetaTrader 4, Real
Before reset: (unwanted result) ( from strategy tester, but I saw the same problem in M1 )
MetaTrader Trading Platform Screenshots
AUDNZD, H1, 2019.08.07
OANDA DIVISION7, MetaTrader 4, Real
And here is my script: