PINE LIBRARY
Atualizado NYCSession

Library "NYCSession"
Library for New York trading session time functions
Author abneralvarado
version 1.0
isInNYSession(sessionStart, sessionEnd)
Determines if the current bar is within New York trading session
Parameters:
sessionStart (simple int): Starting time of NY session in 24hr format (HHMM) like 0930 for 9:30 AM ET
sessionEnd (simple int): Ending time of NY session in 24hr format (HHMM) like 1600 for 4:00 PM ET
Returns: True if current bar is within the NY session time, false otherwise
getNYSessionStartTime(lookback, sessionStart)
Gets the start time of NY session for a given bar
Parameters:
lookback (simple int): Bar index to check (0 is current bar)
sessionStart (simple int): Starting time of NY session in 24hr format (HHMM)
Returns: Unix timestamp for the start of NY session on the given bar's date
getNYSessionEndTime(lookback, sessionEnd)
Gets the end time of NY session for a given bar
Parameters:
lookback (simple int): Bar index to check (0 is current bar)
sessionEnd (simple int): Ending time of NY session in 24hr format (HHMM)
Returns: Unix timestamp for the end of NY session on the given bar's date
isNYSessionOpen(sessionStart)
Checks if current bar opens the NY session
Parameters:
sessionStart (simple int): Starting time of NY session in 24hr format (HHMM)
Returns: True if current bar marks the session opening, false otherwise
isNYSessionClose(sessionEnd)
Checks if current bar closes the NY session
Parameters:
sessionEnd (simple int): Ending time of NY session in 24hr format (HHMM)
Returns: True if current bar marks the session closing, false otherwise
isWeekday()
Determines if the current day is a weekday (Mon-Fri)
Returns: True if current bar is on a weekday, false otherwise
getSessionBackgroundColor(sessionStart, sessionEnd, bgColor)
Gets session background color with transparency
Parameters:
sessionStart (simple int): Starting time of NY session in 24hr format (HHMM)
sessionEnd (simple int): Ending time of NY session in 24hr format (HHMM)
bgColor (color): Background color for session highlighting
Returns: Color value for background or na if not in session
Library for New York trading session time functions
Author abneralvarado
version 1.0
isInNYSession(sessionStart, sessionEnd)
Determines if the current bar is within New York trading session
Parameters:
sessionStart (simple int): Starting time of NY session in 24hr format (HHMM) like 0930 for 9:30 AM ET
sessionEnd (simple int): Ending time of NY session in 24hr format (HHMM) like 1600 for 4:00 PM ET
Returns: True if current bar is within the NY session time, false otherwise
getNYSessionStartTime(lookback, sessionStart)
Gets the start time of NY session for a given bar
Parameters:
lookback (simple int): Bar index to check (0 is current bar)
sessionStart (simple int): Starting time of NY session in 24hr format (HHMM)
Returns: Unix timestamp for the start of NY session on the given bar's date
getNYSessionEndTime(lookback, sessionEnd)
Gets the end time of NY session for a given bar
Parameters:
lookback (simple int): Bar index to check (0 is current bar)
sessionEnd (simple int): Ending time of NY session in 24hr format (HHMM)
Returns: Unix timestamp for the end of NY session on the given bar's date
isNYSessionOpen(sessionStart)
Checks if current bar opens the NY session
Parameters:
sessionStart (simple int): Starting time of NY session in 24hr format (HHMM)
Returns: True if current bar marks the session opening, false otherwise
isNYSessionClose(sessionEnd)
Checks if current bar closes the NY session
Parameters:
sessionEnd (simple int): Ending time of NY session in 24hr format (HHMM)
Returns: True if current bar marks the session closing, false otherwise
isWeekday()
Determines if the current day is a weekday (Mon-Fri)
Returns: True if current bar is on a weekday, false otherwise
getSessionBackgroundColor(sessionStart, sessionEnd, bgColor)
Gets session background color with transparency
Parameters:
sessionStart (simple int): Starting time of NY session in 24hr format (HHMM)
sessionEnd (simple int): Ending time of NY session in 24hr format (HHMM)
bgColor (color): Background color for session highlighting
Returns: Color value for background or na if not in session
Notas de Lançamento
v2Notas de Lançamento
v3Removed:
isWeekday()
Determines if the current day is a weekday (Mon-Fri)
Biblioteca do Pine
No verdadeiro espirito do TradingView, o autor desse código Pine o publicou como uma biblioteca de código aberto, para que outros programadores Pine da nossa comunidade possam reusa-los. Parabéns ao autor! Você pode usar essa biblioteca privadamente ou em outras publicações de código aberto, mas a reutilização desse código em publicações é regida pelas Regras da Casa.
Aviso legal
As informações e publicações não devem ser e não constituem conselhos ou recomendações financeiras, de investimento, de negociação ou de qualquer outro tipo, fornecidas ou endossadas pela TradingView. Leia mais em Termos de uso.
Biblioteca do Pine
No verdadeiro espirito do TradingView, o autor desse código Pine o publicou como uma biblioteca de código aberto, para que outros programadores Pine da nossa comunidade possam reusa-los. Parabéns ao autor! Você pode usar essa biblioteca privadamente ou em outras publicações de código aberto, mas a reutilização desse código em publicações é regida pelas Regras da Casa.
Aviso legal
As informações e publicações não devem ser e não constituem conselhos ou recomendações financeiras, de investimento, de negociação ou de qualquer outro tipo, fornecidas ou endossadas pela TradingView. Leia mais em Termos de uso.