Inside Bar EA not recognizing EA?

thread: Inside Bar EA not recognizing EA?

  1. #1

    Inside Bar EA not recognizing EA?

    I'm starting small and building. (KISS)

    I can get it to recognize various setups. I can get it to recognize one set up and commerce (It works and transactions) However, when I attempt to add extra it is a near miss.

    For example:

    if(vol1 gt; vol2 cl1 lt; cl2) Order = SIGNAL_BUY; (works)


    if(vol1 gt; vol2 cl1 gt; cl1 (h1-l1/2)) Order = SIGNAL_BUY; (does not work)
    or
    if(h1 - l1 lt; h2 - l2 h2 gt; h3 vol1 lt; vol2) Order = SIGNAL_BUY; (works BUT does not comprehend pub h1 being smaller than h2)


    For Variables I have
    dual vol = iVolume(NULL, 0, Current 0);
    dual vol1 = iVolume(NULL, 0, Current 1);
    dual vol2 = iVolume(NULL, 0, Current 2);

    dual cl = iClose(NULL, 0, Current 0);
    dual cl1 = iClose(NULL, 0, Current 1);
    dual cl2 = iClose(NULL, 0, Current 2);

    dual h = iHigh(NULL, 0, Current 0);
    dual h1 = iHigh(NULL, 0, Current 1);
    double h2 = iHigh(NULL, 0, Current 2);

    double l = iLow(NULL, 0, Current 0);
    dual l1 = iLow(NULL, 0, Current 1);
    dual l2 = iLow(NULL, 0, Current 2);

    Any support will be appreciated.

  2. #2
    if(vol1 gt; vol2 cl1 gt; cl1 (h1-l1/2)) Order = SIGNAL_BUY; (does not work)
    or
    if(h1 - l1 lt; h2 - l2 h2 gt; h3 vol1 lt; vol2) Order = SIGNAL_BUY; (functions BUT does not recognize bar h1 being smaller than h2)
    First an observation - it's much easier to use High[], Close[] compared to iHigh() and iClose() and this is standard programming practice.

    I think you forgot to bracket your expression. Is this what you really meant?
    If(vol1 gt; vol2 cl1 gt; (cl1 (h1-l1/2))) Order = SIGNAL_BUY;

    Unsure about another one. If unsure use mounts than you think needed - it saves a lot of despair.

  3. #3
    Thanks!

    I will give it a try. I had been thinking maybe I needed to redefine the cl1 (h1-l1/2)) as a seperate variable prior to the if() Order_Buy.

    Thanks for the tip on high[].

  •