MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal

Source code library - Expert Advisors, Indicators and Scripts

Read Financial Magazines in MetaTrader 4 and MetaTrader 5!
To post a new code, please log in or register

Interesting script?
So post a link to it -
let others appraise it

You liked the script? Try it in the MetaTrader 5 terminal

2010.08.09 11:24
Multik

Multik

| English Russian Chinese Spanish Portuguese

Downloads:
3711
Views:
3962
Rating:
votes: 11
Files:
\MQL5\Experts\
multik.mq5 (25.85 KB)view

Real author:

This Expert Advisor is based on the idea, presented in the article Creating an Expert Advisor, which Trades on a Number of Instruments.

Description:

It trades on the EURUSD and GBPUSD daily bars. It buys when MA is upwards, and sells when MA downwards.

It uses a special function for money management. The testing period was the Last year.

Input parameters:

  • Symb* - symbol;
  • Trade* - trade allowed;
  • Per* - MA period;
  • ApPrice* - applied price (close price by default);
  • MaMethod* - Moving Average method (Simple MA by default);
  • StLoss* - Stop Loss in points;
  • TkProfit* - Take profit in points;
  • Lots* - Position volume;
  • Slippage* - Slippage.

Image:


Multicurrency Expert Advisor


Multicurrency Expert Advisor

Recommendations:

It isn't recommeded to use it in a real trade.

Translated from Russian by MetaQuotes Software Corp.
Original code: http://www.mql5.com/ru/code/158

Last comments | Go to discussion (6)
bdwezensky
bdwezensky | 17 Sep 2010 at 00:11

request.volume = Money_M();

 

This EA is a great example of organized code and has great comments.  I did have one question however pertaining to your lot size function called Money_M().  What and where is the decision tree behind this?

I tried to search the support site but could find no reference and it did not appear to be linked to an associated class. 

Vladimir Batrudinov
Interesting | 17 Sep 2010 at 03:54
bdwezensky:

request.volume = Money_M();

 

This EA is a great example of organized code and has great comments.  I did have one question however pertaining to your lot size function called Money_M().  What and where is the decision tree behind this?

I tried to search the support site but could find no reference and it did not appear to be linked to an associated class. 

double Money_M()
  {
   double Lots=AccountInfoDouble(ACCOUNT_FREEMARGIN)/100000*10;
   Lots=MathMin(5,MathMax(0.1,Lots));
   if(Lots<0.1)
      Lots=NormalizeDouble(Lots,2);
   else
     {
      if(Lots<1) Lots=NormalizeDouble(Lots,1);
      else       Lots=NormalizeDouble(Lots,0);
     }
   return(Lots);
  }

This function is used to calculate the size of trading lots.

double Lots=AccountInfoDouble(ACCOUNT_FREEMARGIN)/100000*10;

In  this string the calculated size of trade lots. The calculation is carried out on free money (ACCOUNT_FREEMARGIN). Risk = 10% of available free funds.

Lots=MathMin(5,MathMax(0.1,Lots));
In this line is executed the normalization of the trade lots. 0.1 <= Lot <= 5.0
WhatTheHulk
WhatTheHulk | 14 Nov 2011 at 03:09
Hey, thank you for the multicurrency EA. When I try to run this EA in the Strategy Tester, it does not place a single trade. Sorry, I am a bit new to programming. Are there any settings that need to be modified for this EA to run?
loridan Adrien
loridan | 4 Apr 2012 at 20:04

Hi, I'm french and my english is bad sorry^^.

If it does not place any trade or you have an error : [invalid request] , you must add : "  request.type_time    = ORDER_TIME_GTC;   " in the intialization of the MqlTradeRequest structure for every order.

Achmad Hidayat
achidayat | 9 Jul 2012 at 06:37

I have trouble when attach this EA. In Expert tab appear this message :

2012.07.09 11:31:16    exp_tema   cannot load indicator 'Triple Exponential Moving Average' [4302]

What wrong? Thank you