| stevehopwoodforex.com https://www.stevehopwoodforex.com/phpBB3/ Print view |
|
| Normalizedouble not working https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?t=5420 |
Page 1 of 2 |
| Author: | fx805 [ Thu Mar 15, 2018 7:39 pm ] |
| Post subject: | Normalizedouble not working |
I swear-- its always the small things i get hung up lol.. So was coding up a function last night and was just trying to Comment my Tp and Sl levels on the screen.. They showed as the full numbers going many Digits past the decimal point... Ok.. So i Normalize it down to 2 digits... and it just wont work.. I either get the same number of many digits showing or sometimes ill get 4 .. But either way it was never consistent..I even made up a dummy test EA just to test this one specific thing and it did the same problems there.. You can see that the Tp normalized down but the Sl didnt.. Same code used for both.. Any ideas? the code used; Code: Select all |
|
| Author: | tomele [ Thu Mar 15, 2018 8:58 pm ] |
| Post subject: | Normalizedouble not working |
DoubleToString is what you might be searching for. Cheers |
|
| Author: | fx805 [ Thu Mar 15, 2018 9:08 pm ] |
| Post subject: | Normalizedouble not working |
Thanks tomele.. I tried it before and that didnt work.. I gave it another go with DoubletoSting and my resluts are as you see below.. with 4 digits past the decimal point... Though i put 2 in the doubletostring brackets. Code: Select all |
|
| Author: | tomele [ Thu Mar 15, 2018 9:36 pm ] |
| Post subject: | Normalizedouble not working |
I wouldnt code an assignment into a formatting function. No idea what that will cause. I would code it as: Code: Select all |
|
| Author: | fx805 [ Thu Mar 15, 2018 9:43 pm ] |
| Post subject: | Normalizedouble not working |
i did try it that way also.. I tried it both ways.. Code: Select all Code: Select all Thanks for taking your time to take a look.. |
|
| Author: | fx805 [ Fri Mar 16, 2018 12:57 am ] |
| Post subject: | Normalizedouble not working |
This is getting weirder and weirder.. Do you think it could be a bug on Empty4? Can some of you guys try this code and see what you get on the screen... As you can see in the code im just using a static value for Balance and on the screen its showing the whole number and not reducing it down to the 2 digits the doubletostring(,2) is asking for.. This makes me wonder what other functions are working wonky.. ps-- i tried this on two different Empty4 terminals-- both using the current build and got the same resluts. Code: Select all |
|
| Author: | renexxxx [ Fri Mar 16, 2018 1:11 am ] |
| Post subject: | Normalizedouble not working |
Just use StringFormat() as in: Code: Select all Rene. |
|
| Author: | SteveHopwood [ Fri Mar 16, 2018 1:22 am ] |
| Post subject: | Normalizedouble not working |
This is an example of: One of the best coders available anywhere as shown you the way forward Best to take notice of what he says. I do. |
|
| Author: | SteveHopwood [ Fri Mar 16, 2018 11:56 pm ] |
| Post subject: | Normalizedouble not working |
I just noticed that this thread got locked somehow. No idea how. It might have been me - don't remember locking it. It might have been someone else. It might have been the software. No idea. Whatever the cause, it is open again. It looks like a useful discussion. |
|
| Author: | tomele [ Sat Mar 17, 2018 12:39 am ] |
| Post subject: | Normalizedouble not working |
The thread is open again? Great, I am in the mood to rant a little bit. Every time I or someone else suspected a bug in Empty4 it turned out to be inability to read the manual. Well, some few exceptions admitted. First RTFM !!!!! You will never learn to code if you ignore the language reference. Examples below. DoubleToString does nothing until you assign the result like in: Code: Select all Code: Select all I closed that thread again and have the utter craving to defy every post wanting to help you. If any of the admins/mods wants to reopen it again, please do so. If you understand how to put those pieces together, you will have on your screen what you want. And maybe a brilliant MQ4 coder career ahead. If not, you better start a bricklayer career. Usually there is more money earned than in trading Forex. Let me know the outcome by PM. Cheers |
|
| All times are UTC | Page 1 of 2 |
|
Powered by phpBB® Forum Software © phpBB Limited |
|