Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes - page 981
![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
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
@ Artyom Trishkin
Please can you answer my question? I don't think anyone cares.
Try asking your question here:
Hello.
I am a newbie and I have the first problem - why does the compilation give an error? How to fix it?
//+------------------------------------------------------------------+
//|moy var1.mq4 |
#property copyright "Copyright 2019, MetaQuotes Software Corp."
#property link "https://www.mql5.com"
#property version "1.00"
#property strict
extern int Magic = 111;
int CountSell()
//+------------------------------------------------------------------+
//| Expert initializationfunction|
//+-----------------------------------------------------------------+
int OnInit()
{
return(INIT_SUCCEEDED);
}
//+------------------------------------------------------------------+
//| Expert deinitialization function|
//+------------------------------------------------------------------+
void OnDeinit(const int reason)
{
}
//+------------------------------------------------------------------+
//| expert tick function|
//+------------------------------------------------------------------+
void OnTick()
{
{
int count =0;
for(int i = OrdersTotal() - 1; i >= 0; i--)
{
if(OrderSelect(i, SELECT_BY_POS, MODE_TRADES))
{
if(OrderSymbol() == Symbol() && OrderMagicNumber() == Magic && OrderType() == OP_SELL)
count++;
}
}
return;
}
}
//+------------------------------------------------------------------+
'int' - semicolon expected moy var1.mq4 13 1
1 error(s), 0 warning(s) 2 1
Hello.
I am a newbie and I have the first problem - why does the compilation give an error? How to fix it?
//+------------------------------------------------------------------+
Please insert the code correctly:
Afternoon. I cannot draw a Fibo object ( OBJ_FIBO) in MT-4 without extending the lines to the right. When changing OBJPROP_RAY_RIGHT parameter, the ray is still drawn all the way to the right. And the tutorial script from the tutorial behaves in the same way. I tried to change it to OBJPROP_RAY as for the segment, it doesn't work. If you are able to explain the reason. Thank you in advance.
The matter is that MT4 is not MT5 and if the code compiles, it does not mean that it will work.
The fact is that MT4 is not MT5, and if the code compiles, this does not mean that it will work.
I understand. And that's why I'm asking whether the setting " Continuation of the object to the right" by means of OBJPROP_RAY_RIGHT really works in MT-4 for ( OBJ_FIBO ) ? An example of a script is taken from a textbook for mt-4.
I understand. That's why I'm asking if setting " Continue object to the right" with OBJPROP_RAY_RIGHT really works in mt-4 for ( OBJ_FIBO)? The example scriptis taken from the tutorial for mt-4.
It is possible that they missed it when editing the help. It was corrected from mql5 documentation.
Hi all. It's been a week since I started studying mql, and I've been puzzling over how to implement such a mechanism. The chart has a button ( OBJ_BUTTON), how and what should be written in the code to print a number from a given sequence in order when you click on the button. I.e., there is a sequence of 2, 4, 8, 16, 32, 64, 128. I, for example, press the button on the chart and the number from this sequence should be displayed in a comment, strictly in order. I pressed the button - it will show 2, I pressed it again - it will show 4 and so on. And by pressing the second button, for example, these numbers would appear in reverse order. If you can write a working code, my joy will be over)))
To determine what number is in the comment, read the graph documentation. There is a function there to read the comment.
Or the easiest, this number to put in a static variable, and it in Comment()
To determine what number is in the comment, read the graph documentation. There is a function there to read the comment.
Or the easiest way is to stick this number in a static variable and put it in Comment()
Thanks for the reply. I've found how to do button press handling in the help, but I'm having trouble with the rest. I'm working not just with one number, but with a sequence of integers and I need one push of the button to output a number from this sequence, in order from 2 to 128. The question is exactly how to do this...