SAR formula

This is how built-in S.A.R. indicator calculates S.A.R...
Remove from Favorite Scripts Add to Favorite Scripts
Thanks :)
Thanks! I highly apprecitate the code.
Thank you very much!!!
Thank you so much !!!
any idea how to inject moving average into this sar formula, have no clue to do that :/
and make it MTF
Tr0sT tahukentucky
@tahukentucky, how exactly do you want to inject moving average? you can plot(sma(close, 18))... To make it MTF just don't use high, close, open and low. Instead use security(low, TimeFrame)... I don't remember correct syntax, but you can find it in pine script reference
Hi Tr0sT,

thank you for your script. Is it possible to customize your script so I can get alert? I would need alert when SAR crosses price AND crosses SMA line. I'm not good at programing, but it should be easy task.

kind regards, Linas
Tr0sT ebayforestwaves
@ebayforestwaves, maybe if you add something like code below you will get what you want. I'm not sure, but atleast it's a direction...

SMA = sma(close, 14)
alertcondition(SAR == close and close == SMA, "SAR=price=SMA")
+3 Reply
Home Stock Screener Forex Screener Crypto Screener Economic Calendar Shows 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