Quantcast
Channel: MQL5: MetaTrader 5 trading, automated systems and strategy testing forum
Viewing all 75046 articles
Browse latest View live

section "My Jobs" Need improvement

$
0
0

Dear mql5.com support:


This section is a MESS. You cant see after clicking how has contacted yoy for the job, who has admitted you for the job, how has gavid the job to another programmer.... You cant delete jobs from the main page (jobs you dont want to follow anymore).

Please consider a big review of this label pls.

Greetings

BeLikeWater


copy signal provider

$
0
0

Hello,

 i have just made a demo account and would like to copy some trades from more experienced users. I followed a signal provider, i subscribed to him but still no trades are being copied. Why is that ? 

 

On the web platform i also appear as subscribed to him but still no copied trades. 

Filtration experiences

$
0
0

What can be the most useful filtration technique for eliminating wrong signals produced by a three bars break-out approach?

Any experience ...

Thanks a lot.

is it possible to create an expert adviser based on indicator purchased at mql5.com market

$
0
0
erez80:

But if I'll give you an activation for the indicator you do will be able to run a backtest, isn't it?



I try to understand from you: is there a chance or a possibility that you will be able to program an ea based on a certain indicator bought on mql5.com without even getting this indicator?

I figured it out from your 2nd comment.

It's not about me. As stated above we can see 4 ways up to now. They all permit to develop an EA from an indicator bought on the Market.

Yes, the second way can be a solution to develop an EA, without the programmer having the indicator, provided that information about buffers are available. Depends of the indicator.

Export metatrader 5 to excel

$
0
0
ilson:
Hi,
Need to export the prices of a currency metatrader 5 for an excel table.
Have any function for this?
grateful

Try this.


Make a new indicator and copy this code in the file.


//+------------------------------------------------------------------+
//|                                                         Data.mq5 |
//|                        Copyright 2013, MetaQuotes Software Corp. |
//|                                              http://www.mql5.com |
//+------------------------------------------------------------------+
#property copyright "Copyright 2013, MetaQuotes Software Corp."
#property link      "http://www.mql5.com"
#property version   "1.00"
#property indicator_chart_window

#property indicator_buffers 1
#property indicator_plots   1

//--- parameters for writing data to the file
input string             InpFileName      = "Bars.csv"; // file name
input string             InpDirectoryName = "Data";   // directory name

int nfile_handle;

