sergiodv: have code from EABuilder
|
|
whroeder1:
|
Yeah, you're probably correct but it's what I use to learn as I am not a programmer and because of it, i have been able to do some nice things but it isn't a tutor so it's impossible to get help from it.
But thanks for your opinion. I'm sure it was intended.
sergiodv:
Take better code to learn coding like already existing and published code in the articles or products. Use google to serach for an EA/Indicator/Script that might already does what you want - it is hard to find something that hasn't been coded already!!
Yeah, you're probably correct but it's what I use to learn as I am not a programmer and because of it, i have been able to do some nice things but it isn't a tutor so it's impossible to get help from it.
But thanks for your opinion. I'm sure it was intended.
![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Hi,
can anyone help with osme code to Martingale Binary Option EA on next candle.
I have code from EABuilder which will Martingale n next signal but I was looking to make this an option for next candle or next signal
This is the code from EABuilder..
Thanks
-------------------------------------------------------------------
extern double MM_Martingale_Start = 10;
extern double MM_Martingale_ProfitFactor = 1;
extern double MM_Martingale_LossFactor = 1;
extern bool MM_Martingale_RestartProfit = false;
extern bool MM_Martingale_RestartLoss = false;
extern int MM_Martingale_RestartLosses = 1000;
---------------------------------------------------------------------------------
double MM_Size() //martingale / anti-martingale
{
double lots = MM_Martingale_Start;
double MaxLot = MarketInfo(Symbol(), MODE_MAXLOT);
double MinLot = MarketInfo(Symbol(), MODE_MINLOT);
if(SelectLastHistoryTrade())
{
double orderprofit = OrderProfit();
double orderlots = OrderLots();
double boprofit = BOProfit(OrderTicket());
if(orderprofit + boprofit > 0 && !MM_Martingale_RestartProfit)
lots = orderlots * MM_Martingale_ProfitFactor;
else if(orderprofit + boprofit < 0 && !MM_Martingale_RestartLoss)
lots = orderlots * MM_Martingale_LossFactor;
else if(orderprofit + boprofit == 0)
lots = orderlots;
}
if(ConsecutiveLosses(MM_Martingale_RestartLosses))
lots = MM_Martingale_Start;
if(lots > MaxLot) lots = MaxLot;
if(lots < MinLot) lots = MinLot;
return(lots);
}