Skip to main content
BTC / USDTCRYPTO107,400+2.19%ETH / USDTCRYPTO3,840+2.13%SOL / USDTCRYPTO182.40−1.99%BNB / USDTCRYPTO652.30+0.66%XRP / USDTCRYPTO2.2150+1.61%DOGE / USDTCRYPTO0.3850−1.79%TON / USDTCRYPTO5.240+2.34%AVAX / USDTCRYPTO42.60−2.07%LINK / USDTCRYPTO22.40+2.28%ADA / USDTCRYPTO1.0520−1.68%TRX / USDTCRYPTO0.3300+0.92%DOT / USDTCRYPTO8.420+2.93%BTC / USDTCRYPTO107,400+2.19%ETH / USDTCRYPTO3,840+2.13%SOL / USDTCRYPTO182.40−1.99%BNB / USDTCRYPTO652.30+0.66%XRP / USDTCRYPTO2.2150+1.61%DOGE / USDTCRYPTO0.3850−1.79%TON / USDTCRYPTO5.240+2.34%AVAX / USDTCRYPTO42.60−2.07%LINK / USDTCRYPTO22.40+2.28%ADA / USDTCRYPTO1.0520−1.68%TRX / USDTCRYPTO0.3300+0.92%DOT / USDTCRYPTO8.420+2.93%
Fiyatlandırma

Parabolic SAR

Trailing stop-and-reverse trend dots — MT4, MT5, TradingView, TradeStation and MetaStock code.

Parabolic SAR is a trailing stop-and-reverse dot that accelerates toward price over time; dots below price mark an uptrend, dots above mark a downtrend. It works both as a trend filter and a dynamic trailing stop, flipping sides when price crosses it. Copy the version for your platform.

Pine Script
//@version=5
indicator("Parabolic SAR", overlay=true)
psar = ta.sar(0.02, 0.02, 0.2)
plot(psar, title="SAR", style=plot.style_cross, color=color.orange)
MQL4 · ParabolicSAR.mq4
#property indicator_chart_window
#property indicator_buffers 1

extern double SAR_Step = 0.02;
extern double SAR_Max = 0.2;
double SarBuffer[];

int OnInit() {
  SetIndexBuffer(0, SarBuffer);
  return 0;
}

int OnCalculate(const int rates_total, const int prev_calculated, const double &close[]) {
  for (int i = prev_calculated; i < rates_total; i++)
    SarBuffer[i] = iSAR(NULL, 0, SAR_Step, SAR_Max, i);
  return rates_total;
}
MQL5 · ParabolicSAR.mq5
#property indicator_chart_window
#property indicator_buffers 1

input double SAR_Step = 0.02;
input double SAR_Max = 0.2;
double SarBuffer[];

int OnInit() {
  SetIndexBuffer(0, SarBuffer);
  return INIT_SUCCEEDED;
}

int OnCalculate(const int rates_total, const int prev_calculated,
  const datetime &time[], const double &open[], const double &high[],
  const double &low[], const double &close[], const long &tick_volume[],
  const long &volume[], const int &spread[]) {
  for (int i = prev_calculated; i < rates_total; i++)
    SarBuffer[i] = iSAR(NULL, 0, SAR_Step, SAR_Max, i);
  return rates_total;
}
EasyLanguage
inputs: AfStep(0.02), AfMax(0.2);
variables: MySAR(0);
MySAR = ParabolicSAR(AfStep, AfMax);
Plot1(MySAR, "Parabolic SAR");
MetaStock
{Parabolic SAR}
psar := SAR(0.02, 0.2);
psar

To use it inside dtcharts, paste any version into the Script Converter and it becomes a native indicator on your chart.