User login

  

Parabolic SAR

 

Trading with Parabolic SAR involves the following signals:

PSAR dot is above the price - downtrend.

PSAR dot is below the price - uptrend.

Parabolic SAR

Parabolic SAR indicator is a trend indicator, which tells Forex traders about price stop-and-reverse points as well as trend direction. Its concept of usage is easy to understand from the first look.

Parabolic SAR appears as a set of dotted lines, where each dot represents certain time period.

When price is above Parabolic SAR dots, Forex traders should be holding Long positions only. Once Parabolic SAR dots come on top of the price - it is time to change trading positions to Short.

Parabolic Sar indicator literally allows being in trade all the time.

How to trade with Parabolic SAR indicator

However, trading with Parabolic SAR is not that simple; not all Parabolic SAR reversal signals can be traded profitably.

Let's turn to advice given by the developer of Parabolic SAR indicator - J. Welles Wilder. He suggests using Parabolic SAR, first of all, for trailing stops and finding the best exits.

The way Forex traders use Parabolic SAR is by simply setting a Stop loss order at the level of the most recent SAR dot appearing on the chart. Stop is then trailed along with each new Sar dot till trend remains intact. Once Parabolic SAR indicator changes its position - SAR dots appear on the opposite side of the price - the trade is closed.

How do you determine the trend if you don't want to use ADX. Try 50 EMA. Price readings above it would suggest an uptrend, below - downtrend.

Parabolic SAR settings

So, Parabolic SAR is developed to keep stop loss level moving adjusting to new prices and thus locking profits on its way.

The formula of Parabolic SAR includes an "acceleration factor", which allows to react to market changes fast as the trend starts to accelerate. At the beginning, new Parabolic SAR dots are placed close together and then accelerate as the trend advances.

Parabolic SAR has two variables: a step and max step. Settings recommended by W.Wilder are: a step of 0.02 and the max step of 0.2.

The step sets sensitivity of Parabolic SAR indicator. If the Step is too high, Parabolic SAR becomes more sensitive and will flip back and forth more often, with lower step Parabolic SAR will become smoother. Maximum step sets a cushion between price and Parabolic SAR. The higher the max step the closer the trailing stop will be to the price.

 

