Yauheni

YK Round Levels

196 0 9
Displays round levels.
Remove from Favorite Scripts Add to Favorite Scripts
//@version=2
study("YK Round Levels", overlay=true)

roundLevel50 = input(25, 'Round Level 1, pips')
roundLevel100 = input(50, 'Round Level 2, pips')

rDelimeter = 1/syminfo.mintick

intRoundLevel = close * rDelimeter

intRemainder = intRoundLevel % roundLevel50 
toRound = (intRemainder >= roundLevel50/2) ? roundLevel50 : 0
roundLevel = (intRoundLevel - intRemainder + toRound) / rDelimeter
plot(roundLevel, title='Round Level 1', color=orange, style=circles, transp=0, linewidth=1)

intRemainder2 = intRoundLevel % roundLevel100
toRound2 = (intRemainder2 >= roundLevel100/2) ? roundLevel100 : 0
roundLevel2 = (intRoundLevel - intRemainder2 + toRound2) / rDelimeter
plot(roundLevel2, title='Round Level 2', color=lime, style=circles, transp=0, linewidth=1)

alertcondition((high >= roundLevel and low <= roundLevel) or (high >= roundLevel2 and low <= roundLevel2), title='Alert on the Round Level', message='Round Level!')
English
English (UK)
English (IN)
Deutsch
Français
Español
Italiano
Polski
Türkçe
Русский
Português
Bahasa Indonesia
Bahasa Melayu
ภาษาไทย
Tiếng Việt
日本語
한국어
简体
台灣
Home Stock Screener Forex Signal Finder Cryptocurrency Signal Finder Economic Calendar How It Works Chart Features House Rules Moderators Website & Broker Solutions Widgets Stock Charting Library Feature Request Blog & News FAQ Help & Wiki Twitter
Profile Profile Settings Account and Billing My Support Tickets Contact Support Ideas Published Followers Following Private Messages Chat Sign Out