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
It doesn't like the dynamic lot size?? It works with ct trade, when I use a fixed lot size.
CTrade is a wrapper to OrderSend().
You wrote that it doesn't work with a volume à 0.07 or even 1. How are you defining this ? Lot=0.07 ?
CTrade is a wrapper to OrderSend().
You wrote that it doesn't work with a volume à 0.07 or even 1. How are you defining this ? Lot=0.07 ?
It's decimals of certain complexity, I will try normalize double.
Normalize double is provided a fix for the complex decimals, I'll try it on my dynamic lot.
Fixed.
Looks like it was one of my scaling factors from some equations that lay outside of the CT Buy/Sell. It wasn't an issue that I had encountered in mql4 so it took me a while to locate it, I'll have to watch out for that if mql4 updates again.
For anyone else with this problem use 2 for the digit part of the NormalizeDouble() function.
007 you say ?
You should perhaps ask Mr Bond ;-)
I seem to be running into the same problem here. I have confirmed that the lot size meets the SYMBOL_VOLUME_MIN, SYMBOL_VOLUME_MAX and SYMBOL_VOLUME_STEP requirements.
For example I get this:
2014.04.07 14:49:35 2014.04.04 16:00:00 CTrade::OrderSend: instant sell 0.53 EURUSD at 1.36934 sl: 1.37434 tp: 1.35934 [invalid volume]
While backtesting EA with this symbol and these specifications:
Here code I am using to send order:
EDIT:
I can of course manually place trades with this exact lot size.
I seem to be running into the same problem here. I have confirmed that the lot size meets the SYMBOL_VOLUME_MIN, SYMBOL_VOLUME_MAX and SYMBOL_VOLUME_STEP requirements.
For example I get this:
2014.04.07 14:49:35 2014.04.04 16:00:00 CTrade::OrderSend: instant sell 0.53 EURUSD at 1.36934 sl: 1.37434 tp: 1.35934 [invalid volume]
While backtesting EA with this symbol and these specifications:
Here code I am using to send order:
EDIT:
I can of course manually place trades with this exact lot size.
This line is without effect :
NormalizeDouble(trade_size,DecimalPoints);
You have to affect the result to a variable, see documentation of NormalizeDouble.
trade_size=NormalizeDouble(trade_size,DecimalPoints);