Download MetaTrader 5
To add comments, please log in or register
One billion tasks have already been executed with MQL5 Cloud Network. Test trading robots even faster!
al0660692
6
al0660692 2016.05.23 16:51 

 I am newbee

sorry for my english...

I am writing a code but dont work properly... Please, is you can help me I'll apreciate.

 

Thanks. 

//+------------------------------------------------------------------+

//|                                                      MrmRes2.mq4 |

//|                        Copyright 2016, MetaQuotes Software Corp. |

//|                                             https://www.mql5.com |

//+------------------------------------------------------------------+

#property copyright "Copyright 2016, MetaQuotes Software Corp."

#property link      "https://www.mql5.com"

#property version   "1.00"

#property strict

#property indicator_chart_window

#property indicator_buffers 6

#property indicator_plots   6

//--- plot Resistencia1

#property indicator_label1  "Resistencia1"

#property indicator_type1   DRAW_LINE

#property indicator_color1  clrRed

#property indicator_style1  STYLE_SOLID

#property indicator_width1  1

//--- plot Soporte1

#property indicator_label2  "Soporte1"

#property indicator_type2   DRAW_LINE

#property indicator_color2  clrBlue

#property indicator_style2  STYLE_SOLID

#property indicator_width2  1

//--- plot Resistencia2

#property indicator_label3  "Resistencia2"

#property indicator_type3   DRAW_LINE

#property indicator_color3  clrRed

#property indicator_style3  STYLE_SOLID

#property indicator_width3  1

//--- plot Soporte2

#property indicator_label4  "Soporte2"

#property indicator_type4   DRAW_LINE

#property indicator_color4  clrBlue

#property indicator_style4  STYLE_SOLID

#property indicator_width4  1

//--- plot Resistencia3

#property indicator_label5  "Resistencia3"

#property indicator_type5   DRAW_LINE

#property indicator_color5  clrRed

#property indicator_style5  STYLE_SOLID

#property indicator_width5  1

//--- plot Soporte3

#property indicator_label6  "Soporte3"

#property indicator_type6   DRAW_LINE

#property indicator_color6  clrBlue

#property indicator_style6  STYLE_SOLID

#property indicator_width6  1

//--- indicator buffers

double         Resistencia1Buffer[];

double         Soporte1Buffer[];

double         Resistencia2Buffer[];

double         Soporte2Buffer[];

double         Resistencia3Buffer[];

double         Soporte3Buffer[];

int i;

int limit;

extern color SupportColor = SlateBlue;

extern color ResistanceColor = DarkOrange;

//+------------------------------------------------------------------+

//| Custom indicator initialization function                         |

//+------------------------------------------------------------------+

int OnInit()

  {

//--- indicator buffers mapping

   SetIndexBuffer(0,Resistencia1Buffer);

   SetIndexBuffer(1,Soporte1Buffer);

   SetIndexBuffer(2,Resistencia2Buffer);

   SetIndexBuffer(3,Soporte2Buffer);

   SetIndexBuffer(4,Resistencia3Buffer);

   SetIndexBuffer(5,Soporte3Buffer);

   

  

 

//---

   return(INIT_SUCCEEDED);

  }

//+------------------------------------------------------------------+

//| Custom indicator iteration function                              |

//+------------------------------------------------------------------+

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[])

  {





   

   

   //Flip(Bars-1);

     Flip();



   return(rates_total);

  }

//+------------------------------------------------------------------+

