Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes - page 1049 1...104210431044104510461047104810491050105110521053105410551056...1965 New comment Alekseu Fedotov 2020.01.26 10:37 #10481 Вероника Баранова: I wonder if you can help me. Please. I am afraid to do something wrong. When you register a real account, you have registered a personal account on the DC website, you can change your password there. Or call support and they will tell you everything. Tretyakov Rostyslav 2020.01.26 14:00 #10482 Please advise how to implement Lots=NormalizeDouble(AccountBalance()/CheckLots,2); Rounding down, i.e. if AccountBalance()/CheckLots = 0.019 rounded to 0,01 Vitaly Muzichenko 2020.01.26 14:05 #10483 MakarFX: Please advise how to implement Rounding down, i.e. if AccountBalance()/CheckLots = 0.019 rounded down to 0.01 seeit Вопросы от начинающих MQL5 MT5 MetaTrader 5 2020.01.02 www.mql5.com Подскажите пожалуйста, такой показатель тестера в жизни реален? И хороший это или плохой результат за год с депо 3000... Tretyakov Rostyslav 2020.01.26 14:58 #10484 Vitaly Muzichenko: Take a lookat this. Solved the problem in a different, simpler way I think. NormalizeDouble rounds 0.5 to 1 and 0.4 to 0 The solution is Lots=NormalizeDouble(AccountBalance()/CheckLots-0.005,2); AIRAT SAFIN 2020.01.26 15:51 #10485 MathFloor Документация по MQL5: Математические функции / MathFloor www.mql5.com Математические функции / MathFloor - справочник по языку алгоритмического/автоматического трейдинга для MetaTrader 5 Vitaly Muzichenko 2020.01.26 16:02 #10486 Airat Safin: MathFloor returns the integer numeric value nearest to the bottom. Is 0.01 an integer? AIRAT SAFIN 2020.01.26 16:11 #10487 Vitaly Muzichenko: returns the integer value nearest to the bottom. Is 0.01 an integer? MakarFX: Can you tell me how to implement Lots=NormalizeDouble(AccountBalance()/CheckLots,2); Rounding down, i.e. if AccountBalance()/CheckLots = 0.019 rounded down to 0,01 Lots=NormalizeDouble(AccountBalance()/CheckLots, 2); => int Digits = 2 ; => double Power = MathPow ( 10 , Digits ) ; => double Lots = MathFloor ( Power * AccountBalance / CheckLots ) / Power ; int OnInit () { Print ( "==================================================================" ) ; int Digits = 2 ; double Power = MathPow ( 10 , Digits ) ; double AccountBalance = 0.19 ; double CheckLots = 10.00 ; double Lots1 = AccountBalance / CheckLots ; double Lots2 = MathFloor ( Power * AccountBalance / CheckLots ) / Power ; Print ( "AccountBalance= " , AccountBalance ) ; Print ( "CheckLots= " , CheckLots ) ; Print ( "Lots1= " , Lots1 ) ; Print ( "Lots2= " , Lots2 ) ; Print ( "==================================================================" ) ; return INIT_SUCCEEDED ; } void OnTick () {} Документация по MQL5: Математические функции / MathFloor www.mql5.com Математические функции / MathFloor - справочник по языку алгоритмического/автоматического трейдинга для MetaTrader 5 Tretyakov Rostyslav 2020.01.26 17:04 #10488 Another question ObjectSetText("Lev",StringConcatenate("Lev: ",DoubleToStr(MarketInfo(Symbol(),MODE_STOPLEVEL),0)),SizeINFO,"Times New Roman",InfoColor); How to set font thickness FW_BOLD I'm afraid I won't understand it in words. P.S. The MQL4 Reference didn't help(. Tretyakov Rostyslav 2020.01.26 17:21 #10489 Airat Safin: This issue has already been resolved Tretyakov Rostyslav 2020.01.27 07:57 #10490 Attempt number 2. Please help, it seems like a simple question. ObjectSetText("Lev",StringConcatenate("Lev: ",DoubleToStr(MarketInfo(Symbol(),MODE_STOPLEVEL),0)),SizeInfo,"Times New Roman",InfoColor); How to set font thickness FW_BOLD, or rather how to relate to TextSetFont( "Time New Roman",9,FW_BOLD,0); I am afraid I won't understand it in words. P.S. The MQL4 Reference didn't help(. 1...104210431044104510461047104810491050105110521053105410551056...1965 New comment
I wonder if you can help me. Please. I am afraid to do something wrong.
When you register a real account, you have registered a personal account on the DC website, you can change your password there.
Or call support and they will tell you everything.
Please advise how to implement
Rounding down, i.e. if AccountBalance()/CheckLots = 0.019
rounded to 0,01
Please advise how to implement
Rounding down, i.e. if AccountBalance()/CheckLots = 0.019
rounded down to 0.01
seeit
Take a lookat this.
Solved the problem in a different, simpler way I think.
NormalizeDouble rounds 0.5 to 1 and 0.4 to 0 The solution is
returns the integer numeric value nearest to the bottom.
Is 0.01 an integer?
returns the integer value nearest to the bottom.
Is 0.01 an integer?
Can you tell me how to implement
Rounding down, i.e. if AccountBalance()/CheckLots = 0.019
rounded down to 0,01
int OnInit () { Print ( "==================================================================" ) ; int Digits = 2 ; double Power = MathPow ( 10 , Digits ) ; double AccountBalance = 0.19 ; double CheckLots = 10.00 ; double Lots1 = AccountBalance / CheckLots ; double Lots2 = MathFloor ( Power * AccountBalance / CheckLots ) / Power ; Print ( "AccountBalance= " , AccountBalance ) ; Print ( "CheckLots= " , CheckLots ) ; Print ( "Lots1= " , Lots1 ) ; Print ( "Lots2= " , Lots2 ) ; Print ( "==================================================================" ) ; return INIT_SUCCEEDED ; } void OnTick () {}Another question
How to set font thickness FW_BOLD
I'm afraid I won't understand it in words.
P.S. The MQL4 Reference didn't help(.
Attempt number 2.
Please help, it seems like a simple question.
How to set font thickness FW_BOLD, or rather how to relate to
I am afraid I won't understand it in words.P.S. The MQL4 Reference didn't help(.