//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int OnInit()
   {
  
   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[])
   {

// CHECK VOOR EEN NIEUWE (MINUTEN) BAR
//------------------------------------

// Rates structure array voor prijs data van de laatste 2 minuten.  
   MqlRates mrate[2];  
  
// Rates structure voor de intraday data.               
   CopyRates(Symbol(), Period(), 0, 2, mrate);

// NIEUWE BAR CHECK.
//------------------
   static double   dBar_Open;    
   static double   dBar_High;
   static double   dBar_Low;
   static double   dBar_Close;
   static long     lBar_Volume;
   static datetime nBar_Time;

// Boolean voor de bevestiging van een nieuwe BAR.
   bool bStart_NewBar = false;

// Check if the price data has changed tov the previous bar.   
   if(mrate[0].open != dBar_Open || mrate[0].high != dBar_High || mrate[0].low != dBar_Low || mrate[0].close != dBar_Close || mrate[0].tick_volume != lBar_Volume || mrate[0].time != nBar_Time || prev_calculated == 0)
         {
         bStart_NewBar = true;        
    
         dBar_Open   = mrate[0].open;      
         dBar_High   = mrate[0].high;
         dBar_Low    = mrate[0].low;
         dBar_Close  = mrate[0].close;                
         lBar_Volume = mrate[0].tick_volume;
         nBar_Time   = mrate[0].time;
         }

// Check if the indicator has not yet been calculated or if a new bar has formed.   
   if(bStart_NewBar == true || prev_calculated == 0)
         {

// Number of BARS to copy   
         static int nHistoryPeriod = 1;
         nHistoryPeriod = Bars(Symbol(), PERIOD_M1) - 1;

// Data array for storage.         
         datetime aData_Time[];
         double   aData_Open[];
         double   aData_High[];
         double   aData_Low[];
         double   aData_Close[];
         long     aData_Volume[];

// Copy data to array.              
         CopyTime(Symbol(),       Period(), 1, nHistoryPeriod, aData_Time);
         CopyOpen(Symbol(),       Period(), 1, nHistoryPeriod, aData_Open);
         CopyHigh(Symbol(),       Period(), 1, nHistoryPeriod, aData_High);
         CopyLow(Symbol(),        Period(), 1, nHistoryPeriod, aData_Low);
         CopyClose(Symbol(),      Period(), 1, nHistoryPeriod, aData_Close);
         CopyTickVolume(Symbol(), Period(), 1, nHistoryPeriod, aData_Volume);

      
// Check/create CSV file      
         nfile_handle = FileOpen(InpDirectoryName + "//" + InpFileName, FILE_READ|FILE_WRITE|FILE_CSV);  

// Check if file is valid.         
         if(nfile_handle != INVALID_HANDLE)
               {
        
// Check array size.
               int nArray_Size = ArraySize(aData_Close);
                        
// Loop calculation.
               for(int i = 0; i < nArray_Size; i++)
                     {

// Write the values to the Excel file.                                  
                     FileWrite(nfile_handle, aData_Time[i], aData_Open[i], aData_High[i], aData_Low[i], aData_Close[i], aData_Volume[i]);                    
                     }

// Melding geven dat de data naar het bestand is geschreven.
               Alert("De DATA is naar het bestand geschreven!");
      
// Close the file.
               FileClose(nfile_handle);          
               }
         }
  


//--- return value of prev_calculated for next call
   return(rates_total);
   }

Please help me, to create an indicator of fibo

$
0
0
Greetings traders around the world

Please help me to be able to create such images fibo indicator I attach it, and fibo is not auto, we can put where we want on mt4.

I've had a lot of searching, but all auto and located automatically in mt4 and no number price

What mistake I made in this indicator ?

$
0
0

Hi 

I find an indicator that shows the Pin Bars of a symbol , and I modify it to show only the Bullish Pin Bars who is  above an Up Ma and the Bearish Pin Bars who is below a down Ma . 

