I need your help on the subject.
i created an MT5 indicator which works fine but disappears from the screen when i refreshed the chart it is attached to.
This problem arose when I shifted its signals back 3 minutes using the shift function; but if the shift is on 0 it does not disappear from the screen.
I would like to ask if there is a solution or if someone could help me with it
thank you in advance
Here is the source code of the indicator in question, its signals appear as an arrow on the graph
shiftB and shiftS correspond respectively to Buy and Sell
Ok, took a look at the link you sent on my computer and I have a guess as to what's going on here.
If you shift the arrow to the right it is overridden by the value that results when the indicator calculates the value for that particular i-value. For example if you have 10 bars and you are calculating the values from 10 down to zero and you decide to place a value into the 7th bar when you are calculating the 10th bar value, when the indicator gets to the 7th bar it may change the value that was placed there. This would not be a problem if you are just working with and placing the value of the current ith bar.
You should be able to fix this by removing the Buffer[i] = EMPTY_VALUE else statement so that when you set a value it stays and is not overridden.
Remove the below from both your buy and sell indicator calculations and it should work the way you expect.
else { Buffer1[i] = EMPTY_VALUE; }
I am guessing that the buffer it is automatically filled with EMPTY_VALUE so you would not need this anyway, however I could be wrong about this and some code to mitigate invalid values may be necessary.
Ok, took a look at the link you sent on my computer and I have a guess as to what's going on here.
If you shift the arrow to the right it is overridden by the value that results when the indicator calculates the value for that particular i-value. For example if you have 10 bars and you are calculating the values from 10 down to zero and you decide to place a value into the 7th bar when you are calculating the 10th bar value, when the indicator gets to the 7th bar it may change the value that was placed there. This would not be a problem if you are just working with and placing the value of the current ith bar.
You should be able to fix this by removing the Buffer[i] = EMPTY_VALUE else statement so that when you set a value it stays and is not overridden.
Remove the below from both your buy and sell indicator calculations and it should work the way you expect.
I am guessing that the buffer it is automatically filled with EMPTY_VALUE so you would not need this anyway, however I could be wrong about this and some code to mitigate invalid values may be necessary.

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
I need your help on the subject.
i created an MT5 indicator which works fine but disappears from the screen when i refreshed the chart it is attached to.
This problem arose when I shifted its signals back 3 minutes using the shift function; but if the shift is on 0 it does not disappear from the screen.
I would like to ask if there is a solution or if someone could help me with it
thank you in advance
Here is the source code of the indicator in question, its signals appear as an arrow on the graph
shiftB and shiftS correspond respectively to Buy and Sell