Download MetaTrader 5
To add comments, please log in or register
Interested in earning money via MQL5 Cloud Network? Enter your profile!
reza rahmad
2744
reza rahmad 2014.10.14 13:12 

empty buffer

help me i make indicator and now i have empty buffer....how to fill it

if(limit>barsToProcess)
      limit=barsToProcess;

   for(int i=0;i<limit;i++)
     {
      double UP=iEnvelopes(NULL,0,14,MODE_SMA,0,PRICE_CLOSE,0.1,MODE_UPPER,0);
      double DN=iEnvelopes(NULL,0,14,MODE_SMA,0,PRICE_CLOSE,0.1,MODE_LOWER,0);
      double main5=iStochastic(NULL,PERIOD_M5,14,3,3,MODE_SMMA,0,MODE_MAIN,i);
      double signal5=iStochastic(NULL,PERIOD_M5,14,3,3,MODE_SMMA,0,MODE_SIGNAL,i);
      double fu = iFractals(NULL,PERIOD_M5,MODE_UPPER,i+3);
      double fd = iFractals(NULL,PERIOD_M5,MODE_LOWER,i+3);
      double ma20= iMA(NULL,PERIOD_M5,20,0,MODE_SMA,PRICE_CLOSE,0);
      double ma5 = iMA(NULL,PERIOD_M5,5,0,MODE_SMA,PRICE_CLOSE,0);
      RefreshRates();

      ExtMapBuffer1[i]= EMPTY_VALUE;
      ExtMapBuffer2[i]= EMPTY_VALUE;


//buy
if(main5>signal5 && High[0]> ma5)
        {
         ExtMapBuffer1[i]=((Close[i+1]+Close[i])/2);
         values=1;
        }
     
//sell
if(main5<signal5 && Low[0]<ma5)
        {
         ExtMapBuffer2[i]=((Close[i+1]+Close[i])/2);
         values=2;
        }
Carl Schreiber
5960
Carl Schreiber 2014.10.14 13:25  

1) clean your code: you have a mixture of 0 and i, = is the actual bar, i ranges from e.g. 43000 .. 0.

2) EMPTY_VALUE is 2 147 483 647 it is just not drawn, so there is no signal neither by nor sell: EMPTY_VALUE

reza rahmad
2744
reza rahmad 2014.10.14 15:13  
gooly:

1) clean your code: you have a mixture of 0 and i, = is the actual bar, i ranges from e.g. 43000 .. 0.

2) EMPTY_VALUE is 2 147 483 647 it is just not drawn, so there is no signal neither by nor sell: EMPTY_VALUE


i forget about the looping FOR....so how to fix it sire need help
/
To add comments, please log in or register