And when I drop it to a chart with 4H timeframe or less it shows nothing , but with a D1 timeframe or bigger it works but only for the Bullish Pin Bars :( . Who's can help me , thanks .

//+------------------------------------------------------------------+
//|                                               PinbarDetectorTest |
//|                                       Copyright © 2014, Test.com |
//|                                             http://www.Test.com/ |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2014, Test"
#property link      "http://www.Test.com"



#property indicator_chart_window
#property indicator_buffers 2
#property indicator_color1 Red
#property indicator_width1 2
#property indicator_color2 Lime
#property indicator_width2 2

extern bool UseAlerts = true;
extern bool UseEmailAlerts = false; // Don't forget to configure SMTP parameters in Tools->Options->Emails
extern bool UseCustomSettings = false; // true = use below parameters
extern double CustomMaxNoseBodySize = 0.33; // Max. Body / Candle length ratio of the Nose Bar
extern double CustomNoseBodyPosition = 0.4; // Body position in Nose Bar (e.g. top/bottom 40%)
extern bool   CustomLeftEyeOppositeDirection = true; // true = Direction of Left Eye Bar should be opposite to pattern (bearish bar for bullish Pinbar pattern and vice versa)
extern bool   CustomNoseSameDirection = false; // true = Direction of Nose Bar should be the same as of pattern (bullish bar for bullish Pinbar pattern and vice versa)
extern bool   CustomNoseBodyInsideLeftEyeBody = false; // true = Nose Body should be contained inside Left Eye Body
extern double CustomLeftEyeMinBodySize = 0.1; // Min. Body / Candle length ratio of the Left Eye Bar
extern double CustomNoseProtruding = 0.5; // Minmum protrusion of Nose Bar compared to Nose Bar length
extern double CustomNoseBodyToLeftEyeBody = 1; // Maximum relative size of the Nose Bar Body to Left Eye Bar Body
extern double CustomNoseLengthToLeftEyeLength = 0; // Minimum relative size of the Nose Bar Length to Left Eye Bar Length
extern double CustomLeftEyeDepth = 0.1; // Minimum relative depth of the Left Eye to its length; depth is difference with Nose's back

// Indicator buffers
double Down[];
double Up[];

// Global variables
int    LastBars = 0;
double MaxNoseBodySize = 0.33;
double NoseBodyPosition = 0.4;
bool   LeftEyeOppositeDirection = true;
bool   NoseSameDirection = false;
bool   NoseBodyInsideLeftEyeBody = false;
double LeftEyeMinBodySize = 0.1;
double NoseProtruding = 0.5;
double NoseBodyToLeftEyeBody = 1;
double NoseLengthToLeftEyeLength = 0;
double LeftEyeDepth = 0.2;
double pips;
int point;

//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
{
//---- indicator buffers mapping  
   SetIndexBuffer(0, Down);
   SetIndexBuffer(1, Up);  
//---- drawing settings
   SetIndexStyle(0, DRAW_ARROW);
   SetIndexArrow(0, 74);
   SetIndexStyle(1, DRAW_ARROW);
   SetIndexArrow(1, 74);
//----
   SetIndexEmptyValue(0, EMPTY_VALUE);
   SetIndexEmptyValue(1, EMPTY_VALUE);
//---- indicator labels
   SetIndexLabel(0, "Bearish Pinbar");
   SetIndexLabel(1, "Bullish Pinbar");
//----
   if (UseCustomSettings)
   {
      MaxNoseBodySize = CustomMaxNoseBodySize;
      NoseBodyPosition = CustomNoseBodyPosition;
      LeftEyeOppositeDirection = CustomLeftEyeOppositeDirection;
      NoseSameDirection = CustomNoseSameDirection;
      LeftEyeMinBodySize = CustomLeftEyeMinBodySize;
      NoseProtruding = CustomNoseProtruding;
      NoseBodyToLeftEyeBody = CustomNoseBodyToLeftEyeBody;
      NoseLengthToLeftEyeLength = CustomNoseLengthToLeftEyeLength;
      LeftEyeDepth = CustomLeftEyeDepth;
   }
   return(0);
}
//+------------------------------------------------------------------+
//| Indicator deinitialization function                                 |
//+------------------------------------------------------------------+
int deinit()
  {
//----
   Comment( "" );
//----
   return(0);
  }
//+------------------------------------------------------------------+
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int start()
{
   point_multiplier();
   double MaBar1=iMA( Symbol(), 0, 50,0,0,0,1 );
   double MaBar2=iMA( Symbol(), 0,50,0,0,0,2 );
   double inclination=(MaBar1 - MaBar2)*point;
   Comment( inclination );
   int NeedBarsCounted;
   double NoseLength, NoseBody, LeftEyeBody, LeftEyeLength;

   if (LastBars == Bars) return(0);
   NeedBarsCounted = Bars - LastBars;
   LastBars = Bars;
   if (NeedBarsCounted == Bars) NeedBarsCounted--;

   for (int i = NeedBarsCounted; i >= 1; i--)
   {
      // Won't have Left Eye for the left-most bar
      if (i == Bars - 1) continue;
      
      // Left Eye and Nose bars's paramaters
      NoseLength = High[i] - Low[i];
      if (NoseLength == 0) NoseLength = Point;
      LeftEyeLength = High[i + 1] - Low[i + 1];
      if (LeftEyeLength == 0) LeftEyeLength = Point;
      NoseBody = MathAbs(Open[i] - Close[i]);
      if (NoseBody == 0) NoseBody = Point;
      LeftEyeBody = MathAbs(Open[i + 1] - Close[i + 1]);
      if (LeftEyeBody == 0) LeftEyeBody = Point;

      // Bearish Pinbar
      if(inclination<=-3)
      if(MaBar2 - MathMax(Open[1],Close[1])>0)
      if (High[i] - High[i + 1] >= NoseLength * NoseProtruding) // Nose protrusion
      {
         if (NoseBody / NoseLength <= MaxNoseBodySize) // Nose body to candle length ratio
         {
            if (1 - (High[i] - MathMax(Open[i], Close[i])) / NoseLength < NoseBodyPosition) // Nose body position in bottom part of the bar
            {
               if ((!LeftEyeOppositeDirection) || (Close[i + 1] > Open[i + 1])) // Left Eye bullish if required
               {
                  if ((!NoseSameDirection) || (Close[i] < Open[i])) // Nose bearish if required
                  {
                     if (LeftEyeBody / LeftEyeLength  >= LeftEyeMinBodySize) // Left eye body to candle length ratio
                     {
                        if ((MathMax(Open[i], Close[i]) <= High[i + 1]) && (MathMin(Open[i], Close[i]) >= Low[i + 1])) // Nose body inside Left Eye bar
                        {
                           if (NoseBody / LeftEyeBody <= NoseBodyToLeftEyeBody) // Nose body to Left Eye body ratio
                           {
                              if (NoseLength / LeftEyeLength >= NoseLengthToLeftEyeLength) // Nose length to Left Eye length ratio
                              {
                                 if (Low[i] - Low[i + 1] >= LeftEyeLength * LeftEyeDepth)  // Left Eye low is low enough
                                 {
                                    if ((!NoseBodyInsideLeftEyeBody) || ((MathMax(Open[i], Close[i]) <= MathMax(Open[i + 1], Close[i + 1])) && (MathMin(Open[i], Close[i]) >= MathMin(Open[i + 1], Close[i + 1])))) // Nose body inside Left Eye body if required
                                    {
                                      
                                          
                                             Down[i] = High[i] + 5 * Point + NoseLength / 5;
                                             if (i == 1) SendAlert("Bearish"); // Send alerts only for the latest fully formed bar
                                      
                                    }
                                 }
                              }
                           }
                        }
                     }
                  }
               }
            }
         }
      }
      
      // Bullish Pinbar
 if(inclination>=3)
   if(MathMin(Open[1],Close[1])-MaBar2>0)
      if (Low[i + 1] - Low[i] >= NoseLength * NoseProtruding) // Nose protrusion
      {
         if (NoseBody / NoseLength <= MaxNoseBodySize) // Nose body to candle length ratio
         {
            if (1 - (MathMin(Open[i], Close[i]) - Low[i]) / NoseLength < NoseBodyPosition) // Nose body position in top part of the bar
            {
               if ((!LeftEyeOppositeDirection) || (Close[i + 1] < Open[i + 1])) // Left Eye bearish if required
               {
                  if ((!NoseSameDirection) || (Close[i] > Open[i])) // Nose bullish if required
                  {
                     if (LeftEyeBody / LeftEyeLength >= LeftEyeMinBodySize) // Left eye body to candle length ratio
                     {
                        if ((MathMax(Open[i], Close[i]) <= High[i + 1]) && (MathMin(Open[i], Close[i]) >= Low[i + 1])) // Nose body inside Left Eye bar
                        {
                           if (NoseBody / LeftEyeBody <= NoseBodyToLeftEyeBody) // Nose body to Left Eye body ratio
                           {
                              if (NoseLength / LeftEyeLength >= NoseLengthToLeftEyeLength) // Nose length to Left Eye length ratio
                              {
                                 if (High[i + 1] - High[i] >= LeftEyeLength * LeftEyeDepth) // Left Eye high is high enough
                                 {
                                    if ((!NoseBodyInsideLeftEyeBody) || ((MathMax(Open[i], Close[i]) <= MathMax(Open[i + 1], Close[i + 1])) && (MathMin(Open[i], Close[i]) >= MathMin(Open[i + 1], Close[i + 1])))) // Nose body inside Left Eye body if required
                                    {
                                          
                                          
                                             Up[i] = Low[i] - 5 * Point - NoseLength / 5;
                                             if (i == 1) SendAlert("Bullish"); // Send alerts only for the latest fully formed bar
                                          
                                    }
                                 }
                              }
                           }
                        }
                     }
                  }
               }
            }
         }
      }
   }
   return(0);
}

string TimeframeToString(int P)
{
   switch(P)
   {
      case PERIOD_M1:  return("M1");
      case PERIOD_M5:  return("M5");
      case PERIOD_M15: return("M15");
      case PERIOD_M30: return("M30");
      case PERIOD_H1:  return("H1");
      case PERIOD_H4:  return("H4");
      case PERIOD_D1:  return("D1");
      case PERIOD_W1:  return("W1");
      case PERIOD_MN1: return("MN1");
   }
   return("");
}

void SendAlert(string dir)
{
   string per = TimeframeToString(Period());
   if (UseAlerts)
   {
      Alert(dir + " Pinbar on ", Symbol(), " @ ", per);
      PlaySound("alert.wav");
   }
   if (UseEmailAlerts)
      SendMail(Symbol() + " @ " + per + " - " + dir + " Pinbar", dir + " Pinbar on " + Symbol() + " @ " + per + " as of " + TimeToStr(TimeCurrent()));
}
void point_multiplier()
{

   double ticksize = MarketInfo( Symbol(), MODE_TICKSIZE );
  if (ticksize==0.00001){
    pips=ticksize*10;
    point=10000;}
  if (ticksize == 0.001){
    pips=ticksize*10;
    point=100;}
  if (ticksize == 0.0001){
   pips=ticksize;
    point=1000;}
  if (ticksize == 0.01){
    pips=ticksize;
    point=10;}
}

know what is the mistake I made ?  

#EP Futures S&P500 E-mini data on MT5

$
0
0

Hi there,

Does anyone know when MT5 will provide S&P500 E-mini data on MT5? I notice there are 10 years data on MT4.  


Cerco un trading system per future sp500, nasdaq o djones

$
0
0

Buonasera mi è stato consigliato di scaricare una mt5 e chiedere in questo forum più informazioni possibili sulla mt5. Come da oggetto cerco un Ts abbastanza performante. Premetto che di programmazione ne capisco poco sino ad ora ho fatto e continuo a fare trading discrezionale la mia piattaforma di partenza è iwbank. Grazie per l'attenzione.

Signal Providers Lot Size Question

$
0
0
setandforget:

Hi guys, I'm fairly new to Forex and only started following a signal provider today! Quick question...I understand the ratio used to work out the Lot Size between provider and subscriber but I was wondering; if my account balance is larger than my signal providers would I be able to trade a Lot Size greater than theres?

i.e. At the moment if they trade 1.0 and I am 0.85, if I doubled my account balance deposit could I trade a Lot Size of 1.70 while my provider is still trading 1?

Thanks 

Yes.

SetIndexBuffer : add an buffer to an indicator

$
0
0
angevoyageur:
Indicator's buffer can only be of double type. Please read the documentation about SetIndexBuffer().

I've used an ENUM as suggested by Iceron. Now, I face a new problem.

(GBPAUD,M30)    array out of range in 'Ext.mq5' (127,7)


After some calculations I obtain a variable called "results", I'd like it to be the buffer. So ...

double Buffer[]; <--- declared as this higher in the code
Buffer[0] = StringToDouble(results); <--- results being a 'string'
printf("Buffer : %g",Buffer[0]);
I don't need Buffer to be multiple, I'd rather want it to show the results as they are. From the expert I will ask only one Buffer[0] at the time.

What mistake I made in this indicator ?

$
0
0

Hi 

I find an indicator that shows the Pin Bars of a symbol , and I modify it to show only the Bullish Pin Bars who is  above an Up Ma and the Bearish Pin Bars who is below a down Ma . 

And when I drop it to a chart with 4H timeframe or less it shows nothing , but with a D1 timeframe or bigger it works but only for the Bullish Pin Bars :( . Who's can help me , thanks .

Discussion of article "MetaTrader 5 on Linux"

$
0
0

Problem with Metatrader 4 (4.0 build 745) on Kubuntu 14.10, runnig with wine 1.6.2.

 Expert Advisor Admiral - Mini Terminal doesn't work

- it shows as blank window!

on linux console the following shown...

fixme:ieframe:PersistStreamInit_InitNew (0x94bc810)

fixme:ieframe:OleObject_Advise (0x94bc810)->(0x3f25e6c, 0x3f25ec4)

fixme:ieframe:ViewObject_SetAdvise (0x94bc810)->(1 00000000 0x3f25e6c)

fixme:ieframe:ViewObject_Draw (0x94bc810)->(1 -1 (nil) (nil) (nil) 0x50048 0x3f25edc 0x3f25edc (nil) 00000000)

fixme:urlmon:URLMoniker_BindToObject use running object table

err:mshtml:HTMLDocument_Create Failed to init Gecko, returning CLASS_E_CLASSNOTAVAILABLE

fixme:ole:CoCreateInstance no instance created for interface {00000000-0000-0000-c000-000000000046} of class {25336920-03f9-11cf-8fd0-00aa00686f13}, hres is 0x80040111

fixme:ieframe:handle_navigation_error Navigate to error page

 Any idea to fix that???

Order Modify Error

$
0
0
amando:

Hello

 

i have a problem with order modify, i try to place some order and with short order i get sometimes wrong

my code

What is PositionModify() ?

the calculation of the stop is right., 

It is not as you get an error.

What is current price (Bid/Ask) when you modify your SL ? Did you check the stopslevel ?

Anchor indicator ChartEvent

$
0
0

Hi, anyone could help me to find a way to anchor this indicator to the low of the candle, when i click on chart?

Thanks

input string          InpName="ArrowBuy";   // Object name
//+------------------------------------------------------------------+
//| Expert initialization function |
//+------------------------------------------------------------------+
int OnInit()
{
//---
Print("The expert with name",MQL5InfoString(MQL5_PROGRAM_NAME),"is running");
//---
return(0);
}
//+------------------------------------------------------------------+
//| |
//+------------------------------------------------------------------+

 void OnChartEvent(const int id, 
                  const long   &lparam,
                  const double &dparam,
                  const string &sparam)
  {
   string comment="Last event: ";

//--- select event on chart
   switch(id)
     {
            
      //--- 1
      case CHARTEVENT_CLICK:
        {
         comment+="6) mouse click on chart";
         //--- object counter 
         static uint sign_obj_cnt;
         string buy_sign_name="buy_sign_"+IntegerToString(sign_obj_cnt+1);
         //--- coordinates 
         int mouse_x=(int)lparam;
         int mouse_y=(int)dparam;
          
         //--- time and price
         datetime obj_time;
         double obj_price;
          
         int sub_window;
         //--- convert the X and Y coordinates to the time and price values
         if(ChartXYToTimePrice(0,mouse_x,mouse_y,sub_window,obj_time,obj_price) )
            {
            //--- create object
            if(!ObjectCreate(0,buy_sign_name,OBJ_ARROW_BUY,0,obj_time,obj_price)) //OBJ_ARROW_BUY
            
              {
               Print("Failed to create buy sign!");
               return;
              }
            
           }
           
        }
     }
//---
   Comment(comment);
          
       }

Discussion of article "Why Virtual Hosting On The MetaTrader 4 And MetaTrader 5 Is Better Than Usual VPS"

$
0
0
can i open it from andr*id cellphone?

Indicators: BarTimer

Experts: MA Cross

hi lo

$
0
0

I could not download it. any community has it without being zipped?

DRAW_FILLING type indicator buffers mixed up?

$
0
0
whitebloodcell:

I am trying to get my indicator, to, among other things, display the next likely support and resistance levels as a coloured band. The buffers placed above the DRAW_FILL declarations behave as expected, and the support levels display, but not the resistance levels. The values are correctly set in the buffers as seen in the data window. Can anyone see what is wrong? Extracts from the top of the code and OnInit() are below.

Updated the post after fixing the code that sets the values, the only issue should be something to do with the buffer assignments now.
Viewing all 75046 articles
Browse latest View live