Display/hide source code
<metadata>
0c301e21b7cf93fecda12909e6907316fc8efd8eafc697f85e30764b183adfeee8c6dcec72502c0c3a5ff896f192a0cf2d491970731dc9ae675a381a83f6087c52342904261ec4e6eed17b45eed29af7204f96f2e6936e0297f2eacaccbae580324000735e37a1cebdd3675a1f3da998a08ecefe96b40e30d6ea8ee0dabb1e73f396744a93c34d2c5e2c32537f1def8075193e57d8bb506c2d02fe90bddc137ed0b5a59b526e91e59be25727c2a7e7d98fc6ea843357b8d1ec8fc3a2780c016e44361c20456ad3a77f06fd8d3154d5eb6a56d9b5d5b4157bfa9dbacff7969bfc4722083634791f4e3d71e0d4b38f406fcda188e90b65c1a68ffa2b4a88ef1376744a714d543594e151255c34177855277947c382fa8f592d1971432c493bc9f5c2ed3859daaf2d594028d2bd8efc5f61b38f99fa6a05761b5828cdac9ef0720bfac47d3e5f30224fea9ad5b4b9d795ec80bc7d52640781ee284512629dfc1b75d4ad516f8bb7c3a0f59afb96234ee98c3e50a6d22251142a132f735c9efdf699fc91e9840d685d338efa99ea645a0539e281aec1eb9bacd5c7b5640d7b1c452d89fdfc8f526cfbb89bf43f4f166f5c2e86efc4a396feb3c7426205ac9dbd526063535c6c695decc0d9f985c81c79b5c175142f7e6b1eb7d88df91277a6d56242e5b64b244a2cea9e99ee2445d6a4244134147a392c4325579bebbc92ead6fbd46003543bf2823148ddaf325b55325c346216daa99aa449755531f4954733127783ccdabc52114f3d1a7f7e1f0470670ea8c7751b95ab8dbfb1850f21e5d5b38189a77b49e4d48cbdc5f4b18dbe913e5a91f083f7e2870a45c6a06d2e6210187d6706becae38a402fef81a698685486e3b2ca0474c480f293daae177290aec4f4e2d30c22fdcdd6e7eec04575b1810f3f1b2a89b5644be287ee965a2a286cf9987f0b482d87b985b9e595c7a673007d0e84f39ff083f1e480320cc0fc85aa0e7e2948e19203700a7d0f605527d8bcae9075492e4b7c04abca234d80cc2d4cf19f6007d8e6d888f381d7b8a0f42c5e4d2c4521dabf80f283cfe3826f015532592c6b0aaccb5b3e380496b98bee403883e21e7064280e6f244ac6a10a3483bf5527c6a334521c79572511744729a6c5365340337d43675bd2a051348aec680d3a487d18b9d7a3c0e580b38d1348c0e54717ffadeba45611dd8fc5845e13af8ab6eba2fe9bcb4a2b5330ed866d0cd0b7badf7506b5e9a2cf0475fe92a39780aef383781b4a270e32e6c901735a3ffe983e5b196b04611876adce7d180b35f2ce301fcab80a6fc6a00267b2c0b9dcaec0680b7a1f93e047799fa31e771e70e0847f1697f4ed8c0074335c92e08fc00878cbbf5a33a0cfadc35625b59594e7a2c7a0d07b1ac2b0dabb572390f57a47e0c27b3d07664a26daa9f792e6c4caf4dee296fab2db0e60bcd9aa8aaec01372503d92f7c8f5c2e07f3386ef7719fe9b557506373b1988a8eb88a9c6dfb30e61522090adebc91a37c5f48cba2116d4e5c8f9073ed8ebfec86a4815357d0e483c760fcba71772fec30e2c24143113f1d15324a3cacbaf05711078261b496b2d1c64465a7a4c3f522badc0eb89137cee82dde02d0fd7e5c5f434036d4f725236404029a8dbf19882e038548aef0934290bce9a85f767124f2a280a9da3506cf1debdd1a6cfec82a8cdcaf4dde1547bec85442a8aee88e17e1d4c2d691da2cda1d338771e6e3c48f59cee81e48ab4c76b5579454033f590b5c71f7637520477023ce7a166074e224033a9ccb884644b344705606012dcb501647e0d2816e0dc0e7c4c294a3ee5b1e39a2b5baacf625c03476807592ce587acc035508eb2200fa5d71376d1a52f7b5f268afaff9a3907cdf14e236001433b2d6fb2d3116334476d2f34557714f59e0937af9fe7dbf0dfbdd0cbaaa2da692bfe9f8efcfa89b7f5ccad6003b6ddd2ec5b67ff9ad8b6e081ef8d5a36dabf3677365af1949eec0773d0a3dde31e580b6a503c6013b3d60438b59aa1c4c7a91a7b4220026e0366b5f4f5996f0afe8c1f6b86f54b75e3dff693f09ef09172106d01badf2764e885483ccebc1f66b987fcbac5a4721ecbb8fc99102c8ba43752cca291f0583a0d617a1f8dcea4c9a8dc3d4f7e07be80407c482d6a04a2c3a9cbc5a967029cd5365841354d3f0c6ddfbdd9b897e595ab094f1b7a3d5182f15a3f6c500c23593ccca2026352309cf054315c15e886413546345a3b8be93b5ac7b5e1df6e52210efa973a55284c681d0e62e782457b1ab6f26bebb0b5ac482fe58dc4aa5e73
</metadata>
//+------------------------------------------------------------------+
//|                                                    Parabolic.mq4 |
//|                      Copyright © 2004, MetaQuotes Software Corp. |
//|                                       http://www.metaquotes.net/ |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2004, MetaQuotes Software Corp."
#property link      "http://www.metaquotes.net/"
 
#property indicator_chart_window
#property indicator_buffers 1
#property indicator_color1 Lime
//---- input parameters
extern double    Step=0.02;
extern double    Maximum=0.2;
//---- buffers
double SarBuffer[];
//----
int    save_lastreverse;
bool   save_dirlong;
double save_start;
double save_last_high;
double save_last_low;
double save_ep;
double save_sar;
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
//---- indicators
   SetIndexStyle(0,DRAW_ARROW);
   SetIndexArrow(0,159);
   SetIndexBuffer(0,SarBuffer);
