- ALI ALI: Can any body
How To Ask Questions The Smart Way. (2004)
Prune pointless queries. - ALI ALI: convert thisYou 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) -
Can any body convert this pine script code to mql5:
Thank yor for your coopration
Hi, If you provide further explanations about the strategy implemented in pine script we could help much better.
But out of my knowledge about pine script I guess the following code is almost the equivalent of what you need:
#include <Trade/Trade.mqh> input int length = 12; input double LOT = 0.01; CTrade trade; int OnInit() { return(INIT_SUCCEEDED); } void OnDeinit(const int reason) {} void OnTick() { double mom0, mom1; mom0 = Momentum(length); mom1 = Momentum(length, 1); if (mom0 > 0 && mom1 > 0) { double entryPrice = SymbolInfoDouble(_Symbol, SYMBOL_ASK) + SymbolInfoDouble(_Symbol, SYMBOL_POINT); double stopLoss = SymbolInfoDouble(_Symbol, SYMBOL_ASKLOW) - SymbolInfoDouble(_Symbol, SYMBOL_POINT); if (PositionsTotal()) trade.PositionClose(_Symbol); trade.BuyStop(LOT, entryPrice, _Symbol, stopLoss); } else if (mom0 < 0 && mom1 < 0) { double entryPrice = SymbolInfoDouble(_Symbol, SYMBOL_BID) - SymbolInfoDouble(_Symbol, SYMBOL_POINT); double stopLoss = SymbolInfoDouble(_Symbol, SYMBOL_BIDHIGH) + SymbolInfoDouble(_Symbol, SYMBOL_POINT); if (PositionsTotal()) trade.PositionClose(_Symbol); trade.SellStop(LOT, entryPrice, _Symbol, stopLoss); } } //+------------------------------------------------------------------+ //| Calculate Momentum | //+------------------------------------------------------------------+ double Momentum(int length, int shift=0) { double mom = iClose(_Symbol, PERIOD_CURRENT, shift) - iClose(_Symbol, PERIOD_CURRENT, shift+length); return (mom); } //+------------------------------------------------------------------+
You may consider preventing from opening a new order on every tick by adding custom code to filter number of open orders/positions.
Good Luck!
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Can any body convert this pine script code to mql5:
Thank yor for your coopration