void Flip()

                       {

            Soporte1Buffer[0] = Soporte1Buffer[ 1];

            Resistencia1Buffer[0] = Resistencia1Buffer[ 1];

            Soporte2Buffer[0] = Soporte2Buffer[ 1];

            Resistencia2Buffer[0] = Resistencia2Buffer[ 1];

            Soporte3Buffer[0] = Soporte3Buffer[ 1];

            Resistencia3Buffer[0] = Resistencia3Buffer[ 1];

          

          

            

if (iHigh("AUDUSD",PERIOD_D1,1) <iHigh("AUDUSD",PERIOD_D1,3) &&iHigh("AUDUSD",PERIOD_D1,2) <iHigh("AUDUSD",PERIOD_D1,3) &&

                   iHigh("AUDUSD",PERIOD_D1,3) > iHigh("AUDUSD",PERIOD_D1,4) && iHigh("AUDUSD",PERIOD_D1,3) > iHigh("AUDUSD",PERIOD_D1,5))

                Resistencia1Buffer[0]=iHigh("AUDUSD",PERIOD_D1,3);

                

           if (iLow("AUDUSD",PERIOD_D1,1) >iLow("AUDUSD",PERIOD_D1,3) &&iLow("AUDUSD",PERIOD_D1,2) >iLow("AUDUSD",PERIOD_D1,3) &&

                   iLow("AUDUSD",PERIOD_D1,3) < iLow("AUDUSD",PERIOD_D1,4) && iLow("AUDUSD",PERIOD_D1,3)  <iLow("AUDUSD",PERIOD_D1,5))

                      Soporte1Buffer[0]=iLow("AUDUSD",PERIOD_D1,3);

                         

                         

                         

                        if (iHigh("AUDUSD",PERIOD_W1,1) <iHigh("AUDUSD",PERIOD_W1,3) &&iHigh("AUDUSD",PERIOD_W1,2) <iHigh("AUDUSD",PERIOD_W1,3) &&

                   iHigh("AUDUSD",PERIOD_W1,3) > iHigh("AUDUSD",PERIOD_W1,4) && iHigh("AUDUSD",PERIOD_W1,3) > iHigh("AUDUSD",PERIOD_W1,5))

              Resistencia2Buffer[0]=iHigh("AUDUSD",PERIOD_W1,3);

                

           if (iLow("AUDUSD",PERIOD_W1,1) >iLow("AUDUSD",PERIOD_W1,3) &&iLow("AUDUSD",PERIOD_W1,2) >iLow("AUDUSD",PERIOD_W1,3) &&

                   iLow("AUDUSD",PERIOD_W1,3) < iLow("AUDUSD",PERIOD_W1,4) && iLow("AUDUSD",PERIOD_W1,3)  <iLow("AUDUSD",PERIOD_W1,5))

                     Soporte2Buffer[0]=iLow("AUDUSD",PERIOD_W1,3);

                        

                        

                        

                        if (iHigh("AUDUSD",PERIOD_MN1,1) <iHigh("AUDUSD",PERIOD_MN1,3) &&iHigh("AUDUSD",PERIOD_MN1,2) <iHigh("AUDUSD",PERIOD_MN1,3) &&

                   iHigh("AUDUSD",PERIOD_MN1,3) > iHigh("AUDUSD",PERIOD_MN1,4) && iHigh("AUDUSD",PERIOD_MN1,3) > iHigh("AUDUSD",PERIOD_MN1,5))

              Resistencia3Buffer[0]=iHigh("AUDUSD",PERIOD_MN1,3);

                

           if (iLow("AUDUSD",PERIOD_MN1,1) >iLow("AUDUSD",PERIOD_MN1,3) &&iLow("AUDUSD",PERIOD_MN1,2) >iLow("AUDUSD",PERIOD_MN1,3) &&

                   iLow("AUDUSD",PERIOD_MN1,3) < iLow("AUDUSD",PERIOD_MN1,4) && iLow("AUDUSD",PERIOD_MN1,3)  <iLow("AUDUSD",PERIOD_MN1,5))

                      Soporte3Buffer[0]=iLow("AUDUSD",PERIOD_MN1,3);

                      

                      

                       //Resistencia2Buffer[0] = iHighest(0,PERIOD_W1,MODE_HIGH,5,2);

      //Soporte2Buffer[0] = iLowest(0,PERIOD_W1,MODE_LOW,5,2);

      

                      Alert("Resistencia1 "+Resistencia1Buffer[0]);

                      Alert("Resistencia2 "+Resistencia2Buffer[0]);

                      Alert("Resistencia3 "+Resistencia3Buffer[0]);

                      Alert(Soporte1Buffer[0]);

                       Alert(Soporte2Buffer[0]);

                        Alert(Soporte3Buffer[0]);

}       

Fernando Carreiro
1439
Fernando Carreiro 2016.05.23 16:54  

Please EDIT your post and use the SRC button to place your source code (or attach the file it if it is large).

whroeder1
13602
whroeder1 2016.05.23 17:08  
al0660692: I am writing a code but dont work properly...
  1. Don't paste code
    Play video
    Please edit your post.
    For large amounts of code, attach it.

  2. "Doesn't work" is meaningless - just like saying the car doesn't work. Doesn't start, won't go in gear, no electrical, missing the key, flat tires - meaningless. There are no mind readers here.
/
To add comments, please log in or register