Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes - page 185

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
Guys, off-topic question, I am a newbie, I would like to order a job, I have 0 on my balance, can I open a theme? or do I have to top up my account at the beginning? a little confused when they block money from my account...
Vitaly Muzichenko:
Reverse overshoot on closed
Thank you ... I'm interested in going over open orders ... Will this work correctly?
Yes, you can check through Print();
Thanks ... I understand everything, but I am confused byi=OrdersTotal()-1; why-1 and not justi=OrdersTotal();...In this case, it turns out that the last of the open orders will be excluded from the recalculation - or am I wrong?
OrderTotal() shows as many orders as there are, and order counting starts from zero. In other words, we need minus one to be correct in this case.
Thanks ... I understand everything, but I am confused byi=OrdersTotal()-1; why-1 and not justi=OrdersTotal();...In this case, it turns out that the last of the open orders will be excluded from the recalculation - or am I wrong?
To anyone reading this, hello.
The question is as follows, how to set a spread or ASK price in the MT4 tester with historical Ask price data.
Let me explain.
In the MT4 terminal we have a history of some Symbol (in it all prices are Bid respectively) and we have the Symbol_ask history (all ask prices, this history is also provided by a broker)
Is it possible to use this data in the tester?
Thanks ... I understand everything, but I'm confused byi=OrdersTotal()-1; why-1, and not justi=OrdersTotal();... In this case, it turns out that the last of opened orders will be excluded from recalculation - or am I mistaken?
This is because it is counted from 0. If you have 10 orders, then count ordinal numbers should be 0...9, that is, 0...(10-1), whereOrdersTotal()=10.
Just keep this in mind when writing programs.
Thanks ... I understand everything, buti=OrdersTotal()-1; why-1 and noti=OrdersTotal();...In this case, it turns out that the last of the open orders will be excluded from the recalculation - or am I wrong?
As you can see - there are ten orders, but their indexes are 1 less, because in any array the count starts from zero.
OrdersTotal() is 10, but if you start a loop with OrdersTotal(), then you will go outside the array - the index of order 10 is not there - the largest index is 9 - so OrdersTotal()-1