xmd79

Sessions_for_crypto

Apr 30th, 2023
183
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.12 KB | None | 0 0
  1. // This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
  2. // © mono_i_love
  3.  
  4. //@version=5
  5. indicator(title='Sessions_for_crypto', shorttitle='Sessions_for_crypto', overlay=true)
  6.  
  7. //return UTC
  8. timeinrange(res, sess) =>
  9. not na(time(res, sess)) ? time(res, sess) : 0
  10.  
  11. doNykSession = input(defval=true, title='NY Session On')
  12. doTkySession = input(defval=true, title='TK Session On')
  13. doLdnSession = input(defval=true, title='LD Session On')
  14.  
  15. //Since cryptocurrencies are traded for 24 hours, session gives ":1234567" to specify Sunday (1) and Saturday (7).
  16. nykSession = input(title='NYK時間(UTC)', defval='1500-2300:1234567')
  17. tkySession = input(title='TKY時間(UTC)', defval='2300-0700:1234567')
  18. ldnSession = input(title='LDN時間(UTC)', defval='0700-1500:1234567')
  19.  
  20. bgcolor(doNykSession and timeinrange(timeframe.period, nykSession) ? color.red : na, transp=80)
  21. bgcolor(doTkySession and timeinrange(timeframe.period, tkySession) ? color.green : na, transp=90)
  22. bgcolor(doLdnSession and timeinrange(timeframe.period, ldnSession) ? color.yellow : na, transp=70)
  23.  
  24.  
Advertisement
Add Comment
Please, Sign In to add comment