HELP !!!! convert an indicator from MT4 to MT5. - page 9

 
o_o:

Code runs in MT4/5

Pay It Forward

Olexiy Polyakov:

People help plyz remake round number level indicator from MT4 under MT5.

I can't afford to pay for the work. If you have a kind person, I will be very grateful.


The indicatorKey_Levels.mq5, I have tried it. It works in mq4 and mq5. It is very comfortable, you need only to change the file extension. However, when it is removed from the chart, the indicator does not remove all horizontal lines drawn by it. I had to add the following code to mq4:

void OnDeinit(const int reason){ Comment(""); ObjectsDeleteAll(0,"Round"); }
 

Hi all. Please help redo the indicator, my brain is too stupid for such a task (indicator shows currency pair name and time frame on the back of the chart.)

p.s. the text font is"impact"

thanks in advance :)

//+------------------------------------------------------------------+
//|                                                    Watermark.mq4 |
//|                                          Copyright © M00SE  2011 |
//|                                                                  |
//|                      W A T E R M A R K                           |
//|                                                                  |
//| This indicator will display a symbol watermark on the chart      |
//| background, showing the timeframe and symbol name in large font. |
//|                                                                  |
//| Version 1 - 16 Jun 2011                                          |
//|                                                                  |
//|                                                                  |
//| Instructions                                                     |
//|                                                                  |
//| Choose the symbol you're interested in and display it in a chart |
//| window at the appropriate timeframe. Load the Watermark          |
//| indicator and optionally choose font, size, colour, position etc.|
//| Additionally you may choose to add some custom text of your own, |
//| eg. web link, email address etc. in a tag field.                 |
//|                                                                  |
//| That's it!                                                       |
//| Hope you like it, MOOSE.                                         |
//|                                                                  |
//+------------------------------------------------------------------+

#property copyright "Copyright © M00SE  2011"

#property indicator_chart_window

//---- input parameters
extern int sidFontSize = 140;
extern string sidFontName = "Ariel";
extern string NoteRedGreenBlue = "Red/Green/Blue each 0..255";
extern int sidRed = 30;
extern int sidGreen = 30;
extern int sidBlue = 30;
extern int sidXPos = 30;
extern int sidYPos = 150;

extern bool tagDisplayText = true;
extern string tagText = "[Your Name Here]";
extern int tagFontSize = 20;
extern string tagFontName = "Tahoma";
extern int tagRed = 60;
extern int tagGreen = 30;
extern int tagBlue = 60;
extern int tagXPos = 600;
extern int tagYPos = 550;

//---- data
string SID = "Symbol";
int sidRGB = 0;
string TAG = "Tag";
int tagRGB = 0;
string tf;

//+------------------------------------------------------------------+
//| expert initialization function                                   |
//+------------------------------------------------------------------+
int init()
  {
//----

   switch(Period())
     {  
      case PERIOD_D1:
         tf="d1";
         break;
      case PERIOD_H1:
         tf="h1";
         break;
      case PERIOD_H4:
         tf="h4";
         break;
      case PERIOD_M1:
         tf="m1";
         break;
      case PERIOD_M15:
         tf="m15";
         break;
      case PERIOD_M30:
         tf="m30";
         break;
      case PERIOD_M5:
         tf="m5";
         break;
      case PERIOD_MN1:
         tf="mn1";
         break;
      case PERIOD_W1:
         tf="w1";
         break;
      default:
         tf="Unknown";
         break;
     }

     if(tagRed > 255 || tagGreen > 255  || tagBlue > 255 || sidRed > 255 || sidGreen > 255 || sidBlue > 255)
     {
       Alert("Watermark Red/Green/Blue components must each be in range 0..255");
     }   

     tagRGB = (tagBlue << 16); 
     tagRGB |= (tagGreen << 8);
     tagRGB |= tagRed;

     sidRGB = (sidBlue << 16); 
     sidRGB |= (sidGreen << 8);
     sidRGB |= sidRed;
      
//----
   return(0);
  }

//+------------------------------------------------------------------+
//| expert deinitialization function                                 |
//+------------------------------------------------------------------+
int deinit()
  {
//----

   ObjectDelete(SID);
   ObjectDelete(TAG);
   
//----
   return(0);
  }

