Add a martingale

Page 5 of 5 FirstFirst ... 345
Results 41 to 46 of 46
 8 Attachment(s)    

Thread: Add a martingale

  1. #41
    Junior Member
    Join Date
    Jul 2010
    Posts
    1

    Default Help pls

    Hello FUNYOO i have these WRONGS:
    57:1;'history' - expression on global scope not allowed
    58:7;'history' - expression on global scope not allowed
    58:17;'{' - expression on global scope not allowed
    67:4;'mlots' - expression on global scope not allowed
    68:7;'martingale' - expression on global scope not allowed
    68:21;'lastprofit' - expression on global scope not allowed
    68:34;'mlots' - expression on global scope not allowed
    68:56;'lastlot' - expression on global scope not allowed
    68:64;'multiplier' - expression on global scope not allowed
    68:75;'lotdigits' - expression on global scope not allowed
    68:91;'mlots' - expression on global scope not allowed
    68:97;'lots' - expression on global scope not allowed
    68:63;'*' - both operands are to be numeric
    Please help me, thank you.


    Quote Originally Posted by funyoo View Post
    A new guide, an easier one :

    At the beginning of the code, in the extern parameters add :

    Code:
    extern bool martingale=false;          // enable the martingale
    extern double multiplier=2.0;          // multiplier used for the martingale
    extern double lotdigits=2;             // 1 for minilot, 2 for microlot
    After the extern parameters add :

    Code:
    double mlots,ilots,lastprofit,lastlot;
    
    int i,history;
    In the start body add :

    Code:
       history=OrdersHistoryTotal();
       if(history>0){
          for(i=0;i<history;i++){
             OrderSelect(i,SELECT_BY_POS,MODE_HISTORY);
             if(OrderSymbol()==Symbol() && OrderMagicNumber()==magic){
                lastprofit=OrderProfit();
                lastlot=OrderLots();
             }
          }
       }
       mlots=0;
       if(martingale && lastprofit<0)mlots=NormalizeDouble(lastlot*multiplier,lotdigits);else mlots=lots;
    In the mm function (if you have one), add :

    Code:
     && (martingale==false || (martingale && lastprofit>=0))
    Before each ordersend function, add :

    Code:
    if(martingale)ilots=mlots;else ilots=lots;
    Finally, replace lots in the ordersend function by ilots.

  2. #42
    Junior Member
    Join Date
    Jan 2010
    Posts
    13

    Exclamation Error happened to lot size when connection error appear in journal

    Any improvement on the Martingale code ?

    As when connection error and re-login many times, the Martingale Lot size will quantum leap to future as present lot size has loss in the bad connection.

    It seem like the history lot calculation re-stack and re-stack when re-login ?

  3. #43

    Default Can somebody add a lot doubling martingale to this EA? pleaaas :)

    Hi

    I read about martingale in this thread.
    Can somebody add a martingale to the attached EA

    (Martingale that does lot doubling after a loss keeps doubling the lots till one winner, then starts over)

    Thanks bub bye
    Last edited by zarathustra1983; 04-22-2012 at 18:02.

  4. #44

    Default

    Nothing Attached...

  5. #45
    Junior Member
    Join Date
    Dec 2012
    Posts
    1

    Default Can someone add a martingale strategy with this EA?

    Hi guys,

    Can someone help me to add a martingale strategy in this EA?
    I have found that this EA has got very high probability therefore martingale could be useful here.

    I've tried following the code but whenever the EA reached a certain lot size, it just stop entering trades therefore i'm no expert in programming.
    If someone are willing to help that would be great.

    Thanks in advance.

    PaTrader

  6. #46
    Junior Member
    Join Date
    May 2009
    Posts
    1

    Default

    Hi guys,

    can someone add a martingale to the attached ea please.

    thanks in advance !!
    Attached Files Attached Files

Similar Threads

  1. RSI + martingale
    By noiahei in forum Ideas for expert advisors
    Replies: 1
    Last Post: 06-21-2010, 16:01
  2. (REQ) Martingale
    By 626mx in forum Ideas for expert advisors
    Replies: 2
    Last Post: 05-05-2010, 00:40
  3. New Martingale EA
    By shaya in forum Scripts and other tools
    Replies: 0
    Last Post: 06-24-2009, 05:50
  4. ATR MA Martingale EA
    By funyoo in forum Expert advisors live statements
    Replies: 0
    Last Post: 02-19-2009, 21:40

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Add a martingale


GadgetVersus GadgetVersus France W3Ask W3Ask Brasil W3Ask Deutschland W3Ask Espaņa W3Ask France W3Ask Italia W3Ask Nederland