![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
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
Nope, this is wrong . . get rid of it. The positions and indexes are the same thing and they are 0 to 9 . . . there is nothing that is 1 to 10 . . . expunge it from your brain.
This needs to be rectified, pronto.
If indexes and position numbers are identical then this is true...
Ten tickets total in active trades order pool:
ticket position numbers are as follows: 0,1,2,3,4,5,6,7,8,9
ticket position numbers indexed are as follows: |0|1|2|3|4|5|6|7|8|9|
If this is indeed the case, a ticket position number can be zero (0).
Please confirm above statements or please state otherwise.
Thank you.
This needs to be rectified, pronto.
If indexes and position numbers are identical then this is true...
Ten tickets total in active trades order pool:
ticket position numbers are as follows: 0,1,2,3,4,5,6,7,8,9
ticket position numbers indexed are as follows: |0|1|2|3|4|5|6|7|8|9|
If this is indeed the case, a ticket position number can be zero (0).
We have been through this before . . . . an Order has a ticket number . . . an Order also has a position in the Trading pool for Open/Pending Orders or the History pool for closed Orders..
If we have 10 open orders the Order positions are 0 to 9 or 0,1,2,3,4,5,6,7,8,9 or |0|1|2|3|4|5|6|7|8|9| end, Fin, done
We have been through this before . . . . an Order has a ticket number . . . an Order also has a position in the Trading pool for Open/Pending Orders or the History pool for closed Orders..
If we have 10 open orders the Order positions are 0 to 9 or 0,1,2,3,4,5,6,7,8,9 or |0|1|2|3|4|5|6|7|8|9| end, Fin, done
Thank you.
Hello MQL4 community Forum,
Presently, I attempt to save price values for order closes. I tried including the OrderProfit() function but don't like it. No-no :O .Will use it if all other avenues fail. I'd like to save the order close price :) instead using OrderClosePrice() function. Once all order close prices are saved I could group the results in pairs. Once grouped in pairs, add each group then divide each group by two to retrieve their average. Once all pairs are averaged regroup the results and repeat process. Once all pairs are averaged and only one total remains I would subtract the spread from this total and if the result is greater-than or equal (>=) to order open price a Boolean would remain false. If the result is less than the order open price a Boolean would be initialized true.
Has anyone been down this road before? If so can you provide some warnings to keep in mind?
Thank you
Has anyone been down this road before? If so can you provide some warnings to keep in mind?
HEADACHE
Ah yeah, history pool. "No-brainer!". You're straight pro Simon! Hahaha! ;) Why didn't I think of this first, right?
You'll make an "MQL4 coding rock-star" out of me yet! Hahahaha!
Thank you
Simon,
I've been reviewing documentation for 'Break' and 'Continue' operators. As far as I can see, a 'Break' operator terminates an operator 'while' or 'for' cycle passing program control to the next line of code below the 'while' or 'for' cycle. A 'Continue' operator stops reading the operator 'while' or 'for' cycle's body and passes program control to either the expression in an operator 'while' cycle OR 'Expression 2' if a 'for' cycle possesses no 'Expression 3' or 'Expression 3' if the 'for' cycle does posses 'Expression 3'.
What are your thoughts regarding this?
Thank you
Simon,
I've been reviewing documentation for 'Break' and 'Continue' operators. As far as I can see, a 'Break' operator terminates an operator 'while' or 'for' cycle passing program control to the next line of code below the 'while' or 'for' cycle. A 'Continue' operator stops reading the operator 'while' or 'for' cycle's body and passes program control to either the expression in an operator 'while' cycle OR 'Expression 2' if a 'for' cycle possesses no 'Expression 3' or 'Expression 3' if the 'for' cycle does posses 'Expression 3'.
What are your thoughts regarding this?
Thank you
All in all: use continue inside a loop to jump back to the entry point. use break to exit the loop immediatly.
One more thing, break and continue are code optimizing operations, you never really need them. Additionally use them with care as they can lead to hard to track bugs.
As nearly always with programming, a simple example says more then 1000 words:
Michael, thank you for your explanation in words and in code. Both are explanatory.
Thank you