Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes - page 496
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
Stops and TPs should be set from the open price. Many traders do not set them at the open price. Hence the unequal ratio on the spread value.
I open like this
ticket=OrderSend(Symbol(),OP_BUYLIMIT,LotsByRisk(Symbol(),Risk,sl),High[2],2,0,0,magic,0)
if(OrderSelect(ticket,SELECT_BY_TICKET,MODE_TRADES))
TP=NormalizeDouble(OrderOpenPrice()+tp*Point,Digits);
SL=NormalizeDouble(OrderOpenPrice()-sl*Point,Digits);
modify=OrderModify(ticket,OrderOpenPrice(),SL,TP,0);
I open like this
ticket=OrderSend(Symbol(),OP_BUYLIMIT,LotsByRisk(Symbol(),Risk,sl),High[2],2,0,0,magic,0)
if(OrderSelect(ticket,SELECT_BY_TICKET,MODE_TRADES))
TP=NormalizeDouble(OrderOpenPrice()+tp*Point,Digits);
SL=NormalizeDouble(OrderOpenPrice()-sl*Point,Digits);
modify=OrderModify(ticket,OrderOpenPrice(),SL,TP,0);
This is your case, you don't consider the Spread, i.e. market rules: open at Ask, close at Bid. Open at Bid, close at Ask
Forum on trading, automated trading systems and trading strategies testing.
Any questions from newbies on MQL4, Algorithms and Codes help and discussion
Vitaly Muzichenko, 2018.03.21 17:26
Alternatively, find a pair with a very large spread to get a quick understanding. Next, run the Expert Advisor in the Strategy Tester and activate the Ask line. See how and at what levels the stops and profits are triggered.
Hopefully you will quickly realise what the problem is.
This is exactly your case, you do not take into account the Spread, i.e. market rules: open at Askk, close at Bid. Opening at Bid, closing at Ask
Alternatively, find a pair with a very large spread to get a quick understanding. Next, run the Expert Advisor in the Strategy Tester and activate the Ask line. See how and at what levels the stops and profits are triggered.
Hopefully you will quickly realise what the problem is.
Hello. Maybe someone can tell me what the reason is. I have a portfolio of 20 Expert Advisors running on 7 currency pairs and opening orders on a new candlestick, but for some reason trades are not executed, although in the strategy tester it looks like the trades are executed. Thank you.
Were the magazines looked at? Have you been allowed to trade? And what does it mean
the trades are kind of happening.
Were the magazines looked at? Have you been allowed to trade? And what does it mean
So are trades being made in the tester or not? There is no third state.The log and everything else is set up, the tester's making trades.
The log and everything else is set up, in the tester performed transactions
Run Expert and see what it says in the logs: "Experts" tab and "Logbook" tab. There will most likely be an answer to the question there. If you don't understand it yourself, post the contents of the logs here.
You've gone too far with the settings )).