StrategyCoder History

← Examples

Momentum (close minus close 10 bars ago) Experimental

MQL4 → Cuprel · converter mql4 0.2.0 · converted · 3 lines out

Source (MQL4)
#property indicator_separate_window
#property indicator_buffers 1
double Mom[];
int init() {
  SetIndexBuffer(0, Mom);
  SetIndexStyle(0, DRAW_LINE);
  ArraySetAsSeries(Mom, true);
  return(0);
}
int start() {
  int limit = Bars - 10;
  for (int i = 0; i < limit; i++) {
    Mom[i] = Close[i] - Close[i + 10];
  }
  return(0);
}
Converted (Cuprel)
indicator("Converted indicator", edition = 1, overlay = false)
plot((if bar.index < 10 then na else (close - close[10])), name = "Mom")

Known differences

Experimental means: the converter reads a thin, tested slice, adds warnings, and says no when it is unsure. Run the converted program on your own data before relying on it.

Open in the converter MQL4 → Cuprel route All examples