Files
xMQL4/Docs/Samples/Stochastic EA Tutorial.md
T
2024-01-25 04:03:36 +03:30

446 B

Stochastic EA

we want to buy on bottom of stochastic when cross over stock with signal and sell when cross under stock with signall on top ...

//
int totalBars;

//
int OnInit() {
    //
    totalBars = iBars(Symbol, _Period);

    //
    ...
};

//
void OnTick() {
    //
    int bars = iBars(_Symbol, _Period);
    if (totlaBars != bars) {
        //
        totalBars = bars;

        //
        // Do Actions here ...
    }
}