//----
   return(0);
  }
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
void SaveLastReverse(int last,int dir,double start,double low,double high,double ep,double sar)
  {
   save_lastreverse=last;
   save_dirlong=dir;
   save_start=start;
   save_last_low=low;
   save_last_high=high;
   save_ep=ep;
   save_sar=sar;
  }
//+------------------------------------------------------------------+
//| Parabolic Sell And Reverse system                                |
//+------------------------------------------------------------------+
int start()
  {
   static bool first=true;
   bool   dirlong;
   double start,last_high,last_low;
   double ep,sar,price_low,price_high,price;
   int    i,counted_bars=IndicatorCounted();
//----
   if(Bars<3) return(0);
//---- initial settings
   i=Bars-2;
   if(counted_bars==0 || first)
     {
      first=false;
      dirlong=true;
      start=Step;
      last_high=-10000000.0;
      last_low=10000000.0;
      while(i>0)
        {
         save_lastreverse=i;
         price_low=Low[i];
         if(last_low>price_low)   last_low=price_low;
         price_high=High[i];
         if(last_high<price_high) last_high=price_high;
         if(price_high>High[i+1] && price_low>Low[i+1]) break;
         if(price_high<High[i+1] && price_low<Low[i+1]) { dirlong=false; break; }
         i--;
        }
      //---- initial zero
      int k=i;
      while(k<Bars)
        {
         SarBuffer[k]=0.0;
         k++;
        }
      //---- check further
      if(dirlong) { SarBuffer[i]=Low[i+1]; ep=High[i]; }
      else        { SarBuffer[i]=High[i+1]; ep=Low[i]; }
      i--;
     }
    else
     {
      i=save_lastreverse;
      start=save_start;
      dirlong=save_dirlong;
      last_high=save_last_high;
      last_low=save_last_low;
      ep=save_ep;
      sar=save_sar;
     }
//----
   while(i>=0)
     {
      price_low=Low[i];
      price_high=High[i];
      //--- check for reverse
      if(dirlong && price_low<SarBuffer[i+1])
        {
         SaveLastReverse(i,true,start,price_low,last_high,ep,sar);
         start=Step; dirlong=false;
         ep=price_low;  last_low=price_low;
         SarBuffer[i]=last_high;
         i--;
         continue;
        }
      if(!dirlong && price_high>SarBuffer[i+1])
        {
         SaveLastReverse(i,false,start,last_low,price_high,ep,sar);
         start=Step; dirlong=true;
         ep=price_high; last_high=price_high;
         SarBuffer[i]=last_low;
         i--;
         continue;
        }
      //---
      price=SarBuffer[i+1];
      sar=price+start*(ep-price);
      if(dirlong)
        {
         if(ep<price_high && (start+Step)<=Maximum) start+=Step;
         if(price_high<High[i+1] && i==Bars-2)  sar=SarBuffer[i+1];
 
         price=Low[i+1];
         if(sar>price) sar=price;
         price=Low[i+2];
         if(sar>price) sar=price;
         if(sar>price_low)
           {
            SaveLastReverse(i,true,start,price_low,last_high,ep,sar);
            start=Step; dirlong=false; ep=price_low;
            last_low=price_low;
            SarBuffer[i]=last_high;
            i--;
            continue;
           }
         if(ep<price_high) { last_high=price_high; ep=price_high; }
        }
      else
        {
         if(ep>price_low && (start+Step)<=Maximum) start+=Step;
         if(price_low<Low[i+1] && i==Bars-2)  sar=SarBuffer[i+1];
 
         price=High[i+1];
         if(sar<price) sar=price;
         price=High[i+2];
         if(sar<price) sar=price;
         if(sar<price_high)
           {
            SaveLastReverse(i,false,start,last_low,price_high,ep,sar);
            start=Step; dirlong=true; ep=price_high;
            last_high=price_high;
            SarBuffer[i]=last_low;
            i--;
            continue;
           }
         if(ep>price_low) { last_low=price_low; ep=price_low; }
        }
      SarBuffer[i]=sar;
      i--;
     }
//   sar=SarBuffer[0];
//   price=iSAR(NULL,0,Step,Maximum,0);
//   if(sar!=price) Print("custom=",sar,"   SAR=",price,"   counted=",counted_bars);
//   if(sar==price) Print("custom=",sar,"   SAR=",price,"   counted=",counted_bars);
//----
   return(0);
  }
//+------------------------------------------------------------------+
12345

Comments