Arrow displacement problem ! ?

 

Hello Coders, I am just facing some problem in a indicator that place arrow into the chart but when i login into my another account and back to the chart its displace the arrow . what is the issue ? Is it bug or indicator problem ? 

displacement

After changing time frame its back to placement: right place


Thank you in Advanced. 

 

Thanks for your replay . but OnTimer() & iATR both is not working for me . :( 

 

Actually problem is not arrow into candle or too close of signal candle. Problem is that when indicator re-init by switching account its draw multiple arrow around the exact arrow and displace original arrow. Then when i change TF ( like if i was H1 then go to other TF and again back to H1 ) its draw back rightly . I am confused how to fixed this issue i my several indicator. A lots of indicator do the same things.

 
Komoles Kumar:

Actually problem is not arrow into candle or too close of signal candle. Problem is that when indicator re-init by switching account its draw multiple arrow around the exact arrow and displace original arrow. Then when i change TF ( like if i was H1 then go to other TF and again back to H1 ) its draw back rightly . I am confused how to fixed this issue i my several indicator. A lots of indicator do the same things.

The issue is in your code, are you really hoping help without showing it ?
 
Komoles Kumar: ther TF and again back to H1 ) its draw back rightly . I am confused how to fixed this issue 
  1. Do your lookbacks correctly.

  2. Do you really expect an answer? There are no mind readers here and our crystal balls are cracked.

    We can't see your broken code.

    With the information you've provided — we can only guess. And you haven't provided any information for that.

 
William Roeder:
  1. Do your lookbacks correctly.

  2. Do you really expect an answer? There are no mind readers here and our crystal balls are cracked.

    We can't see your broken code.

    With the information you've provided — we can only guess. And you haven't provided any information for that.

double iSARx;
   double iSARy;
   double iADXx;
   int Limit;
   if (Bars > 10) {
      Counterx = IndicatorCounted();
      if (Counterx >= 0) {
         if (Counterx > 0) Counterx--;
         Limit = MathMin(Bars - Counterx - 1, MINBARS);
         
                         
         for(int i = Limit; i >= 0; i--)
     {
            iSARy = iSAR(Symbol(), 0, NormalizeDouble(1 / (10 * MAIN_PERIOD + 0.00001), 3), 0.5, i + 1);
            iSARx = iSAR(Symbol(), 0, NormalizeDouble(1 / (10 * MAIN_PERIOD + 0.00001), 3), 0.5, i);
            iADXx = iADX(Symbol(), 0, ADX_PERIOD, PRICE_CLOSE, MODE_MAIN, i);
            if (iSARx > iClose(NULL,0,i) && iSARy < iClose(NULL,0,i+1) && iADXx > 20.0) {
               BufferSell[i] = iHigh(NULL,0,i) + MathAbs(iClose(NULL,0,i) - iOpen(NULL,0,i)) / 2.0 + 4.0 * MathAbs(Bid - Ask);
     }

Sorry for not showing the code earlier . 

 
Alain Verleyen:
The issue is in your code, are you really hoping help without showing it ?

Sorry for not showing the code earlier. 

 
  1. Why did you post your MT4 question in the MT5 Indicators section instead of the MQL4 section, (bottom of the Root page?)
              General rules and best pratices of the Forum. - General - MQL5 programming forum?
    Next time post in the correct place. The moderators will likely move this thread there soon.

  2. if(…) BufferSell[i]=…; else BufferSell[i]=EMPTY_VALUE;

 
William Roeder:
  1. Why did you post your MT4 question in the MT5 Indicators section instead of the MQL4 section, (bottom of the Root page?)
              General rules and best pratices of the Forum. - General - MQL5 programming forum?
    Next time post in the correct place. The moderators will likely move this thread there soon.

  2. if(…) BufferSell[i]=…; else BufferSell[i]=EMPTY_VALUE;

ohh Sorry , i dont notice that issue . Next time i will post into MT4 section .