QuantNomad

Parabolic SAR Strategy (on close) [QuantNomad]

Created a Parabolic SAR strategy where price has to close under/above the level before for it to reverse. This way it should be a bit more stable and protect you from false breakouts.
It was impossible to adjust the built-in "sar" function so I implemented PSAR from scratch. So if you're interested in how it's work inside you can check the code and probably adjust to your need if you have a custom modification of PSAR in your mind.
Remove from Favorite Scripts Add to Favorite Scripts
My YouTube: https://qntly.com/youtube
My Discord: https://qntly.com/discord
My Telegram Channel: https://qntly.com/tel
My TradingView Essential Course: https://qntly.com/tve
My Pro Indicators: https://qntly.com/proind

Comments

Hi, first of all thanks for sharing with us plebs your script. I have a question as to recognize where exactly the longs or shorts are closed. Because with the small arrows it is not clear, at least for me. I look forward to hear from you.
Reply
QuantNomad giacomo.ferrari15
@giacomo.ferrari15, order is executed on close of the bar which broke PSAR. By default orders are filled on open of the next bar.
Reply
hmmm study based on this gives a repaint warning, any reason for that?
Reply
Is it possible to adjust the script so that the starting point of the new trend is the respective closing price instead of the high/low?
Reply
why not to use when=crossunder(psar, close) for long (crossover(psar, close) for short ) using built-is sar function ?
Reply
@pabloses, Because in built-in sar function you have condition included that on touch it will revert. As result your receive both trend up/down levels in same var calculated with "touching" logic. So there is no way to use standard sar function for that.
+1 Reply
pabloses QuantNomad
@QuantNomad, Thanks, I understand. Your script actually ignores wicks.
Reply
Great!
Reply
Home Stock Screener Forex Screener Crypto Screener Economic Calendar How It Works Chart Features Pricing Refer a friend House Rules Help Center Website & Broker Solutions Widgets Charting Solutions Lightweight Charting Library Blog & News Twitter
Profile Profile Settings Account and Billing Refer a friend My Support Tickets Help Center Ideas Published Followers Following Private Messages Chat Sign Out