//+------------------------------------------------------------------+
//| expert start function                                            |
//+------------------------------------------------------------------+
int start()
{
   double chartHi, chartLo;
   double range;
   static double prevRange;
   
   chartHi = WindowPriceMax(0);
   chartLo = WindowPriceMin(0);
   range = chartHi - chartLo;

   // need only draw the watermark if the chart range has changed
   if(prevRange != range)
   {
      deinit();
      prevRange = range;
   
      watermark(SID, tf + Symbol(), sidFontSize, sidFontName, sidRGB, sidXPos, sidYPos);
      if(tagDisplayText && StringLen(tagText) > 0)
      {
         watermark(TAG, tagText, tagFontSize, tagFontName, tagRGB, tagXPos, tagYPos); 
      }
   }   
   return(0);
}

void watermark(string obj, string text, int fontSize, string fontName, color colour, int xPos, int yPos)
{
      ObjectCreate(obj, OBJ_LABEL, 0, 0, 0); 
      ObjectSetText(obj, text, fontSize, fontName, colour);
      ObjectSet(obj, OBJPROP_CORNER, 0); 
      ObjectSet(obj, OBJPROP_XDISTANCE, xPos); 
      ObjectSet(obj, OBJPROP_YDISTANCE, yPos);
      ObjectSet(obj, OBJPROP_BACK, true);
}
 

guys help me redo the indicator on mt5 please how many times I tried it, no way, I would be grateful for life)

 

Help to convert MTF Fractal MQL4 indicator to MQL 5


//+------------------------------------------------------------------+
//|                                                  MTF Fractal.mq4 |
//|                                         Copyright © 2014, TrueTL |
//|                                            http://www.truetl.com |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2014, TrueTL"
#property link      "http://www.truetl.com"
#property version "1.40"
#property indicator_chart_window
#property indicator_buffers 2

extern string  Version_140                      = "www.truetl.com";
extern int     Fractal_Timeframe                = 0;
extern int     Maxbar                           = 2000;
extern color   Up_Fractal_Color                 = Red;
extern int     Up_Fractal_Symbol                = 108;
extern color   Down_Fractal_Color               = Blue;
extern int     Down_Fractal_Symbol              = 108;
extern bool    Extend_Line                      = true;
extern bool    Extend_Line_to_Background        = true;
extern bool    Show_Validation_Candle           = true;
extern color   Up_Fractal_Extend_Line_Color     = Red;
extern int     Up_Fractal_Extend_Width          = 0;
extern int     Up_Fractal_Extend_Style          = 2;
extern color   Down_Fractal_Extend_Line_Color   = Blue;
extern int     Down_Fractal_Extend_Width        = 0;
extern int     Down_Fractal_Extend_Style        = 2;

double UpBuffer[], DoBuffer[], refchk, tempref, level;
int barc;

//+------------------------------------------------------------------+
//|                                                             INIT |
//+------------------------------------------------------------------+

int init() {

   SetIndexBuffer(0,UpBuffer);
   SetIndexStyle(0,DRAW_ARROW, DRAW_ARROW, 0, Up_Fractal_Color);
   SetIndexArrow(0,Up_Fractal_Symbol);
   SetIndexBuffer(1,DoBuffer);
   SetIndexStyle(1,DRAW_ARROW, DRAW_ARROW, 0, Down_Fractal_Color);
   SetIndexArrow(1,Down_Fractal_Symbol);
   
   return(0);
}

//+------------------------------------------------------------------+
//|                                                           DEINIT |
//+------------------------------------------------------------------+

int deinit() {
   for (int i = ObjectsTotal(); i >= 0; i--) {
      if (StringSubstr(ObjectName(i),0,12) == "MTF_Fractal_") {
         ObjectDelete(ObjectName(i));
      }
   }
   
   return(0);
}

//+------------------------------------------------------------------+
//|                                                            START |
//+------------------------------------------------------------------+

