0% found this document useful (0 votes)
40 views3 pages

NY Indicator

This document defines colors, variables, functions, and display settings for a trading study in TradingView. It sets colors for different sessions and markets. Variables control lookback periods and display filters. Functions create vertical lines and price lines. The display section calls the functions to mark specific times, like the NY open and end of the true trading day.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as RTF, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
40 views3 pages

NY Indicator

This document defines colors, variables, functions, and display settings for a trading study in TradingView. It sets colors for different sessions and markets. Variables control lookback periods and display filters. Functions create vertical lines and price lines. The display section calls the functions to mark specific times, like the NY open and end of the true trading day.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as RTF, PDF, TXT or read online on Scribd
You are on page 1/ 3

//@version=4

study("NY", overlay=true)

// # COLORS
###################################################################
#######################

nyColor = #c11515 //#e91e63


nyColor2 = #ef9a9a
nySessionColor = nyColor
gmtColor = #000000
trueDayColor = #c11515//#085ba4
europeColor = nyColor //#9800ff
darkGray = #434651
darkRed = #970000

// # COLORS
###################################################################
########################

// # VARS
###################################################################
##########################

daysLookback = input(title="Lookback days", type=input.integer, defval=3)


showNYopen = input(title="Show NY open", type=input.bool, defval=true)
showTuesday = input(title="Show 'tuesday special'", type=input.bool, defval=true)
showEndTrueDay = input(title="Show true day end open", type=input.bool,
defval=true)
cutLines = input(title="Hide day dividers", type=input.bool, defval=false)

gmtOpen = timestamp("America/New_York", year, month, dayofmonth, 19, 0, 0)


gmtOpen2 = timestamp("UTC", year, month, dayofmonth, 0, 0, 0)
nyOpen = timestamp("America/New_York", year, month, dayofmonth, 0, 00, 00)
trueDayEnd = timestamp("America/New_York", year, month, dayofmonth, 15, 00, 00)
europeOpen = timestamp("America/New_York", year, month, dayofmonth, 4, 00, 00)
europeOpen2 = timestamp("America/New_York", year, month, dayofmonth, 6, 00,
00)

lookBack = 86400000
lookBackDays = lookBack * daysLookback

displayLimit = timeframe.multiplier <= 120


displayCondition = timeframe.isdwm == false and displayLimit and (time > (timenow -
lookBack))
extendedDisplayCondition = timeframe.isdwm == false and displayLimit and (time >
(timenow - lookBackDays))
sessionCondition =    timeframe.multiplier <= 15 and (time > (timenow -
lookBackDays))
// # VARS
###################################################################
##########################

// # FUNCTIONS
###################################################################
#######################

vline(BarIndex, Color, LineStyle, LineWidth) =>


        return = line.new(BarIndex, low, BarIndex, high, xloc.bar_index, (cutLines ?
extend.none : extend.both), Color, LineStyle, LineWidth)

drawPrice(startTime, price, clr, style, multiply, width) =>


        x = bar_index
        y = price
        line.new(x1=startTime, y1=y, color=clr, x2=time + (lookBack * multiply),
y2=y,xloc=xloc.bar_time, style=style, width = width)

nameForDay(day) =>
        var dayName = ""
        if day == 2
                dayName := "Mon"
        if day == 3
                dayName := "Tue"
        if day == 4
                dayName := "Wed"
        if day == 5
                dayName := "Thu"
        if day == 6
                dayName := "Fri"
        if day == 7
                dayName := "Sat"
        if day == 1
                dayName := "Sun"
        dayName // return

// # FUNCTIONS
###################################################################
#######################

// # DISPLAY
###################################################################
#########################

// ny open
if(time == nyOpen and extendedDisplayCondition and showNYopen)
        vline(bar_index, darkRed, line.style_dotted, 1)
        drawPrice(time, open, nyColor, line.style_solid, 1, 2)

// tue "europe open"


if nameForDay(dayofweek) == "Tue" and (time == europeOpen or time ==
europeOpen2) and showTuesday
        drawPrice(time, open, darkRed, line.style_dotted, 7, 2)

// true day end


if(showEndTrueDay and time == trueDayEnd and extendedDisplayCondition)
        //vline(bar_index, trueDayColor, line.style_dashed, 1)
        drawPrice(time, open, nyColor, line.style_dashed, 1, 1)

// # DISPLAY
###################################################################
#########################

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy