Complete my multi--timeframe-multi-currency-indicator (easy for a coder)

MQL4 Indicadores

Trabalho concluído

Tempo de execução 2 minutos

Termos de Referência

Hi coders,

I coded a matrix-indicator which checks if the last closed bar is a pinbar which is simply defined as a bar with a 75% shadow. This checks are made in all timeframes and all currency pairs. It works fine and has just one small bug: the indicator checks all currencies and all timeframes with every tick. And that is wasting much computer calculation time. I want that the M5 timeframe will only be checked at the open of a new M5 bar, the same with all other timeframes. So if I want to check the M1 chart, the indicator's fastest refresh-rate should be once a minute.

According to that I want an Alert to be displayed when conditions are met. At the moment the Alerts are based on Time[0] and I know that is wrong because the bar in the corresponding timeframe has to be checked and not the bar which is displayed in the current chart.

I think every coder will solve this problem within some minutes but I am a beginner and I am still very poor in MQL4-specific data types, syntax and structure.

Here is my code:

//+------------------------------------------------------------------+
//|                                               Pinbar-Scanner.mq4 |
//|                                               Copyright 2013, MR |
//|                                                                  |
//+------------------------------------------------------------------+
#property copyright "Copyright 2013, MR"
#property link      ""

#property indicator_chart_window

extern bool M1  = true;
extern bool M5  = true;
extern bool M15 = true;
extern bool M30 = true;
extern bool H1  = true;
extern bool H4  = true;
extern bool D1  = true;
extern bool W1  = true;

string Timeframe[];
int TimeframeNo[];
string CurrPair[] = {"AUDCAD", "AUDCHF", "AUDJPY", "AUDNZD", "AUDUSD", "CADCHF", "CHFJPY", "EURAUD",
                     "EURCAD", "EURCHF", "EURGBP", "EURJPY", "EURNZD", "EURUSD", "GBPAUD", "GBPCAD",
                     "GBPCHF", "GBPJPY", "GBPNZD", "GBPUSD", "NZDJPY", "NZDUSD", "USDCAD", "USDCHF",
                     "USDJPY"};
color col;
bool PinbarLong, PinbarShort;
int dist_X, dist_Y, i, j;
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
  
//---- Arrays population ----
   if (M1)
   {
      ArrayResize(Timeframe, ArraySize(Timeframe)+1);
      Timeframe[ArraySize(Timeframe)-1]="M1";
      ArrayResize(TimeframeNo, ArraySize(TimeframeNo)+1);
      TimeframeNo[ArraySize(TimeframeNo)-1]=PERIOD_M1;
   }
   if (M5)
   {
      ArrayResize(Timeframe, ArraySize(Timeframe)+1);
      Timeframe[ArraySize(Timeframe)-1]="M5";
      ArrayResize(TimeframeNo, ArraySize(TimeframeNo)+1);
      TimeframeNo[ArraySize(TimeframeNo)-1]=PERIOD_M5;
   }
   if (M15)
   {
      ArrayResize(Timeframe, ArraySize(Timeframe)+1);
      Timeframe[ArraySize(Timeframe)-1]="M15";
      ArrayResize(TimeframeNo, ArraySize(TimeframeNo)+1);
      TimeframeNo[ArraySize(TimeframeNo)-1]=PERIOD_M15;
   }
   if (M30)
   {
      ArrayResize(Timeframe, ArraySize(Timeframe)+1);
      Timeframe[ArraySize(Timeframe)-1]="M30";
      ArrayResize(TimeframeNo, ArraySize(TimeframeNo)+1);
      TimeframeNo[ArraySize(TimeframeNo)-1]=PERIOD_M30;
   }
   if (H1)
   {
      ArrayResize(Timeframe, ArraySize(Timeframe)+1);
      Timeframe[ArraySize(Timeframe)-1]="H1";
      ArrayResize(TimeframeNo, ArraySize(TimeframeNo)+1);
      TimeframeNo[ArraySize(TimeframeNo)-1]=PERIOD_H1;
   }
   if (H4)
   {
      ArrayResize(Timeframe, ArraySize(Timeframe)+1);
      Timeframe[ArraySize(Timeframe)-1]="H4";
      ArrayResize(TimeframeNo, ArraySize(TimeframeNo)+1);
      TimeframeNo[ArraySize(TimeframeNo)-1]=PERIOD_H4;
   }
   if (D1)
   {
      ArrayResize(Timeframe, ArraySize(Timeframe)+1);
      Timeframe[ArraySize(Timeframe)-1]="D1";
      ArrayResize(TimeframeNo, ArraySize(TimeframeNo)+1);
      TimeframeNo[ArraySize(TimeframeNo)-1]=PERIOD_D1;
   }
   if (W1)
   {
      ArrayResize(Timeframe, ArraySize(Timeframe)+1);
      Timeframe[ArraySize(Timeframe)-1]="W1";
      ArrayResize(TimeframeNo, ArraySize(TimeframeNo)+1);
      TimeframeNo[ArraySize(TimeframeNo)-1]=PERIOD_W1;
   }