int start() {
   int i, c, dif;
   tempref =   iHigh(Symbol(), Fractal_Timeframe, 1) + 
               iHigh(Symbol(), Fractal_Timeframe, 51) + 
               iHigh(Symbol(), Fractal_Timeframe, 101);
   
   if (barc != Bars || IndicatorCounted() < 0 || tempref != refchk) {
      barc = Bars;
      refchk = tempref;
   } else
      return(0);
   
   deinit();
   
   if (Fractal_Timeframe <= Period()) Fractal_Timeframe = Period();
   
   dif = Fractal_Timeframe/Period();
   
   if (Maxbar > Bars) Maxbar = Bars-10;
   
   for(i = 0; i < Maxbar; i++) {
      if (iBarShift(NULL,Fractal_Timeframe,Time[i]) < 3) {
         UpBuffer[i] = 0;
         DoBuffer[i] = 0;
         continue;
      }
      UpBuffer[i] = iFractals(NULL,Fractal_Timeframe,1,iBarShift(NULL,Fractal_Timeframe,Time[i]));
      DoBuffer[i] = iFractals(NULL,Fractal_Timeframe,2,iBarShift(NULL,Fractal_Timeframe,Time[i]));
   }
   
   if (Extend_Line) {
      for(i = 0; i < Maxbar; i++) {
         if (UpBuffer[i] > 0) {
            level = UpBuffer[i];
            for (c = i; c > 0; c--) {
               if ((Open[c] < level && Close[c] > level) || (Open[c] > level && Close[c] < level)) 
                  break;
               if (Open[c] <= level && Close[c] <= level && Open[c-1] >= level && Close[c-1] >= level) 
                  break;
               if (Open[c] >= level && Close[c] >= level && Open[c-1] <= level && Close[c-1] <= level) 
                  break;
            }
            DrawLine ("H", i, c, level, Extend_Line_to_Background, Up_Fractal_Extend_Line_Color, Up_Fractal_Extend_Width, Up_Fractal_Extend_Style);
            if (Show_Validation_Candle) UpBuffer[i-2*dif] = level;
            i += dif;         
         }
      }
      
      for(i = 0; i < Maxbar; i++) {
         if (DoBuffer[i] > 0) {
            level = DoBuffer[i];
            for (c = i; c > 0; c--) {
               if ((Open[c] < level && Close[c] > level) || (Open[c] > level && Close[c] < level)) 
                  break;
               if (Open[c] <= level && Close[c] <= level && Open[c-1] >= level && Close[c-1] >= level) 
                  break;
               if (Open[c] >= level && Close[c] >= level && Open[c-1] <= level && Close[c-1] <= level) 
                  break;
            }
            DrawLine ("L", i, c, level, Extend_Line_to_Background, Down_Fractal_Extend_Line_Color, Down_Fractal_Extend_Width, Down_Fractal_Extend_Style);
            if (Show_Validation_Candle) DoBuffer[i-2*dif] = level;
            i += dif;
         }
      }
   }
   
   return(0);
}
//+------------------------------------------------------------------+
//|                                                        DRAW LINE |
//+------------------------------------------------------------------+

void DrawLine (string dir, int i, int c, double lev, bool back, color col, int width, int style) {
   ObjectCreate("MTF_Fractal_"+dir+i,OBJ_TREND,0,0,0,0,0);
   ObjectSet("MTF_Fractal_"+dir+i,OBJPROP_TIME1,iTime(Symbol(),Period(),i));
   ObjectSet("MTF_Fractal_"+dir+i,OBJPROP_PRICE1,lev);
   ObjectSet("MTF_Fractal_"+dir+i,OBJPROP_TIME2,iTime(Symbol(),Period(),c));
   ObjectSet("MTF_Fractal_"+dir+i,OBJPROP_PRICE2,lev);
   ObjectSet("MTF_Fractal_"+dir+i,OBJPROP_RAY,0);
   ObjectSet("MTF_Fractal_"+dir+i,OBJPROP_BACK,back);
   ObjectSet("MTF_Fractal_"+dir+i,OBJPROP_COLOR,col);
   ObjectSet("MTF_Fractal_"+dir+i,OBJPROP_WIDTH,width);
   ObjectSet("MTF_Fractal_"+dir+i,OBJPROP_STYLE,style);
}
 

Hello.

If you can, and unless it would be too much trouble, please re-do the mt5 indicator from this post https://www.mql5.com/ru/code/15437

