Thanks for your replies, guys. I'm not new to mql4, autotrading is allowed and now
that I changed
Jan
ticket=OrderSend(Symbol(),OP_BUY,1,Ask,3,Ask-25*Point,Ask+25*Point,"My order #2",16384,0,Green);to
OrderSend(Symbol(),OP_BUY,1,Ask,3,Ask-25*Point,Ask+25*Point,"My order #2",16384,0,Green);the orders are open in forward test. What confuses me is the fact, that with the previous version of the code they were opened in a backtest but not in live trading. To ask again, do you think the line
ticket=OrderSend(Symbol(),OP_BUY,1,Ask,3,Ask-25*Point,Ask+25*Point,"My order #2",16384,0,Green);opens the order?
Jan
janklimo:
the orders are open in forward test. What confuses me is the fact, that with the previous version of the code they were opened in a backtest but not in live trading. To ask again, do you think the line
Jan
Yes it does. Have you tried to Print the GetLastError() after that OrderSend?
the orders are open in forward test. What confuses me is the fact, that with the previous version of the code they were opened in a backtest but not in live trading. To ask again, do you think the line
ticket=OrderSend(Symbol(),OP_BUY,1,Ask,3,Ask-25*Point,Ask+25*Point,"My order #2",16384,0,Green);opens the order?
Jan
![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
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
and I used it in my expert but it seems that this code opens orders in the backtest but opens no orders in live trading. My question is whether this code only sets the value for the "ticket" variable or it opens the trade as well.
Thanks a lot.
Jan