You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
it says in the help.
intday_of_year;// number in a year (1 february is the 32nd day of the year)
For some reason it always comes out as 31 ((
the script attached
in the file
2010.02.01 00:00:00 143.832 143.839 143.758 143.771 186 2010 2 1 0 0 1 31
This is a mistake in the documentation. The numbering of days in a year starts from 0. Thank you.
I understand that it is more complicated, but it seems to be more familiar (to the layman. To the programmer, it's OK). January 1 is the 1st day of the year. It seems right to me in the help.
Hello, can you help me translate from mt4 to mt5 function. I've translated it, but it's not right, if you're not hard, please send me the right code, I'm not very good at MQL. I'm just starting to learn it.
//+------------------------------------------------------------------+
#property copyright "2010, MetaQuotes Software Corp."
#property link"http://www.mql5.com"
#property version "1.00"
//--- input parameters
input double Lots=0.1;
input bool MM = true;
input double Risk = 10;
//+------------------------------------------------------------------+
//| Expert initialization function|
//+------------------------------------------------------------------+
int OnInit()
{
return(0);
}
//+------------------------------------------------------------------+
//| Expert deinitialization function|
//+------------------------------------------------------------------+
void OnDeinit(const int reason)
{
}
//+------------------------------------------------------------------+
//| expert tick function|
//+------------------------------------------------------------------+
void OnTick()
{
if( MM )double Lots = LotSon(); //call LotSon function
}
//+------------------------------------------------------------------+
double LotSon()
{
double LotMin = SymbolInfoDouble(_Symbol,SYMBOL_VOLUME_MIN);
double LotMax = SymbolInfoDouble(_Symbol,SYMBOL_VOLUME_MAX);
double Lots = AccountInfoDouble(ACCOUNT_FREEMARGIN)/100000.0 * Risk;
double Lots = MathMin(Lotmax,MathMax(Lotmin,Lots));
if (LotMin < 0.1)Lots = NormalizeDouble(Lots,2);
else
{
if (LotMin < 1.0)Lots = NormalizeDouble(Lots,1);
else Lots = NormalizeDouble(Lots,0);
}
if (Lots < LotMin) Lots = LotMin;
if (Lots > LotMax) Lots = LotMax;
}
How do you get the code in colour?
How do you get your code coloured?
MQL5 Community article - User Memo:
The button is intended to insert the MQL source code into the text of the message. An empty window will appear as soon as you press it, in which you should insert the code and then press the Insert button. To cancel the code insertion, press the Cancel button.
It is not recommended to make code bold in order to highlight certain chunks in a meaningful way. The point is that monospace fonts are displayed differently in different operating systems and browsers. For example, Windows Vista uses Consolas monospace font, which has a bold font for size 10 that is almost indistinguishable from a regular font.
Hello, can you help me translate from mt4 to mt5 function. I've translated it, but it's not right, if you're not hard, please send me the right code, I'm not very good at MQL. I'm just starting to learn it.
All right, let's give it a try. Thank you all! Am I even asking these questions? Or do I need to go somewhere else? Thanks in advance for the answer.
And at this stage of development: parameters, function call and function itself should show compile-time errors or not. If so, why? I have errors showing