Help me convert something as simple as this code to martingale.....
Or get me the simplest martingale EA whose code can be used to learn this strategy..???
I know the basics algorithm, I am just unable to code it.
-
Help you with what? You haven't stated a problem, you stated a want. Show us your attempt (using the CODE button) and state the nature of your problem.
No free help (2017)Or pay someone. Top of every page is the link Freelance.
Hiring to write script - General - MQL5 programming forum (2018)We're not going to code it for you (although it could happen if you are lucky or the problem is interesting).
No free help (2017) -
Do your own research.
-
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.
-
Hedging, grid trading, same as Martingale.
Martingale, Hedging and Grid : MHG - General - MQL5 programming forum (2016)Martingale, guaranteed to blow your account eventually. If it's not profitable without, it is definitely not profitable with.
Martingale vs. Non Martingale (Simplified RoR vs Profit and the Illusions) - MQL5 programming forum (2015)Why it won't work:
Calculate Loss from Lot Pips - MQL5 programming forum (2017)
THIS Trading Strategy is a LIE... I took 100,000 TRADES with the Martingale Strategy - YouTube (2020.12.12)
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)
-
Help you with what? You haven't stated a problem, you stated a want. Show us your attempt (using the CODE button) and state the nature of your problem.
Brother.... I need statements to know if previously closed trade was loss or profit.
and I will combine it with a conditionally resettable counter variable to change the volume of next trade.
This variable will increase by a linear or exponential factor if the last trade was loss and will reset to the base value if last trade was profit.
thanks brother. pls help.
if(last trade = profit) trade volume=base value; if(last trade = loss) trade volume=trade volume*2;
just a line for how to get profit or los of last trade.
Hello
Try this:
//+------------------------------------------------------------------+ //| TradeTransaction function | //+------------------------------------------------------------------+ void OnTradeTransaction(const MqlTradeTransaction& trans, const MqlTradeRequest& request, const MqlTradeResult& result) { if( trans.symbol ==_Symbol ) if( trans.type == TRADE_TRANSACTION_DEAL_ADD ) if ( HistoryDealGetInteger(trans.deal,DEAL_ENTRY) != DEAL_ENTRY_IN ) if ( HistoryDealGetDouble(trans.deal,DEAL_PROFIT) > 0 ) { /*trade volume=base value;*/} else if ( HistoryDealGetDouble(trans.deal,DEAL_PROFIT) < 0 ) { /*trade volume=trade volume*2;*/} }
Good luck
I was looking more to apply this.
hadn't ever used any history base commands.
Struggled finding the fact that we have to select a period of history using HistorySelect().
Then i inserted the whole set of statements into ontick() and now its working perfectly.
Thanks.
![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
Help me convert something as simple as this code to martingale.....
Or get me the simplest martingale EA whose code can be used to learn this strategy..???
I know the basics algorithm, I am just unable to code it.
I tried searching but most of them are too advanced to learn from.
Please help. thanks.