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
why do you divide the lot by the lotStep and then multiply by the lot step again?
Say the lotstep is 0.1 and your calculated lot size is 0.57
Divide 0.57 by 0.1 and you will get 5.7, mathfloor will return the integer 5
multiply the 5 by 0.1 and you get 0.5 which is a valid lot size whereas 0.57 is not
why do you divide the lot by the lotStep and then multiply by the lot step again?
Say the lotstep is 0.1 and your calculated lot size is 0.57
Divide 0.57 by 0.1 and you will get 5.7, mathfloor will return the integer 5
multiply the 5 by 0.1 and you get 0.5 which is a valid lot size whereas 0.57 is not
Thanks a lot
It seems that I do not have to do it with the CDouble library.
Could you confirm?
Thanks a lot
It seems that I do not have to do it with the CDouble library.
Could you confirm?
I am the developer of the CDouble library. It's open-source so you can dive into the code for confirmation, but just to save you a bit of time...
I am the developer of the CDouble library. It's open-source so you can dive into the code for confirmation, but just to save you a bit of time...
Thanks a lot for your help.
Is is definitely more complex than I expected.
Just to be clear the code that you wrote just above, is the code I have to read to understand how it works?
and not the code I have to write in my own program?
Thanks and Sorry, I am a beginner in coding...
Luciole
Luciole: Thanks a lot for your help. Is is definitely more complex than I expected.
Just to be clear the code that you wrote just above, is the code I have to read to understand how it works?
and not the code I have to write in my own program?
Thanks and Sorry, I am a beginner in coding...
Yes, that is correct. That code which @nicholi shen has shown you, is the functionality behind the CDouble method "RoundToLots".
It is always good to know how the "engine" works before you "drive a car"!
Yes, that is correct. That code which @nicholi shen has shown you, is the functionality behind the CDouble method "RoundToLots".
It is always good to know how the "engine" works before you "drive a car"!
Exactly ! and I think I got it !
but I am not really in coding (as you probably already know)
and I was not 100% sure of that.. hi hi !
Thanks a lot for your help :)
i wrote that in my program:
#include <Double.mqh>
it is written this error message:
can't open "C:\Users\Ludivine\AppData\Roaming\MetaQuotes\Terminal\76AE827A66F7801B9D79B1FD1D2103FD\MQL4\include\Double.mqh" include file TradingGM_FOREX_VENTE.mq4 12 11
Should I download the library somewhere?
i wrote that in my program:
#include <Double.mqh>
it is written this error message:
can't open "C:\Users\Ludivine\AppData\Roaming\MetaQuotes\Terminal\76AE827A66F7801B9D79B1FD1D2103FD\MQL4\include\Double.mqh" include file TradingGM_FOREX_VENTE.mq4 12 11
Should I download the library somewhere?
Yes you need to download this file and copy it to C:\Users\Ludivine\AppData\Roaming\MetaQuotes\Terminal\76AE827A66F7801B9D79B1FD1D2103FD\MQL4\include
Yes you need to download this file and copy it to C:\Users\Ludivine\AppData\Roaming\MetaQuotes\Terminal\76AE827A66F7801B9D79B1FD1D2103FD\MQL4\include
Thanks I did and it is almost working !!! thanks a lot !
I still have some problems when I try to close some part of the lots.
What I initially wrote was :
But then, a warning message saying "return value of 'orderClose' should be checked
So I wrote that, as suggested here:
Now there is this error message "'return' - 'void' function returns a value".
I am confused as I do not understand why should I wrote return 0.. or do anything else..
Any suggestions? :)
Have picked up a few things here, will come back with questions.