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

32 lines
446 B
Markdown

# 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 ...
```mql4
//
int totalBars;
//
int OnInit() {
//
totalBars = iBars(Symbol, _Period);
//
...
};
//
void OnTick() {
//
int bars = iBars(_Symbol, _Period);
if (totlaBars != bars) {
//
totalBars = bars;
//
// Do Actions here ...
}
}
```