Download MetaTrader 5

Does anyone have some code for Martingale next candle please

To add comments, please log in or register
All activity at MQL5.community is clearly visible. Have a look at the Wall!
sergiodv
283
sergiodv 2016.11.07 14:10 

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);

  } 

whroeder1
14480
whroeder1 2016.11.07 15:31  
sergiodv: have code from EABuilder
  • We hate EA builder
  • You couldn't be bothered to learn mql4, therefor there is no common language for us to communicate.
  • There are only two choices: learn to code it, or pay someone. We're not going to code it FOR you. We are willing to HELP you when you post your attempt (using SRC) and the nature of your problem, but we are not going to debug your hundreds lines of code.
  • EA builder makes bad code counting up while closing multiple orders.
  • EA builder makes bad code Bars is unreliable (max bars on chart) volume is unreliable (miss ticks) Always use time
  • EA builder makes bad code Not adjusting for 4/5 digit brokers
  • EA builder makes bad code not adjusting for ECN brokers.
  • EA builder makes bad code not checking return codes.
  • EATree uses objects on chart to save values - not persistent storage (files or GV+Flush.) No recovery (crash/reboot.)
sergiodv
283
sergiodv 2016.11.08 09:41  
whroeder1:
  • We hate EA builder
  • You couldn't be bothered to learn mql4, therefor there is no common language for us to communicate.
  • There are only two choices: learn to code it, or pay someone. We're not going to code it FOR you. We are willing to HELP you when you post your attempt (using SRC) and the nature of your problem, but we are not going to debug your hundreds lines of code.
  • EA builder makes bad code counting up while closing multiple orders.
  • EA builder makes bad code Bars is unreliable (max bars on chart) volume is unreliable (miss ticks) Always use time
  • EA builder makes bad code Not adjusting for 4/5 digit brokers
  • EA builder makes bad code not adjusting for ECN brokers.
  • EA builder makes bad code not checking return codes.
  • EATree uses objects on chart to save values - not persistent storage (files or GV+Flush.) No recovery (crash/reboot.)

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.

Carl Schreiber
6588
Carl Schreiber 2016.11.08 10:05  
sergiodv:

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.

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!!
To add comments, please log in or register