-
Why did you post your MT4 question in the
Root /
MT5 EA section
instead of the
MQL4 section, (bottom of the Root page?)
General rules and best pratices of the Forum. - General - MQL5 programming forum
Next time post in the correct place. The moderators will likely move this thread there soon. - If you want to close the order, close it, don't modify it. Why do you want to when something on another chart changes?
- Do not trade multiple currencies in one EA.
- You can't use any {MT4: predefined variables, MT5: predefined variables,} can't use the tester, must poll (not OnTick,) and usually other problems, e.g. A problem with iBarShift - MQL4 and MetaTrader 4 - MQL4 programming forum- Page 2
- You must handle History {MT4: 4066/4073 errors: Download history in MQL4 EA - MQL4 and MetaTrader 4 - MQL4 programming forum , MT5: Timeseries and Indicators Access / Data Access - Reference on algorithmic/automated trading language for MetaTrader 5.}
- Code it to trade the chart pair only. Look at the others if you must. (Don't assume that Time[i] == iTime(otherPair,TF, i) always use iBarShift.)
- Then put it on other charts to trade the other pairs. Done.
-
Using OrdersTotal directly and/or no Magic number filtering on your
OrderSelect loop means your code is incompatible with every EA (including itself on other charts and manual
trading.)
Symbol Doesn't equal Ordersymbol when another currency is added to another seperate chart . - MQL4 and MetaTrader 4 - MQL4 programming forum
Thank you whroeder1 for the response.
1. Indeed I will make sure to use the correct platform in future...
2. Regarding closing of order with OrderClose: Does OrderClose take into account the position of the order? That is, will OrderClose add the profit of the closed order to the account total or will it just cancel the order? If that is not the case, how to add the current profit of the order to the account total when closing the order?
3. I want to close the order in the current chart because, according to my bot, the price in the other chart is performing better than the price in the current chart. I will use the same currency for all the trades in the EA by performing some currency conversions if the other chart is in a different currency.
4. I don't have knowledge of polling, please elaborate...
5. As for the rest of your comments, I will have a look at the accompanying links and try to incorporate that info into our discussion.
Regards!
What do you know about a coin called TRADER? They told me not to lose the opportunity to invest in it, in terms of security it is highly recommended and it is also free of taxes; this while the TRADERS do not convert it to Fiat currency, exemption from the profit tax for stock or speculative operations, and dividends. It only has 200 Million coins to mine, insurance for half of the other year and this amount will be exhausted.

- 2017.09.18
- www.mql5.com

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Guys I am new to MQL4 and I need help with the following, please:
1. Say an order has been opened in the USDCHF chart, I would like to be able to close it and take profit when a price change occurs, for example, in the GBPUSD chart and place an order there. How do I take profit: Do I use OrderModify or do I adjust the take profit for the order?
2. The code for my bot will be in the OnTick() function of the USDCHF chart. How do I actually send an order in the GBPUSD chart.
3. How do I make sure that (or check if) the market in the GBPUSD is not closed.
Thanks in advance...