Skip to content

General Discussion

Fractals.. Here code compiles without Error but it is NOT opening trade…

  • by Marin Stoyanov
  • 1 reply
  • 0 voices
  • active 6 years ago
Viewing 2 posts - 1 through 2 (of 2 total)
  • Marin Stoyanov Algo Trading Space team

    Hi, I am new to MQL4 programming. I am trying to add code to my EA using fractal. The condition is if there is NOT Up Fractal in last 4 bars , it should open BUY trade..Here code compiles without Error but it is NOT opening trade…Regards..

    here’s the code:

    bool Upfractal()
    {
    int a;
    for(a=1;a<5;a++)
    {
    if(iFractals(NULL,0,MODE_UPPER,a)!=0)
    return(true);
    }
    return(false);
    }

    void ManageOpen()
    {
    if(Upfractal()==false)
    {
    OpenPosition(OP_BUY);
    }
    }

  • Petko Aleksandrov Algo Trading Space team

    Hey Ahmed,

    I am not sure if anyone here will be able to help you with that. It is more of a trading forum instead of programming…

    We use the strategy builders EA Studio and FSB Pro to automate the strategies so we do not program by ourselves.

    Check ur FSB Pro, it has the Fractal as an indicator.

    Cheers,

Viewing 2 posts - 1 through 2 (of 2 total)

Learn the method behind the answers.

The Academy’s free courses take you from a demo account to your first Expert Advisor, taught by the traders who answer here.