Results 1 to 8 of 8
 4 Attachment(s)    

Thread: Candle close - Expert Advisor

  1. #1

    Default Candle close - Expert Advisor

    Hi funyoo,

    i have a little question.

    I have seen the great "Candle entry EA" and now i will ask you for a "Candle exit EA".
    I will trade manuell with the MT4 and my strategy is very simple.
    Itīs a one candle trading strategy ...

    On my Chart are some Indicators to determine the direction long or short!
    I place a trade manuell and exit it at the startcandle or the first candle after startcandle when new candle started (H1 orH4)

    My question is can you make an EA to exit automaticly on the Entrycandle, or on xx candles after startcandle, like "ReversinghoursEA" ?
    Exit by new Starting Candle for every timeframe ?
    It must be only a EXIT EA not for Entry !

    Funyoo thaanks for your great work and thanks for your answer

    Best Regards
    Sachse
    Attached Images Attached Images Candle close - Expert Advisor-exit-after-5-candles-gif Candle close - Expert Advisor-exit-on-the-entrycandle-by-new-candle-gif 
    Last edited by Sachse; 05-15-2010 at 08:51.

  2. #2

    Default

    I have now this code, but i donīt know if this code close the current starting bar by starting new bar ....
    Can this someone please check ?
    The second Picture example (Post one) is that what i mean .....



    bool New_Bar=false;
    //+------------------------------------------------------------------+
    //| expert start function |
    //+------------------------------------------------------------------+
    int start()
    {
    //------------------------------------------------------------------+
    Fun_New_Bar();
    if (New_Bar == false)
    return;
    //------------------------------------------------------------------+
    {
    //
    //Whatever Operation you want the EA to do..
    //
    }
    //----
    return(0);
    }
    //+------------------------------------------------------------------+
    void Fun_New_Bar()
    {
    static datetime New_Time = 0;
    New_Bar = false;
    if (New_Time!= Time[0])
    {
    New_Time = Time[0];
    New_Bar = true;
    }
    }
    //-------------------------------------------------------------------+

  3. #3

    Default

    I have found another EA but it is an CloseOnTime EA !
    Can somebody please fix it to close-current-Bar-by starting next bar EA ?

    __________________________________________________ ___________________________________________

    //---- input parameters
    extern int CloseHour = 7; // Time to close, hours
    extern int CloseMinute = 0; // Time to close, minutes
    extern bool UseCurrSymbol = False; // Use one symbol only
    extern bool UseOneAccount = False; // Use one account only
    extern int NumberAccount = 11111; // Account number
    extern int Slippage = 3; // Slippage
    extern color clCloseBuy = Blue; // Color of closing buy
    extern color clCloseSell = Red; // Color of closing sell

    void start() {
    double pBid, pAsk;

    if (UseOneAccount && AccountNumber()!=NumberAccount) {
    Comment("Working on the account: "+AccountNumber()+"is PROHIBITED!");
    return;
    } else Comment("");

    if (Hour()==CloseHour && Minute()>=CloseMinute) {
    for (int i=OrdersTotal()-1; i>=0; i--) {
    if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) {
    if (!UseCurrSymbol || OrderSymbol()==Symbol()) {
    if (OrderType()==OP_BUY) {
    pBid=MarketInfo(OrderSymbol(), MODE_BID);
    OrderClose(OrderTicket(), OrderLots(), pBid, Slippage, clCloseBuy);
    }
    if (OrderType()==OP_SELL) {
    pAsk=MarketInfo(OrderSymbol(), MODE_ASK);
    OrderClose(OrderTicket(), OrderLots(), pAsk, Slippage, clCloseSell);
    }
    }
    }
    }
    }
    }

    __________________________________________________ _______________________________________________


    Thaaanks
    and
    Best Regards

    SACHSE

  4. #4

    Default

    PLEASE, can somebody help me to Code this Candle Exit EA ?
    Iīm not a programer....

    Thanks
    and
    Best Regards

    SACHSE

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

    Default

    Quote Originally Posted by Sachse View Post
    Hi funyoo,

    i have a little question.

    I have seen the great "Candle entry EA" and now i will ask you for a "Candle exit EA".
    I will trade manuell with the MT4 and my strategy is very simple.
    Itīs a one candle trading strategy ...

    On my Chart are some Indicators to determine the direction long or short!
    I place a trade manuell and exit it at the startcandle or the first candle after startcandle when new candle started (H1 orH4)

    My question is can you make an EA to exit automaticly on the Entrycandle, or on xx candles after startcandle, like "ReversinghoursEA" ?
    Exit by new Starting Candle for every timeframe ?
    It must be only a EXIT EA not for Entry !

    Funyoo thaanks for your great work and thanks for your answer

    Best Regards
    Sachse
    Hi Sachse,

    Here is an EA.
    Attached Files Attached Files

  6. #6

    Default

    thanks funyoo for your great work

    Best Regards
    SACHSE

  7. #7
    Member
    Join Date
    Apr 2014
    Location
    France
    Posts
    113

    Default

    Updated without errors
    Attached Files Attached Files

  8. #8
    Junior Member
    Join Date
    Apr 2016
    Posts
    1

    Default

    Hi, I can't seem to figure out if the following scenario is possible with this EA:
    Trading only one candle, opening trades at opening of a new candle in the reverse direction of the previous candle, then closing the trade with the closing of the candle.

    Example:
    When the current candle closes bullish - enter sell order at opening of the next candle - close order at candle close - open a buy order at opening of the next candle - close order at candle close - and so on, alternating buy and sell orders.
    Vice versa if current candle is bearish.

    What would the appropriate settings be ?
    Any help would be appreciated.
    Last edited by Fuchur; 04-18-2016 at 22:18.

Similar Threads

  1. Candle Open Expert Advisor
    By funyoo in forum Expert advisors backtesting
    Replies: 42
    Last Post: 08-06-2017, 23:23
  2. Candle Stick trading Expert Advisor - FREE TRIAL!
    By instafxsk in forum Commercial expert advisors
    Replies: 0
    Last Post: 12-05-2014, 09:54
  3. Candle Patterns Expert Advisor
    By funyoo in forum Expert advisors live statements
    Replies: 23
    Last Post: 07-28-2013, 09:56
  4. Close of candle system
    By inkuumba in forum Ideas for expert advisors
    Replies: 3
    Last Post: 05-29-2012, 16:47
  5. Candle Open Expert Advisor
    By funyoo in forum Expert advisors live statements
    Replies: 0
    Last Post: 01-15-2009, 19:22

Tags for this Thread

advisor, candle, candle entry, candles, closing, color, expert, expert advisor, funyoo, indicators, mt4, simple, slippage, strategy, time, 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
  •