Hi,
I have a custom indicator that calculates a MA line (like ma in MT5 indicator), I plot up arrow and down arrow for the direction. I have a problem when I put this indicator on more than one chart (different currency...it seems they are effecting each other. the last loaded chart doesn't draw arrows while the first draw. What can be wrong?
When you run these Indicators how much CPU usage is the MT5 terminal using ? how many cores does your CPU have ? does it have hyperthreading enabled ?
Thanks Raptor for your time.
I have i7 8 cores. The indicator is slow at first run (2-3 seconds loading time) but after that all is fine. It also depends on how much data you have PRE-downloaded. if you go delete you history then it would be quick. I can add a counter parameter to be able to specify the amount of periods to calculate but I haven't find the need for it.
I have found my issue, I do a array initialize on start but all new items after initialize dont get set to 0. So I replaced array initialize to just setting the buffers to zero. Thanks again for your time.
int OnCalculate(const int rates_total, const int prev_calculated, const int begin, const double &price[]) { SimpleMAOnBuffer(rates_total,0,begin,MAPeriod,price,MABuffer ); //--- check for bars count if(rates_total<MAPeriod-1+begin) return(0);// not enough bars for calculation //How many new bars are there for this call for(int i = rates_total-1; (i >= (rates_total - prev_calculated))&&(i>2); i--) { //up arrow logic - (curr value - prev timeframe value) is > (prev timeframe value - prev - 1 timeframe value) UpArrow[i] = 0; DownArrow[i] = 0; //If the diffrence between the latest bar and 1 previous has reach the desired diffrence (Angle) then return true. Or if DesiredAngle is disable <=0. bool HasReachDisiredAngle = ((MABuffer[i]-MABuffer[i-1]) > DisiredAngle)||(DisiredAngle<=0)?true:false; if( (MABuffer[i-1]>MABuffer[i-2]) && ....blah blah
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hi,
I have a custom indicator that calculates a MA line (like ma in MT5 indicator), I plot up arrow and down arrow for the direction. I have a problem when I put this indicator on more than one chart (different currency...it seems they are effecting each other. the last loaded chart doesn't draw arrows while the first draw. What can be wrong?