Results 1 to 4 of 4
 0 Attachment(s)    

Thread: Close of candle system

  1. #1
    Junior Member
    Join Date
    Dec 2008
    Posts
    11

    Default Close of candle system

    Hey Funyoo,

    I was trying to code an EA by inserting the following main signal in your EA system. I hope I am not infriging too much on your rights.

    The problem is I want the EA to close any open trade at the end of the candle even if the trade does not reach take profit .

    Is it possible to suggets how one may acheive this with your EA system.

    Or use my main signal to produce an EA so others may try it out. It shows good potential on 30M or H1 with the proper stoploss.

    Thanks,

    inkuumba


    //main signal
    string SBUY="false";string SSEL="false";
    bool buy= Open[1]-Close[1]>0&&High[1]-Low[1]>=15*Point&&Bid >= Close[1]+SignalPips*Point &&
    Bid <= Close[1]+SignalPips*Point+Slippage*Point&&Low[0]<=Low[1]&&High[0]<Close[1]+(Slippage+SignalPips)*Point&&MathAbs(Close[1]-Open[0])<Slippage*Point;
    bool sell= Close[1]-Open[1]>0&&High[1]-Low[1]>=15*Point&&Bid <= Close[1]-SignalPips*Point &&
    Bid >= Close[1]-SignalPips*Point-Slippage*Point&&High[0]>=High[1]&&Low[0]>Close[1]-(Slippage+SignalPips)*Point&&MathAbs(Close[1]-Open[0])<Slippage*Point;
    if(buy)SBUY="true";
    if(sell)SSEL="true";

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

    Default

    Quote Originally Posted by inkuumba View Post
    Hey Funyoo,

    I was trying to code an EA by inserting the following main signal in your EA system. I hope I am not infriging too much on your rights.
    Hi inkuumba,

    No pb, as long as you don't erase the header (of course you can add "modified by inkuumba") and you don't sell it.

    Quote Originally Posted by inkuumba View Post
    The problem is I want the EA to close any open trade at the end of the candle even if the trade does not reach take profit .

    Is it possible to suggets how one may acheive this with your EA system.

    Or use my main signal to produce an EA so others may try it out. It shows good potential on 30M or H1 with the proper stoploss.

    Thanks,

    inkuumba


    //main signal
    string SBUY="false";string SSEL="false";
    bool buy= Open[1]-Close[1]>0&&High[1]-Low[1]>=15*Point&&Bid >= Close[1]+SignalPips*Point &&
    Bid <= Close[1]+SignalPips*Point+Slippage*Point&&Low[0]<=Low[1]&&High[0]<Close[1]+(Slippage+SignalPips)*Point&&MathAbs(Close[1]-Open[0])<Slippage*Point;
    bool sell= Close[1]-Open[1]>0&&High[1]-Low[1]>=15*Point&&Bid <= Close[1]-SignalPips*Point &&
    Bid >= Close[1]-SignalPips*Point-Slippage*Point&&High[0]>=High[1]&&Low[0]>Close[1]-(Slippage+SignalPips)*Point&&MathAbs(Close[1]-Open[0])<Slippage*Point;
    if(buy)SBUY="true";
    if(sell)SSEL="true";
    This is a good question.

    I suggest you to close the order with this :

    Code:
    int m,s,k;
    m=Time[0]+Period()*60-TimeCurrent();
    s=m%60;
    m=(m-m%60)/60;
    condition :

    Code:
    (m==0 && s<10)
    It will close the order in the 10 last seconds of the bar before the close.

  3. #3
    Junior Member
    Join Date
    Dec 2008
    Posts
    11

    Default

    Thanks for the bit of code Funyoo. It works

    inkuumba

  4. #4

    Default

    ..........
    Last edited by tonycashflow; 07-14-2012 at 03:14.

Similar Threads

  1. Candle close - Expert Advisor
    By Sachse in forum Ideas for expert advisors
    Replies: 7
    Last Post: 04-18-2016, 22:09
  2. Replies: 0
    Last Post: 09-14-2010, 14:14
  3. (ASK) close all on candle color change
    By zoop in forum MQL programming
    Replies: 0
    Last Post: 02-24-2010, 18:15
  4. Open Position at Close Candle
    By Xandra in forum Ideas for expert advisors
    Replies: 1
    Last Post: 12-30-2009, 06:50

Tags for this Thread

candle, funyoo, high, main, profit, signal, slippage, stoploss, system, time

Posting Permissions

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