iAlligator

Calculates the Alligator indicator and returns its value.

Function Signature

double iAlligator(
  string        symbol,       // symbol
  int           timeframe,    // timeframe
  int           jaw_period,   // Jaw line averaging period
  int           jaw_shift,    // Jaw line shift
  int           teeth_period, // Teeth line averaging period
  int           teeth_shift,  // Teeth line shift
  int           lips_period,  // Lips line averaging period
  int           lips_shift,   // Lips line shift
  int           ma_method,    // averaging method
  int           applied_price,// applied price
  int           mode,         // line index
  int           shift         // shift
);

Parameters

  • **symbol**: Symbol name. NULL for current symbol.
  • **timeframe**: Timeframe. ENUM_TIMEFRAMES value. 0 for current chart timeframe.
  • **jaw_period**: Averaging period for the Alligator's Jaw (blue line).
  • **jaw_shift**: Shift for the Jaw line relative to the chart.
  • **teeth_period**: Averaging period for the Alligator's Teeth (red line).
  • **teeth_shift**: Shift for the Teeth line relative to the chart.
  • **lips_period**: Averaging period for the Alligator's Lips (green line).
  • **lips_shift**: Shift for the Lips line relative to the chart.
  • **ma_method**: Moving Average method. ENUM_MA_METHOD value.
  • **applied_price**: Applied price. ENUM_APPLIED_PRICE value.
  • **mode**: Data source/indicator line index. Values:
  • * MODE_GATORJAW (blue) * MODE_GATORTEETH (red) * MODE_GATORLIPS (green)
  • **shift**: Index of the value from the indicator buffer (shift relative to the current bar).
  • Returned Value

    Numerical value of the specified Alligator indicator line.

    Example

    double jaw_val = iAlligator(NULL, 0, 13, 8, 8, 5, 5, 3, MODE_SMMA, PRICE_MEDIAN, MODE_GATORJAW, 1);
    

    Related Functions

  • [iADX](/indicators/iadx)
  • [iAO](/indicators/iao)