- [Archive!] Writing an advisor for free
- [SHUTTER CLOSED!] I will implement your ideas into EAs for FREE!
- Adding up the lots...
When you post code please use the CODE button (Alt-S)!
Thank you.
You have only four choices:
-
Search for it (CodeBase or Market). Do you expect us to do your research for you?
- Try asking at:
- Coding help - MQL4 programming forum
- Requests & Ideas - 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
- Indicator to EA Free Service - General - MQL5 programming forum
- I will write an advisor free of charge - Expert Advisors and Automated Trading - MQL5 programming forum
- I will write you an advisor for free - Trading Systems - MQL5 programming forum
- I will write the indicator for free - MQL4 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.
I need HEEEELP, please, it's URGENT...really ! - General - MQL5 programming forum (2017) -
Or pay (Freelance) someone to code it. Top of every page is the link Freelance.
Hiring to write script - General - MQL5 programming forum (2019)
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)
I HAVE TRIED BELOW CODE, IT IS NOT GIVING ME RESULT THATS WHY I AKSED HERE.
//+------------------------------------------------------------------+ //| MyEA.mq4 | //| | //+------------------------------------------------------------------+ input double target = 20.0; input double lotSize = 0.01; double iniTPb = 0; // the price where target is achieved. double iniTPs = 0; // the price where target is achieved. double buypl = 0; // sum of all buy trades p/l double sellpl = 0; // sum of all sell trades p/l double currentPl = 0; double pipValue = 0; double buyLots = 0; double sellLots = 0; double futurePrice = 0; //+------------------------------------------------------------------+ //| Expert initialization function | //+------------------------------------------------------------------+ int OnInit() { EventSetTimer(1); // Set a timer to check trades every second return(INIT_SUCCEEDED); } //+------------------------------------------------------------------+ //| Expert deinitialization function | //+------------------------------------------------------------------+ void OnDeinit(const int reason) { EventKillTimer(); } //+------------------------------------------------------------------+ //| Expert timer function | //+------------------------------------------------------------------+ void OnTimer() { if(OrdersTotal() == 0) { Alert("Trade wisely."); return; } } //+------------------------------------------------------------------+ //| Expert trade function | //+------------------------------------------------------------------+ void OnTrade() { // Check if there are open trades if(OrdersTotal() > 0) { // Update P/L and Lots buypl = 0; sellpl = 0; buyLots = 0; sellLots = 0; for(int i = 0; i < OrdersTotal(); i++) { if(OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) { if(OrderType() == OP_BUY) { buypl += OrderProfit(); buyLots += OrderLots(); } else if(OrderType() == OP_SELL) { sellpl += OrderProfit(); sellLots += OrderLots(); } } } currentPl = buypl + sellpl; // Determine pip value pipValue = MarketInfo(Symbol(), MODE_TICKVALUE) * lotSize; // Calculate futurePrice for buy trades if(OrderType() == OP_BUY) { futurePrice = OrderOpenPrice(); while(currentPl < target) { futurePrice += 0.01 * Point; currentPl = buypl + (futurePrice - OrderOpenPrice()) * pipValue; } } // Calculate futurePrice for sell trades else if(OrderType() == OP_SELL) { futurePrice = OrderOpenPrice(); while(currentPl < target) { futurePrice -= 0.01 * Point; currentPl = sellpl + (OrderOpenPrice() - futurePrice) * pipValue; } } // Set TP for all trades for(int j = 0; j < OrdersTotal(); j++) { if(OrderSelect(j, SELECT_BY_POS, MODE_TRADES)) { if(OrderType() == OP_BUY) { OrderModify(OrderTicket(), OrderOpenPrice(), 0, futurePrice, 0, clrNONE); } else if(OrderType() == OP_SELL) { OrderModify(OrderTicket(), OrderOpenPrice(), 0, futurePrice, 0, clrNONE); } } } } else { Alert("Trade wisely."); } } //+------------------------------------------------------------------+
![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use