My indicator is shifting when I scroll the chart (and also new bars are being added)?

 

Ok, hello... so this is happening for a while! And I'm going crazy! 

So, I drop my (multycurrency osciallatior) indicator on a chart, scroll to the last bar on the chart (in mql4 terms: Candle[Bars-1]) and if I continue scrolling more in the same direction, MT4 downloads more Bars and my indicator shifts more to the left! I have checked: IT SHIFTS ARRAYS THROUGH BUFFERS! Also, he may be shifting for the same amount of bars that MT4 downloads...but, I'm not sure..

So, anyone knows how to solve this?

//See the picture I provided:

Thank you! 

Files:
Heeelllp.png  84 kb
 

Miroslav Stojic: Ok, hello... so this is happening for a while! And I'm going crazy!

So, I drop my (multycurrency osciallatior) indicator on a chart, scroll to the last bar on the chart (in mql4 terms: Candle[Bars-1]) and if I continue scrolling more in the same direction, MT4 downloads more Bars and my indicator shifts more to the left! I have checked: IT SHIFTS ARRAYS THROUGH BUFFERS! Also, he may be shifting for the same amount of bars that MT4 downloads...but, I'm not sure..

So, anyone knows how to solve this?

Since it is for one of your Market products and you obviously don't want to show your code, all we can do is try to "guess" what the problem may be.

But in all honesty, without the source code, it will be very difficult to "guess" at what it might be. Maybe you will be lucky and someone will "guess" the correct issue.

 
Fernando Carreiro:

You have not supplied a copy of the indicator's code or a link to the indicator in question, so we cannot possibly be able to provide help on it. All we can do is "guess" what the problem may be.

So my "guess" is that it has a bug in the code, but since you did not provide the code, we cannot offer advice on how to fix it.

Another "guess", in the case it is a 3rd party Indicator, is that it may be the unlikely case that it was designed that way, but it could also be a bug too. You will just have to contact the author, if you don't have the source code for it.


Well, sorry but I can't share the complete code... Also, I know I can fix it by SetIndexShift() or to Re-Calculate everything again on new tick... BUT! I want to fix this problem without new ticks, or simply, I don't want it to shift anything at all in the first place. That is my main problem?! Do you have any "guess"?

p.s. Thanks for guessing.. :)
 
Fernando Carreiro:

Since it is for one of your Market products and you obviously don't want to show your code, all we can do is try to "guess" what the problem may be.

But in all honesty, without the source code, it will be very difficult to "guess" at what it might be. Maybe you will be lucky and someone will "guess" the correct issue.


Yes, that's right... Thanks anyway! Maybe someone had the same problem, and "guess" right!

 
Miroslav Stojic:

Yes, that's right... Thanks anyway! Maybe someone had the same problem, and "guess" right!

Are your buffers set as “As a Series”, or just as normal Arrays?

I have a “feeling” you have them set as normal array indexing and that is what is causing the issue. Just a “guess”!
 
Fernando Carreiro:
Are your buffers set as “As a Series”, or just as normal Arrays?

I have a “feeling” you have them set as normal array indexing and that is what is causing the issue. Just a “guess”!

Haaaahhh.... That was actually a great guess! Thank you! I fixed it! :)

I changed the ArrayAsSeries and also the main thing, I changes the way main counter works!! Again, thanks a lot! :D So happy...

 
Miroslav Stojic: Haaaahhh.... That was actually a great guess! Thank you! I fixed it! :)

I changed the ArrayAsSeries and also the main thing, I changes the way main counter works!! Again, thanks a lot! :D So happy...

You are welcome!
Reason: