Results 1 to 9 of 9
 3 Attachment(s)    

Thread: Best ways to manage multiple EA's over total investment?

  1. #1

    Default Best ways to manage multiple EA's over total investment?

    Perhaps a simple question, but i guess there are many ways to accomplish this, and i am wondering what methods there are for the following example:

    Suppose we have collected 20 different profitable EA's and we have an investment of 36000 Dollar.
    Suppose we want to divide this investment as follows:

    5 EA's should each have 3000 Dollar to work with.
    6 EA's should each have 2000 Dollar to work with.
    9 EA's should each have 1000 Dollar to work with.

    We want to be flexible with the amount that we allow each EA to work with, and each EA should never use more.

    How can we accomplish this? Maybe certain additional software?

  2. #2
    Administrator funyoo's Avatar
    Join Date
    Sep 2008
    Posts
    7,003

    Default

    Quote Originally Posted by CycleTrader View Post
    Perhaps a simple question, but i guess there are many ways to accomplish this, and i am wondering what methods there are for the following example:

    Suppose we have collected 20 different profitable EA's and we have an investment of 36000 Dollar.
    Suppose we want to divide this investment as follows:

    5 EA's should each have 3000 Dollar to work with.
    6 EA's should each have 2000 Dollar to work with.
    9 EA's should each have 1000 Dollar to work with.

    We want to be flexible with the amount that we allow each EA to work with, and each EA should never use more.

    How can we accomplish this? Maybe certain additional software?
    Hi CycleTrader,

    You have to adapt the money management function in each EA to the wanted capital. For example in my function :

    Code:
    double lotsoptimized(){
       double lot;
       if(stoploss>0)lot=AccountBalance()*(risk/100)/(stoploss*pt/MarketInfo(Symbol(),MODE_TICKSIZE)*MarketInfo(Symbol(),MODE_TICKVALUE));
       else lot=NormalizeDouble((AccountBalance()/lotsize)*minlot*risk,lotdigits);
       return(lot);
    }
    Code:
    AccountBalance()
    Should be replaced by :

    Code:
    balance
    And this line should be added in the extern parameters :

    Code:
    extern double balance=3000;

  3. #3

    Default

    Many thanks Funyoo,

    I will test it.

  4. #4
    Junior Member
    Join Date
    Nov 2009
    Posts
    16

    Default

    Hi

    Anybady knows how to calculate balance and equitity for each EA indyvidualy. I would like to size the position based on individual equitity calcualation for each EA runing them symulanusly on thesame account.

    Thanks in advance

  5. #5
    Administrator funyoo's Avatar
    Join Date
    Sep 2008
    Posts
    7,003

    Default

    Quote Originally Posted by Misiek80 View Post
    Hi

    Anybady knows how to calculate balance and equitity for each EA indyvidualy. I would like to size the position based on individual equitity calcualation for each EA runing them symulanusly on thesame account.

    Thanks in advance
    Hi Misiek80,

    You can define a first balance in Init that you use to calculate the risk management.

    Code:
    GlobalVariableSet("InitialBalance",AccountBalance());
    Then you calculate the closed profits in Start for the current magic number, you add it to the first balance and you get the last balance.

    Code:
    closeprofits=0;
    
    if(OrdersHistoryTotal()>0){
       for(i=0;i<=OrdersHistoryTotal();i++){
          OrderSelect(i,SELECT_BY_POS,MODE_HISTORY);
          if(OrderSymbol()==Symbol() && OrderMagicNumber()==magic){
                closeprofits=closeprofits+OrderProfit();
          }
       }
    }
    Code:
    GlobalVariableSet("Balance",GlobalVariableGet("InitialBalance")+closedprofits);
    And the current profits to get the equity.

    Code:
    openprofits=0;
    
    if(OrdersTotal()>0){
       for(i=0;i<=OrdersTotal();i++){
          OrderSelect(i,SELECT_BY_POS,MODE_TRADES);
          if(OrderSymbol()==Symbol() && OrderMagicNumber()==magic && OrderCloseTime()==0){
              openprofits=openprofits+OrderProfit();
          }
       }
    }
    Code:
    GlobalVariableSet("Equity",GlobalVariableGet("Balance")+openprofits);
    Code:
    initialbalance=GlobalVariableGet("InitialBalance");
    balance=GlobalVariableGet("Balance");
    equity=GlobalVariableGet("Equity");

  6. #6
    Junior Member
    Join Date
    Nov 2009
    Posts
    16

    Default

    Thanks Funyoo,

    It's working.

  7. #7
    Member
    Join Date
    Mar 2009
    Location
    Florida, USA
    Posts
    278

    Default

    Here try this, this should help A LOT.
    Attached Files Attached Files
    Think of adversity as that tiny piece of sand that gets trapped in the oyster's shell. Although it's a pain in the oyster's arse, he eventually makes a pearl out of it.

    http://hft.serialcoder.com/ -- Quantitative Market Reversal Levels --- The only indicator you'll ever need.

  8. #8
    Junior Member
    Join Date
    Nov 2009
    Posts
    16

    Default

    Hi

    Thanks bigpipn.
    I have got one more question. Has anybody got indicator that could draw leverage used during trading. Currently I'm using attached indicator for account overview. Would it be possible to add that function to the script. I'm also having issues with missing historic data (usualy when demo account disconets), than the indicator crashes.
    Attached Files Attached Files

  9. #9

    Default

    Hi Funyoo,

    As a follow-up to my above question, i suppose this is almost the same:

    I run Attached EA on M5 EU on two charts, one chart for longs and the other for shorts.

    For instance, the startbalance of 10K can fall to 7K easily, but it is also capable of going back from 7K to 13K relatively fast, i've seen such happen regularly.

    Now, to ensure that every profit above the startbalance of 10K is safe, i could take out all profit everytime it comes above 10K, so in my example i could take 3K out of the account, and repeat this when it comes again above 10K.

    But in stead of every time taking out the profit, i would like to know if it is possible for you to change the EA's code in a way that it is not needed to actually take out the profit everytime above 10K, but instead the EA would keep the build-up profit in the account, no matter if it blows?

    Many thanks in advance.
    Attached Files Attached Files
    Last edited by CycleTrader; 09-20-2010 at 14:14.

Similar Threads

  1. 5 Ways To Trade Forex Without Emotion
    By painofhell in forum Trading discussion
    Replies: 19
    Last Post: 10-20-2017, 17:25
  2. WAYS TO LOWER YOUR RISK IN FOREX TRADING
    By painofhell in forum Trading discussion
    Replies: 8
    Last Post: 08-11-2015, 02:47
  3. 2 Ways to Trade the News
    By painofhell in forum Trading discussion
    Replies: 4
    Last Post: 05-05-2015, 18:02
  4. What is the best ways to learn forex trading?
    By shereali in forum Trading discussion
    Replies: 6
    Last Post: 07-01-2014, 13:17
  5. Total Price Action EA
    By funyoo in forum Expert advisors live statements
    Replies: 31
    Last Post: 04-09-2009, 17:38

Tags for this Thread

100, change, demo, how to, indicator, investment, magic, magic number, profit, profitable, simple, software, stoploss, test, trading

Posting Permissions

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