Engulfing
Engulfing
  • votes: 11
  • 2016.05.13
  • Vladimir Mametov
  • www.mql5.com
Индикатор отображается на ценовом графике в виде стрелок красного и зеленого цвета. Индикатор в первую очередь может быть полезен для трейдеров, использующих в своей работе свечной анализ. Потому что индикатор формирует сигналы по появлению на ценовом графике свечных фигур бычьего поглощения и медвежьего поглощения. В индикаторе...
 

Maybe someone already has one? Need to redo tma_centered_bands_arr.mq5 but without redrawing

 
Please help me to convert the indicator from terminal 4 to terminal 5.
Files:
CCI_.mq4  5 kb
 
Hello everyone and good profits.

Found anMT5 to MT4 Set File Converter - a script for MetaTrader 5https://www.mql5.com/ru/code/17493 there

Order of use.

Unfortunately, I'm not a programmer but a good user, frankly not really understand how to use this programulina correctly written.

File dropped to the folder Files, but that's what to do with it below written nihihi not understand.

Three input parameters:

  • File - allows for selective conversion. What to do with this File, if create a folder with this name then where? Just write the names of the files you want to convert. Where and where do I write the names of the files I want to convert, i.e. must I create a text file in a folder and write in it the names of the files I want to convert?
  • SubDirectory - write the name of subfolder where you want to save the files. - In what file would you create this subfolder?
  • Output Directory - name of the folder in which the results will be saved. - and this folder in what file to create?

    How to run this script to convert it?

Sorry for my French written in red...
I am grateful to everyone who will tell me how to use this script....
MT5 to MT4 Set File Converter
MT5 to MT4 Set File Converter
  • www.mql5.com
Этот скрипт конвертирует многочисленные файлы с расширением .set из формата MetaTrader 5 в формат MetaTrader 4. Это необходимый шаг в процессе оптимизации и запуска кросплатформенных торговых советников. MetaTrader 5 способен загружать файлы .set, созданные в MT4, при этом формат получающегося сохранения несовместим с MetaTrader 4. Этот скрипт...
 
btc.mmd:
Hello everyone and good profits.

Found anMT5 to MT4 Set File Converter - a script for MetaTrader 5https://www.mql5.com/ru/code/17493 there

Order of use.

Unfortunately, I'm not a programmer, but I'm a good user, frankly speaking, I don't understand how to use this programmer correctly.

The file is in the Files folder, but that's what to do below written nihihi not understand.

Three input parameters:

  • File - allows for selective conversion. What to do with this File, if create a folder with this name then where? Just write the names of the files you want to convert. Where and where do I write the names of the files I want to convert, i.e. must I create a text file in a folder and write in it the names of the files I want to convert?
  • SubDirectory - write the name of subfolder where you want to save the files. - In what file would you create this subfolder?
  • Output Directory - name of the folder in which the results will be saved. - and this folder in which file to create?

    How to run this script that it converted something?

Sorry for my French written in red...
I am grateful to everyone who will tell me how to use this script....

It converts strategy indicator preset files .set


Judging by the source code, the instructions are as follows:

Strategy Tester:

1.MT5 menu, click File -> Open data folder

2.Go to the folder Tester

3.Create a folder Files (if it does not exist)

4. Create here one more folder, and its name will be the same as the value of the input SubDirectory parameter. For example TestSet.

5.In the Output Directory parameter, name a folder to convert to. If it does not exist, MT5 will create it.

6. In the folder, you created in step 4, place the .set file from MT5.

7. Start the Strategy Tester with this indicator.

8. In the folder in point 5, you will find the MT4 .set vile.


Real Chart:

1.MT5 in the menu press File -> Open data folder

2.Go to the Files folder

3.Here create another folder and the name will be the same as the incoming SubDirectory parameter value. For example TestSet.

4.In the Output Directory parameter the name of the folder to be converted to. If it does not exist, MT5 will create it.

5. In the folder, you created in step 4, place the .set file from MT5.

6. Start the Strategy Tester with this indicator.

7. In the folder in point 5, you will find an MT4 .set.


I did not test the indicator itself, but according to the code it should work like this

 

NO DECOMPILING ALLOWED!!!

Reason: