Hi there,
i am just reading the MQL4 Book und i have a Problem to undestand this Part of the EA "tradingexpert". Concret the part with counting the Market orders. If i have two market orders, the variable Total gets the Value 2. But in this case the Condition Total<1 is not fulfilled and the Alert will not appear. Is this a mistake in the Programm? I think rather i dont understand it in the right way. It would be nice, if someone could explain it. Thank you.
It's probably an error in the book, there have been other errors reported . . . I think it should be . . .
if (Total > 1)
If you had read the whole page, you would see
https://book.mql4.com/samples/expert
Some Code Peculiarities
The analyzed Expert Advisor code is oriented to the implementation of a certain strategy. Note, some program lines contain variables and calculations that would be changed, if the strategy were changed.
For example, according to the accepted strategy the Expert Advisor is developed to work only with one order. This allowed to use the variable Ticket both for the identification of a closing order number (in block of closing 6-7) and for the identification of a success of a trade operation execution when opening an order (in the block of opening 8-9). In this case such a solution is acceptable. However, if we take the analyzed code as the basis for the implementation of another strategy (for example allow opposite orders) we will have to introduce one or several variables to be able to recognize numbers of opened orders and identify the success of trade operations.
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hi there,
i am just reading the MQL4 Book und i have a Problem to undestand this Part of the EA "tradingexpert". Concret the part with counting the Market orders. If i have two market orders, the variable Total gets the Value 2. But in this case the Condition Total<1 is not fulfilled and the Alert will not appear. Is this a mistake in the Programm? I think rather i dont understand it in the right way. It would be nice, if someone could explain it. Thank you.