[ARCHIVE] Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 3. - page 383
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
Question how to find the most recent losing order ???
What is the principle ??? Is it an open-price order or is there any other way ?????
What's the principle ??? Order Open Price ??? or is there any other way ????
OrderProfit()
OrderProfit()
You connect this library to the EA. At the very beginning of the code, write it after the standard libraries are connected:
In the EA, in the start() function, make a call to the function that is in the library and compile the EA, not the library.
I did everything like you said and now when compiling the EA, it gives out cannot open the program file and points to the line with the name of my function: #include <GetExstremumZZZPrice.mqh>
What ??? OrderProfit() Can you be more specific???
Explain what OrderCloseBy is it clear that one order is different, and what does it do?
This gives a small saving on the spread.
At a rough guess, it is exactly twice as much.
What ??? OrderProfit() Could you be more specific???
We declare a variable of datetime type (e.g. Ord_Time) and immediately set it to zero. We declare an integer variable, e.g. Ticket, and then clear it too. Then we create a loop that will loop through all of the orders from the history. The next order has been selected. If the time of its closing is higher (or equal) than that in the Ord_Time variable and OrderProfit() is less than zero, the Ord_Time variable =OrderCloseTime() and the Ticket variable =OrderTicket(). As a result of this loop, the Ticket variable will contain a ticket of the last losing order, or zero, if there are no losing orders in the history at all.
Declare a datetime variable (e.g. Ord_Time) and immediately set it to zero. We declare an integer variable, e.g. Ticket, and set it to zero as well. Then we create a loop that will loop through all of the orders from the history. The next order has been selected. If the time of its closing is higher (or equal) than that in the Ord_Time variable and OrderProfit() is less than zero, the Ord_Time variable =OrderCloseTime() and the Ticket variable =OrderTicket(). As a result of this loop, the Ticket variable will contain a ticket of the last losing order, or zero, if there are no losing orders in the history at all.
Why make things so complicated?
Run the following script:
I wrote the solution above. You only need to insert one line in this code.