Matboom

Monday range by Matboom

The "Monday Range" Pine Script indicator calculates and displays the lowest and highest prices during a specified trading session, focusing on Mondays. Users can configure the trading session parameters, such as start and end times and time zone. The indicator visually highlights the session range on the chart by plotting the session low and high prices and applying a background color within the session period. The customizable days of the week checkboxes allow users to choose which days the indicator should consider for analysis.

Session Configuration:
session = input.session("0000-0000", title="Trading Session")
timeZone = input.string("UTC", title="Time Zone")
monSession = input.bool(true, title="Mon ", group="Trading Session", inline="d1")
tueSession = input.bool(true, title="Tue ", group="Trading Session", inline="d1")
Users can configure the trading session start and end times and the time zone.
Checkboxes for Monday (monSession) and Tuesday (tueSession) sessions are provided.


SessionLow and SessionHigh Functions:
SessionLow(sessionTime, sessionTimeZone=syminfo.timezone) => ...
SessionHigh(sessionTime, sessionTimeZone=syminfo.timezone) => ...
Custom functions to calculate the lowest (SessionLow) and highest (SessionHigh) prices during a specified trading session.

InSession Function:
InSession(sessionTimes, sessionTimeZone=syminfo.timezone) => ...
Determines if the current bar is inside the specified trading session.

Days of Week String and Session String:
sessionDays = ""
if monSession
sessionDays += "2"
if tueSession
sessionDays += "3"
tradingSession = session + ":" + sessionDays
Constructs a string representing the selected days of the week for the session.

Fetch Session Low and High:
sessLow = SessionLow(tradingSession, timeZone)
sessHigh = SessionHigh(tradingSession, timeZone)
Calls the custom functions to obtain the session low and high prices.

Plot Session Low and High and Background Color for Session
plot(sessLow, color=color.red, title="Session Low")
plot(sessHigh, color=color.red, title="Session Low")
bgcolor(InSession(tradingSession, timeZone) ? color.new(color.aqua, 90) : na)

Açık kaynak kodlu komut dosyası

Gerçek TradingView ruhuyla, bu betiğin yazarı, yatırımcının anlayabilmesi ve doğrulayabilmesi için onu açık kaynak olarak yayınladı. Yazarın eline sağlık! Bunu ücretsiz olarak kullanabilirsiniz, ancak bu kodun bir yayında yeniden kullanımı Kullanım Koşulları ile yönetilir. Bir grafikte kullanmak için favorilere ekleyebilirsiniz.

Feragatname

Bilgiler ve yayınlar, TradingView tarafından sağlanan veya onaylanan finansal, yatırım, işlem veya diğer türden tavsiye veya tavsiyeler anlamına gelmez ve teşkil etmez. Kullanım Şartları'nda daha fazlasını okuyun.

Bu komut dosyasını bir grafikte kullanmak ister misiniz?