//---- Timeframe Objects ----
   dist_X = 80;
   for(i=0; i<=ArrayRange(Timeframe,0)-1; i++)
   {
      if (ObjectFind(Timeframe[i]+"txt") == -1)
      {
         ObjectCreate(Timeframe[i]+"txt", OBJ_LABEL, 0, 0, 0);
         ObjectSet(Timeframe[i]+"txt", OBJPROP_CORNER, 0);
         ObjectSet(Timeframe[i]+"txt", OBJPROP_XDISTANCE, dist_X);
         ObjectSet(Timeframe[i]+"txt", OBJPROP_YDISTANCE, 0);
         ObjectSetText(Timeframe[i]+"txt", Timeframe[i], 9, "Calibri", White);
         dist_X = dist_X+40;     
      }
   }
   
//---- Currency pairs objects ----
   dist_Y = 30;
   for(i=0; i<=ArrayRange(CurrPair,0)-1; i++)
   {
      if (ObjectFind(CurrPair[i]+"txt") == -1)
      {
         ObjectCreate(CurrPair[i]+"txt", OBJ_LABEL, 0, 0, 0);
         ObjectSet(CurrPair[i]+"txt", OBJPROP_CORNER, 0);
         ObjectSet(CurrPair[i]+"txt", OBJPROP_XDISTANCE, 0);
         ObjectSet(CurrPair[i]+"txt", OBJPROP_YDISTANCE, dist_Y);
         ObjectSetText(CurrPair[i]+"txt", CurrPair[i], 9, "Calibri", White);
         dist_Y = dist_Y+17;     
      }
   }
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function                       |
//+------------------------------------------------------------------+
int deinit()
  {
//----
   ObjectsDeleteAll();
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int start()
  {
   static datetime Time0;

//---- Dot matrix ----   
   dist_X=80;
   dist_Y=4;
   for(j=0; j<=ArrayRange(Timeframe,0)-1; j++)
   {
      for(i=0; i<=ArrayRange(CurrPair,0)-1; i++)
      {
         ObjectCreate(CurrPair[i]+Timeframe[j], OBJ_LABEL, 0, 0, 0);
         ObjectSet(CurrPair[i]+Timeframe[j], OBJPROP_CORNER, 0);
         ObjectSet(CurrPair[i]+Timeframe[j], OBJPROP_XDISTANCE, dist_X);
         ObjectSet(CurrPair[i]+Timeframe[j], OBJPROP_YDISTANCE, dist_Y);
         
//-- Conditions --
         PinbarLong =   MathMin(iOpen(CurrPair[i], TimeframeNo[j], 1),iClose(CurrPair[i], TimeframeNo[j], 1))-
                        iLow(CurrPair[i], TimeframeNo[j], 1)
                        >= (iHigh(CurrPair[i], TimeframeNo[j], 1)-iLow(CurrPair[i], TimeframeNo[j], 1))*0.75;
         
         PinbarShort =  iHigh(CurrPair[i], TimeframeNo[j], 1)-
                        MathMax(iOpen(CurrPair[i], TimeframeNo[j], 1),iClose(CurrPair[i], TimeframeNo[j], 1))
                        >= (iHigh(CurrPair[i], TimeframeNo[j], 1)-iLow(CurrPair[i], TimeframeNo[j], 1))*0.75;
         
//--  Alert --          
         if (PinbarLong)
         {
            col=Lime;
            if (Time0 != Time[0])
            {
               Alert(CurrPair[i]+" "+Timeframe[j]+" Pinbar Long");
               Time0 = Time[0];
            }
         }
         else if (PinbarShort)
         {
            col=Red;
            if (Time0 != Time[0])
            {
               Alert(CurrPair[i]+" "+Timeframe[j]+" Pinbar Short");
               Time0 = Time[0];
            }
         }
         else
         {
            col=Gray;
         }
         
//-- Dot Matrix --
         ObjectSetText(CurrPair[i]+Timeframe[j], "-", 35, "Calibri", col);   
         dist_Y = dist_Y+17;
      }
      dist_Y=4;
      dist_X=dist_X+40;     
   }
   WindowRedraw();
//----
   return(0);
  }
//+------------------------------------------------------------------+

If you would like to complete my code, please tell me what price it will be.

Thank you!

PS: If you attach this indicator to your chart, please set all chart colors to "None".

Respondido

1
Desenvolvedor 1
Classificação
(118)
Projetos
201
42%
Arbitragem
44
9% / 68%
Expirado
47
23%
Livre
Pedidos semelhantes
EA DEJA FABRIQUE ? MODIFIER QUELQUE LIGNE POUR LE RENDRE RENTABLE /////////////////////++++++++++++++++++++++++++++++++++ EA AVEC UN SYTEME SIMPLE ; SEULEMENT A MODIFIER %%%%%%%%%%%%%%%%%% SI PERSONNE SACHANT CODER CORRECTEMENT , CE TRAVAIL EST POUR TOI
Buy an sell symbols and guide showing entry to buy or sell setups and I need it gives and tell me to enter buy or to enter sell by automation nnnnnnnnnn fgggghhuuuiijh hhrddfhuuufffff yygggg hhgt hiidcb hygdfbby gyytdv uttrdd. Httdd hyyydv. Yhygf. Uu juhgff uyttt uuuytdbhy uuuyyy hhhff jjueeiivhgffdgu hyuu7trg yyyyffj yyytd u6tttf uuyrrrhi uytrrfh utterly jyrfgkkttv uhyybhhyy hytfgivuyt utfbh utghjio7t. Uuytg uytru
Utilizing the MQL5 MetaEditor Wizard, I created an Expert Advisor, having the following Signal indicators: I was able to optimize the EA and reached a backtest with the following specifications: I was able to reach a profit level of 30K, as indicated below. However, the Bot is not without faults and following the backtest, I started a forward test with real live data and the results were not so great. The EA took a
Connect from Mt5 via binary deriv account api I have mt5 indicator, need to connect with binary deriv account through api. If anyone can setup via API then contact me. everything control mt5
Hello I am looking for a developer to create an 50% retracement Indicator of the previous candle . So once a candle close the Indicator is supposed to take the full candle size from high to low and make a 61% and 50% level on that candle and I would like the candle to show until the next previous candle is done creating. After this I would look to create an ea with it possibly
Hi, I have 2 indicators which are based on the super trend , the alerts on indicator (1) does not work at all , and on the other indicator the alerts do not come on time on time, which is kind of delayed. see attached file below
Looking for an experienced developer to modify my existing TDI strategy , want to add filter for Buy and Sell Signals, Arrows are displayed on chart and what only to leave high accurate arrows Source code to be provided
I have the mq5 file, I need a buffer adding to the indicator, so it appears in the data window so I can reference it later in an EA. As the below screenshot shows, there is a median ray line from yesterday (the dashed horizontal line) - I want this value in the data window called Median Ray. I want this to be a single value per day, so todays Median Ray would be 17868, and so on each day. So I want all the Developing
I would like to develop my own indicator on metatrader 4 and tradingview. We would start with a basic version that we would improve later. It is an indicator based on several analyses and which would provide several indications. I am looking for someone who can develop on MT4 and Mt5, initially I would like to do it on mt4 and then on mt5. If you have expertise in pinescript it is a plus because I would like to
I urgently require swift assistance to convert a complex indicator into a fully functional scanner, capable of automatically sending real-time data, alerts, and notifications via email, ensuring seamless integration and prompt delivery of critical information to facilitate informed decision-making and timely action

Informações sobre o projeto

Orçamento
10 - 30 USD
IVA (19%): 1.9 - 5.7 USD
Total: 11.9 - 35.7 USD
Desenvolvedor
9 - 27 USD