Help you with what? You haven't stated a problem, you stated a want.
How To Ask Questions The Smart Way. (2004)
Prune pointless queries.
You have only four choices:
-
Search for it (CodeBase or Market). Do you expect us to do your research for you?
- Beg at:
- Coding help - MQL4 programming forum
- Make It No Repaint Please! - MQL4 programming forum
- MT4 to MT5 code converter - MQL5 programming forum
- Please fix this indicator or EA - General - MQL5 programming forum
- Requests & Ideas (MQL5 only!) - Expert Advisors and Automated Trading - MQL5 programming forum
-
MT4: Learn to code it.
MT5: Begin learning to code it.If you don't learn MQL4/5, there is no common language for us to communicate. If we tell you what you need, you can't code it. If we give you the code, you don't know how to integrate it into your code.
-
or pay (Freelance) someone to code it. Top of every page is the link Freelance.
Hiring to write script - General - MQL5 programming forum (2019.08.21)
We're not going to code it for you (although it could happen if you are lucky or the problem is interesting.) We are willing to help you when you post your attempt (using CODE button) and state the nature of your problem.
No free help (2017.04.21)
Hi,
Anyone have a script for MT5 to close ONLY All Profit position no matter in buy or sell position? Please help to reply me if anyone can create the script for it.
Thanks,
Forum on trading, automated trading systems and testing trading strategies
(MQL5) Close when position reaches a specified profit
Vladimir Karputov, 2020.11.08 06:17
Please insert the code correctly (use the button ) - the first time I corrected your text and applied the button .
An example of an Expert Advisor (this is an Expert, not a Script !!!). The EA checks the positions for all symbols and for all Magic Numbers.
//+------------------------------------------------------------------+ //| Close Profitable Position.mq5 | //| Copyright © 2020, Vladimir Karputov | //+------------------------------------------------------------------+ #property copyright "Copyright © 2020, Vladimir Karputov" #property version "1.000" /* barabashkakvn Trading engine 3.143 */ #include <Trade\PositionInfo.mqh> #include <Trade\Trade.mqh> //--- CPositionInfo m_position; // object of CPositionInfo class CTrade m_trade; // object of CTrade class //--- input parameters input double InpProfitInMoney = 9; // Profit in money //+------------------------------------------------------------------+ //| Expert initialization function | //+------------------------------------------------------------------+ int OnInit() { //--- //--- return(INIT_SUCCEEDED); } //+------------------------------------------------------------------+ //| Expert deinitialization function | //+------------------------------------------------------------------+ void OnDeinit(const int reason) { //--- } //+------------------------------------------------------------------+ //| Expert tick function | //+------------------------------------------------------------------+ void OnTick() { //--- for(int i=PositionsTotal()-1; i>=0; i--) // returns the number of current positions if(m_position.SelectByIndex(i)) // selects the position by index for further access to its properties { double profit=m_position.Commission()+m_position.Swap()+m_position.Profit(); if(profit>=InpProfitInMoney) m_trade.PositionClose(m_position.Ticket()); } } //+------------------------------------------------------------------+
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hi,
Anyone have a script for MT5 to close ONLY All Profit position no matter in buy or sell position? Please help to reply me if anyone can create the script for it.
Thanks,