Is this possible? - page 2

 
void SendCrossAlert()
{
  double tenkan_senValue1 = 0;
  double kijun_sen_Value1 = 0;
  double tenkan_senValue2 = 0;
  double kijun_sen_Value2 = 0;
  
  for(int i = 0;i < 1000;i++)
  {
   
    double y = iBarShift(NULL,PERIOD_H1,Time[i],false);
    tenkan_senValue1 = iIchimoku(Symbol(),PERIOD_M15,tenkan_sen,kijun_sen,senkou_span_b,MODE_TENKANSEN,i);
    kijun_sen_Value1 = iIchimoku(Symbol(),PERIOD_M15,tenkan_sen,kijun_sen,senkou_span_b,MODE_KIJUNSEN,i);
    tenkan_senValue2 = iIchimoku(Symbol(),PERIOD_M15,tenkan_sen,kijun_sen,senkou_span_b,MODE_TENKANSEN,i + 1);
    kijun_sen_Value2 = iIchimoku(Symbol(),PERIOD_M15,tenkan_sen,kijun_sen,senkou_span_b,MODE_KIJUNSEN,i + 1);
    double tenkan_senAbove = iIchimoku(Symbol(),PERIOD_H1,tenkan_sen,kijun_sen,senkou_span_b,MODE_TENKANSEN,y);
    double kijun_sen_Above = iIchimoku(Symbol(),PERIOD_H1,tenkan_sen,kijun_sen,senkou_span_b,MODE_KIJUNSEN,y);
     
   
      if(upCloseArrowEnable && tenkan_senValue1 > kijun_sen_Value1 && tenkan_senValue2 <= kijun_sen_Value2 && tenkan_senAbove > kijun_sen_Above)
      { 
      buffer3[i] = iLow(Symbol(),PERIOD_CURRENT, i) - distance *  Point;
      if(i == 0 && IsCrossNewBar() )
      {
         if (SendAlertByNotification) SendNotification((string)Symbol()+" M15 - Bullish TKC: " 
         + DoubleToString(iClose(Symbol(),PERIOD_CURRENT,0),Digits()));
      }
      }
     
   else if(downCloseArrowEnable && tenkan_senValue1 < kijun_sen_Value1 && tenkan_senValue2 >= kijun_sen_Value2 && tenkan_senAbove < kijun_sen_Above)
      
         buffer4[i] = iHigh(Symbol(),PERIOD_CURRENT, i) + distance *  Point;
      if(i == 0 && IsCrossNewBar())
      {
         if (SendAlertByNotification) SendNotification((string)Symbol()+" M15 - Bearish TKC: " 
         + DoubleToString(iClose(Symbol(),PERIOD_CURRENT,0),Digits()));
      }
      
   }   

Ok, so this works as I want it to now, thanks for telling me to use iBarShift :)

Only issue is that I get errors saying: "possible loss of data due to type conversion". It doesn't seem to be a problem as far as i can see. But any ideas on how i could fix it?

 
int y = iBarShift(NULL,PERIOD_H1,Time[i],false);

Because "iBarShift" return an integer type value.

You had better change from "PERIOD_M15" to "PERIOD_CURRENT" because you cannot use this program except 15-minutes time frame.


 
Naguisa Unada:

Because "iBarShift" return an integer type value.

You had better change from "PERIOD_M15" to "PERIOD_CURRENT" because you cannot use this program except 15-minutes time frame.


I'm getting notifications every 15 mins for any pair that has drawn an arrow. 

I can't fix it so I only get one notification per arrow drawn, and not another until a new arrow is drawn on the pair... Any ideas?

I can post whole code if you want

 

Do not double post.

I have deleted your other topic.

Reason: