forex_tb: can't get it to take any trades in strategy tester?
Find out why. What are Function return values ? How do I use them ? - MQL4 forum
One problem is that your variable pips will always be zero
OrderSend(Symbol(),OP_BUY,LotSize,Ask,3,Ask-(StopLoss*pips),Ask+(TakeProfit*pips),NULL,MagicNumber,0,Red);
This means that you are trying to place trades with SL and TP at the same price as the entry
Put this in a script and see if the result is what you expect
int pips; pips = 0.00001*10; Alert(pips); pips = 0.0001; Alert(pips);
GumRai & WHRoeder, thank you both. Simple things I'm currently overlooking such as the data type.
I've changed the "pip" variable to a double.

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, my first post here.
I'm very new to trading although i've been in the gambling industry for a long time. I've just started coding with MQL4 and have been testing myself by writing basic functions, etc.
I have this code and can't get it to take any trades in strategy tester? Hoping someone is kind enough to show me where my obvious elementary mistakes are, thanks.
In the simplest of terms, the EA should open Buy trades when RSI crosses above 50, and open Sell trades when it crosses below 50. what am I missing?