+ Reply to Thread
Results 1 to 2 of 2
 2 Attachment(s)    

Thread: Balance/Equity EA for multiple EA's

  1. #1
    Member
    Join Date
    Dec 2008
    Posts
    120

    Default Balance/Equity EA for multiple EA's

    Hi Funyoo,

    Do you think you could code this Balance/Equity custom indy into an EA please. Basically the EA can be use for one or several EA's.

    The Idea is to close all open positions once the differences between the Balance and Equity reaches a specified target via extern option, as you can see in the picture the bold green line is the balance amount and the red line is the equity. As the red line moves down away from the balance line the more profit gained.

    I think this is a good tool for multiple EA's runing, once the specified target is reached this EA closes all positions, then the other EA's start buying or selling again.

    Please use the current indy's extern options all well because you need to specify your acount balance first. Hope you can spare some time for this

    Cheers.
    Attached Images  
    Attached Files

  2. #2
    Member
    Join Date
    Jan 2009
    Posts
    151

    Default

    You don't need to use the indicator to do this. Somebody asked on a different forum some time back how you would do a similar sort of thing once the profit reached a certain level.

    I pasted the following block of code for him to use in an EA.

    Code:
    int start()
    
    {
    if(AccountEquity()-AccountBalance()>=ACCOUNTPROFITDOLLARS)
    CloseAll();
    
    else return(0);
    }
    
    void CloseAll()
    
    {
    int total = OrdersTotal();
    for (int cnt = 0 ; cnt < total ; cnt++)
    {
    OrderSelect(cnt,SELECT_BY_POS,MODE_TRADES);
    
    if(OrderType()==OP_BUY)
    OrderClose(OrderTicket(),OrderLots(),Bid,Slippage, Color);
    if(OrderType()==OP_SELL) 
    OrderClose(OrderTicket(),OrderLots(),Ask,Slippage, Color);
    }
    }
    You would need to define "ACCOUNTPROFITDOLLARS" as an external integer (dollars only) or double (dollars and cents) in Global Scope first.

    If you also wanted to incorporate the account balance into the conditions then this is easy too.
    PipRider.com - The home of the PipRider EA. From $100 to over $1m in 10 year backtest, and it works LIVE too!!

+ Reply to Thread

Similar Threads

  1. Balance and Equity in the strategy tester
    By funyoo in forum Indicators
    Replies: 0
    Last Post: 04-18-2009, 12:49
  2. ACS & Silver Trend EA's
    By bnbb2004 in forum Ideas for expert advisors
    Replies: 8
    Last Post: 01-15-2009, 00:42

Posting Permissions

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