votungphan

CryptoSEE - Security function study

Some people have asked me how to correctly use security() function on multiple time frames. This script is my example to demonstrate ways to use the security() function in different contexts. Hopefully, it can help to provide a detail explanation of how the security() function with different resolutions working on the 15M Candles Chart.

Method-1:
  • Get close price thought the security() function with the time frame of 1H
  • Calculate SMA of above 1H close price with a length of 50 bars back.
  • This is to calculate 50 bars back SMA of 1H close on 15M Candle Chart
Method-2:
  • Get SMA of the close price with a length of 50 bars back, through the security() function with the time frame of 1H. This length is 50 of 1H bars back.
  • This is similar to calculate 50 bars back SMA of 1H close on 1H Candle Chart.
Method-3: is how to get Method-2 SMA from the Method-1
  • Get close price thought the security() function with the time frame of 1H
  • Calculate SMA of above 1Hclose price with a length of 50 x 1H resolution/15M candle = 50 x 4 = 200 bars back.
  • This is to calculate 200 bars back SMA of 1H close on 15M Candle Chart. This plot is same as plot in Method-2 above
Remove from Favorite Scripts Add to Favorite Scripts
My prayers have been answered. I knew someone in the Pine community would have done it. Thank you very much for this my friend
Reply
Home Stock Screener Forex Screener Crypto Screener Economic Calendar How It Works Chart Features Pricing House Rules Moderators Website & Broker Solutions Widgets Charting Solutions Help Center Feature Request Blog & News FAQ Wiki Twitter
Profile Profile Settings Account and Billing TradingView Coins My Support Tickets Help Center Ideas Published Followers Following Private Messages Chat Sign Out