Questions from Beginners MQL5 MT5 MetaTrader 5 - page 1233
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
A word of advice to a beginner.
When a Start event occurs in the script, it is handled by the OnStatr() function.
I have written a script called Print_1.
I think this function should print to terminal log number 9 when user clicks on Print_1 script. But nothing happens.
How and where in the terminal to see output z on the screen? What is the source of the Start event? How to start it so that number 9 finally appears on the screen? And run it from the terminal.
A word of advice to a beginner.
When a Start event occurs in the script, it is handled by the OnStatr() function.
I have written a script called Print_1.
I think this function should print to terminal log number 9 when user clicks on Print_1 script. But nothing happens.
How and where in the terminal to see the output z on the screen? What is the source of the Start event? How to start it so that number 9 finally appears on the screen? And I want to run it from the terminal.
Print and printf print the information to the "Toolbox" window, to the "Experts" tab.
Print
Prints a message into the journal
PrintFormat
Formats and prints the sets of characters and values into a log file according to a preset format
Displayed on the screen via
Comment
Outputs a message in the upper left corner of the price chart
How can I track the moment when an order triggers in order to place another order in the same direction and at a certain distance? (on mql5)
I've heard it's not a good idea to doOnTradeTransaction, as it doesn't always work
New problem, you need to select the last open position in the hedge
OnTradeTransaction+ variable declared in EA header. The variable stores the type of the last position opened. It is of long type and initialized with value '-1'. In OnTradeTransaction, you catch the moment when a position was opened and write it into the variable.
Then you check this variable in your code - if it is equal to '-1', then go through the loop and compare the time when each position was opened. Find the 'youngest' position andwrite it into the variable. If the variable is not equal to '-1' - then you compare it with the position type.