Store signs

MQL4 Script

Lavoro terminato

Tempo di esecuzione 3 giorni
Feedback del cliente
very professional and fast programmer. Recommended!!!!
Feedback del dipendente
Thanks for giving orders, a pleasure to work with the customer!!!

Specifiche

Hello everyone. I wrote this simple code. I would like to know, if it is possible to store the signals that come out on the graph. If I close the MT4, when I open it again, I would find the old stored signals. I will not use the "for loop", because it rewrites the signals in the historic. Thanks, Max.


//--- indicator settings
#property indicator_chart_window
#property indicator_buffers 2

#property indicator_type1 DRAW_ARROW
#property indicator_width1 1
#property indicator_color1 Green

#property indicator_type2 DRAW_ARROW
#property indicator_width2 1
#property indicator_color2 Yellow


extern int Ritardo_Secondi=10;

datetime time_alert; //used when sending alert
//--- indicator buffers
double Buffer1[];
double Buffer2[];

int Period1=2;
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int OnInit()
  {

   IndicatorBuffers(2);
   SetIndexBuffer(0,Buffer1);
   SetIndexEmptyValue(0,0);
   SetIndexArrow(0,108);
   SetIndexBuffer(1,Buffer2);
   SetIndexEmptyValue(1,0);
   SetIndexArrow(1,108);

   return(INIT_SUCCEEDED);
  }
//________________________________

int OnCalculate(const int rates_total,
                const int prev_calculated,
                const datetime &time[],
                const double &open[],
                const double &high[],
                const double &low[],
                const double &close[],
                const long &tick_volume[],
                const long &volume[],
                const int &spread[])
  {
   int i=0;

   if(Buffer1[i]!=0)
     {
      Buffer1[i]=Low[i]-10*Point();
     }

   if(Buffer2[i]!=0)
     {
      Buffer2[i]=High[i]+10*Point();
     }

   static datetime BarStart=0;
   static bool check=false;
   if(BarStart!=Time[2]+Period()*120)
     {
      BarStart=Time[2]+Period()*120;
      check=true;
     }

   if(check && TimeCurrent()>=Time[2]+Period()*120+Ritardo_Secondi)
     {
      check=false;
      //Inserisci condizioni

      //Indicator Buffer 1
      if(iRSI(NULL,PERIOD_CURRENT,Period1,PRICE_CLOSE,0)<40

         )
        {
         Buffer1[0]=Low[0]-10*Point();
        }

      //Indicator Buffer 2
      if(iRSI(NULL,PERIOD_CURRENT,Period1,PRICE_CLOSE,0)>60

         )
        {
         Buffer2[0]=High[0]+10*Point();
        }

     }

   return(rates_total);
  }
//-----------------------------------------------------------------------------------------------------------------------------

If I close the MT4 at this time, when I open it again I have to find the same situation

Picture 1


and NOT one presented in picture 2

Picture 2




Con risposta

1
Sviluppatore 1
Valutazioni
(803)
Progetti
1123
43%
Arbitraggio
47
49% / 23%
In ritardo
84
7%
Gratuito
2
Sviluppatore 2
Valutazioni
(103)
Progetti
205
41%
Arbitraggio
17
29% / 71%
In ritardo
45
22%
Gratuito
3
Sviluppatore 3
Valutazioni
(41)
Progetti
72
8%
Arbitraggio
18
11% / 56%
In ritardo
18
25%
Gratuito
4
Sviluppatore 4
Valutazioni
(1)
Progetti
2
0%
Arbitraggio
1
0% / 100%
In ritardo
0
Gratuito
5
Sviluppatore 5
Valutazioni
(772)
Progetti
1039
44%
Arbitraggio
50
8% / 50%
In ritardo
116
11%
Gratuito
6
Sviluppatore 6
Valutazioni
(71)
Progetti
156
44%
Arbitraggio
22
41% / 14%
In ritardo
16
10%
Gratuito
Pubblicati: 10 codici
7
Sviluppatore 7
Valutazioni
(91)
Progetti
144
38%
Arbitraggio
67
15% / 48%
In ritardo
55
38%
Gratuito

Informazioni sul progetto

Budget
10 - 15 USD
Scadenze
da 2 a 5 giorno(i)