The parabolic SAR is calculated almost independently for each trend in the price. When the price is in an uptrend, the SAR emerges below the price and converges upwards towards it. Similarly, on a downtrend, the SAR emerges above the price and converges downwards. At each step within a trend, the SAR is calculated one period in advance. That is, tomorrow's SAR value is built using data available today. The general formula used for this is:
SAR n+1=SAR n+ α (EP-SAR n)
where SAR n and SARn+1 represent the current period and the next period's SAR values, respectively.
EP (the extreme point) is a record kept during each trend that represents the highest value reached by the price during the current uptrend – or lowest value during a downtrend. During each period, if a new maximum (or minimum) is observed, the EP is updated with that value.
The α value represents the acceleration factor. Usually, this is set initially to a value of 0.02, but can be chosen by the trader. This factor is increased by 0.02 each time a new EP is recorded, which means that every time a new EP is observed, it will make the acceleration factor go up. The rate will then quicken to a point where the SAR converges towards the price. To prevent it from getting too large, a maximum value for the acceleration factor is normally set to 0.20. The traders can set these numbers depending on their trading style and the instruments being traded. Generally, it is preferable in stocks trading to set the acceleration factor to 0.01, so that it is not too sensitive to local decreases. For commodity or currency trading, the preferred value is 0.02.
-If the next period's SAR value is inside (or beyond) the current period or the previous period's price range, the SAR must be set to the closest price bound. For example, if in an upward trend, the new SAR value is calculated and if it results to be more than today's or yesterday's lowest price, it must be set equal to that lower boundary.
-If the next period's SAR value is inside (or beyond) the next period's price range, a new trend direction is then signaled. The SAR must then switch sides.
Upon a trend switch, the first SAR value for this new trend is set to the last EP recorded on the prior trend, EP is then reset accordingly to this period's maximum, and the acceleration factor is reset to its initial value of 0.02.
I previously released a script called "Parabolic SAR + Take Profit and Stop Loss By Nussara" which I used Parabolic SAR to enter an order and set a stop loss on the first SAR value of uptrend and users can fixed reward for taking profit. This script I use the order entry the same method as "Parabolic SAR + Take Profit and Stop Loss By Nussara", but I use the % of entry price to calculate take profit and stop loss.
Stop loss = Entry Price * (1 - stop loss)
Take profit = Entry Price * (1 + take profit)
This indicator is just a tool for technical analysis . It shouldn't be used as the only indication of trade because it causes you to lose your money. You should use other indicators to analyze together.