Your OrderSend() parameters are wrong
ticket = OrderSend(Symbol(), OP_SELL, Lots, Bid, 3, Bid - TakeProfit * 0.5 * Point, "", 12345, 0, Green);
you have your Bid - TakeProfit * 0.5 * Point as your stoploss but there is no Take Profit where it should be.
As ubzen said, always check your tester log it would have shown ordersend errors, the tester journal probably would have too.
Problem resolved, TakeProfit variable was missing.. Thanks !
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
Hi,
I'm just starting out to use MQL4, and I want to code an EA which would act like the default Moving Average EA of MetaTrader, I have no error when I compile, but it never sends any order when I try it with the Strategy Backtester..
Here is the code:
I also wanted to know if the OrderSelect instruction was useful here ?
Thanks for help ! and sorry for my english.