[ARCHIVE] Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 3. - page 185 1...178179180181182183184185186187188189190191192...652 New comment [Deleted] 2011.09.17 23:27 #1841 Hello. Please help me find an error. The code should return the type of the last closed order (in this case a losing order). Thank you in advance. string OrdersTypeHistLoss_b(){ double ProfHist=OrdersProfHist_b(); string SMB=Symbol(); string TypeHistLoss; int MAGIC; int i; for (i=0; i<OrdersHistoryTotal(); i++) {//Начало цикла if (OrderSelect(i,SELECT_BY_POS,MODE_HISTORY) == true) { if(OrderSymbol()==SMB) { if(OrderMagicNumber()==(MAGIC || 777)) { if(ProfHist<0){ TypeHistLoss=OrderType(); } } } }//конец работы с выбранным ордером }//Конец цикла return(TypeHistLoss); } Алексей Тарабанов 2011.09.17 23:58 #1842 if(OrderMagicNumber()==MAGIC || OrderMagicNumber()== 777)) { [Deleted] 2011.09.18 00:29 #1843 tara: if(OrderMagicNumber()==MAGIC || OrderMagicNumber()== 777)) { if(OrderMagicNumber()==(MAGIC || 777)) { This line works - I use it in several other subroutines of mine. In any case, I haven't encountered any problems so far. Thank you. [Deleted] 2011.09.18 01:04 #1844 (A puzzling question). How do I determine programmatically whether a number is even or odd? For example: int a, b, c; a=2; b=3; c=a+b c is even or odd? One more theoretical question... Is it worth forced zeroing of the array, if data is written to it dynamically, when new bars appear? Thanks in advance. How do I change [ARCHIVE!] Any rookie question, How to loop x Алексей Тарабанов 2011.09.18 01:12 #1845 1. By the value of the remainder of division by 2. 2. Worth. [Deleted] 2011.09.18 01:13 #1846 tara: 1. By the value of the remainder of division by 2. 2. Worth. The remainder is clear, but what mql function detects the remainder? Victor Nikolaev 2011.09.18 01:14 #1847 NickXXX:(A puzzling question). How do I determine programmatically whether a number is even or odd? For example: int a, b, c; a=2; b=3; c=a+b c is even or odd? If the numbers are integers, check the remainder of division by 2 if (c % 2==0) //четное [Deleted] 2011.09.18 01:16 #1848 Vinin: If the numbers are integers, check the remainder of division by 2 Thank you.) Алексей Тарабанов 2011.09.18 01:16 #1849 NickXXX: The balance is clear, but what mql function determines whether there is a balance? https://docs.mql4.com/ru/math/MathMod [Deleted] 2011.09.18 01:20 #1850 tara: https://docs.mql4.com/ru/math/MathModThank you.) 1...178179180181182183184185186187188189190191192...652 New comment
Hello.
Please help me find an error. The code should return the type of the last closed order (in this case a losing order).
Thank you in advance.
if(OrderMagicNumber()==MAGIC || OrderMagicNumber()== 777)) {
if(OrderMagicNumber()==MAGIC || OrderMagicNumber()== 777)) {
This line works - I use it in several other subroutines of mine. In any case, I haven't encountered any problems so far.
Thank you.
(A puzzling question).
How do I determine programmatically whether a number is even or odd?
For example:
int a, b, c;
a=2;
b=3;
c=a+b
c is even or odd?
One more theoretical question...
Is it worth forced zeroing of the array, if data is written to it dynamically, when new bars appear?
Thanks in advance.
1. By the value of the remainder of division by 2.
2. Worth.
1. By the value of the remainder of division by 2.
2. Worth.
The remainder is clear, but what mql function detects the remainder?
(A puzzling question).
How do I determine programmatically whether a number is even or odd?
For example:
int a, b, c;
a=2;
b=3;
c=a+b
c is even or odd?
If the numbers are integers, check the remainder of division by 2
If the numbers are integers, check the remainder of division by 2
The balance is clear, but what mql function determines whether there is a balance?
https://docs.mql4.com/ru/math/MathMod
https://docs.mql4.com/ru/math/MathMod
Thank you.)