Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes - page 1600
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
Saw now that you've added a log. Here you have duplicate messages too :)
can you please explain the difference between the functions?
for (int j = OrdersHistoryTotal()-1; j >= 0; j--)
{
if(OrderSelect(j, SELECT_BY_POS,MODE_HISTORY))
и
int i=OrdersHistoryTotal();
for(int pos=0; pos<i; pos++)
{
if(OrderSelect(pos, SELECT_BY_POS,MODE_HISTORY))
No
If you look at the time, you will see that nothing is duplicated, it only prints on a new bar when there is a signal
No
Well, not exactly. One cycle from the beginning of the list, the other from the end.
No
both functions "fetch" closed orders from the history ?
Well, not exactly. One cycle from the beginning of the list, the other from the end.
both functions "fetch" closed orders from the history ?
Yes, but one is from the beginning of the story and the other from the end.
Thank you. Did I get it right, this function "goes through" from the end?
int i=OrdersHistoryTotal();
for(int pos=0; pos<i; pos++)
{
if(OrderSelect(pos, SELECT_BY_POS, MODE_HISTORY))
Thank you. Did I get it right, this function "goes through" from the end?
int i=OrdersHistoryTotal();
for(int pos=0; pos<i; pos++)
{
if(OrderSelect(pos, SELECT_BY_POS, MODE_HISTORY))
Thank you. Did I get it right, this function "goes through" from the end?
int i=OrdersHistoryTotal();
for(int pos=0; pos<i; pos++)
{
if(OrderSelect(pos, SELECT_BY_POS, MODE_HISTORY))
This one searches from the zero index, i.e. from the beginning.