double alt_bid ; double alt_ask ;the problem is definitely not in the platform u using
It does not work in new version mt4 client of FXCM though It was working perfectly before.
http://download.fxcorporate.com/FXCM-MT4Install.exe
Excuse my disbelief of your statement that "it was working perfectly before". You have the same uninitialized variable alt_ask for every single order, which include buys and sells. That has NEVER worked. Obviously the Bid and Ask prices have to be changed according to each currency. If something like the code above used to work then somebody has deleted the important parts where the Bid and Ask prices were set.
The only answer I have if this EXACT code did ever work with another broker is that the uninitialized variable is set to zero by the compiler (not guaranteed) and the broker accepts 0 as buy or sell at market (not a valid method).
uninitialized variable is set to zero by the compiler (not guaranteed)
Thank you all very much! Could you give me a complete and correct script that could work in MT4 of FXCM, PLEASE!
This never worked on FXCM before or now.
Try this on each one of your OrderSend() function so you know what error you are getting!
#include <stdlib.mqh> #include <WinUser32.mqh> int ticket11=OrderSend("EURUSD",OP_BUY,0.01,alt_ask,3,0,0,"OneKeyBuyMorePairs",255,0,CLR_NONE); if(ticket11<1) { int error=GetLastError(); Print("Error = ",ErrorDescription(error)); return; }
Maybe you will get an error like this.
2012.02.01 22:43:35 OneKeyBuyMorePairs EURUSD,M5: Error = invalid price
Then you can look at a sample script that comes with the product. Maybe the one called trade.mq4 and look at the OrderSend( ) in that file then look back at yours and find the difference?
Hint!!! it's between Lots and Slippage. That would be the 0.01 and 3.
Then you will get this many times.
2012.02.01 22:44:25 OneKeyBuyMorePairs EURUSD,M5: open #600114 buy 0.01 EURUSD at 1.31842 ok
That looks like it took 50 seconds to get that to work.
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
It does not work in new version mt4 client of FXCM though It was working perfectly before.
http://download.fxcorporate.com/FXCM-MT4Install.exe