NexusFi: Find Your Edge


Home Menu

 





Pine Script Daily Open and Close


Discussion in Traders Hideout

Updated
    1. trending_up 3,070 views
    2. thumb_up 1 thanks given
    3. group 4 followers
    1. forum 1 posts
    2. attach_file 0 attachments




 
Search this Thread

Pine Script Daily Open and Close

  #1 (permalink)
 Alexander Savin 
Europe
 
Experience: None
Platform: RTP, IRT
Trading: ZB, FGBL
Posts: 53 since Apr 2016
Thanks Given: 53
Thanks Received: 58

Hi all

I'm at a loss here. I am trying to plot the Regular Trading Hours open and close (EST, 0930 and 1600) on a daily chart in Tradingview.

Instrument = E-mini S&P 500 (ES1!)
New York open = 0930 (New York Time)
New York close = 1600 (New York Time)

The problem is that ES1! trades from 1800 until 1615 the next day, with a short session from 1630-1700, so the Pine Script language operators "open" and "close" return the values for 1800 and 1700. What I want are the values of ES1! at 0930 and 1600.

I've tried the following:

study(title="NY_Open", shorttitle="NY_Open")
newyork_open = "0930-0931"
newyorkprice = time("1", newyork_open) ? open : na
htf = security("CME_MINI:ES1!", "1", newyorkprice)
plot(htf, color=white, linewidth=2)

This works on a 1m chart but not on a daily chart, what am I missing? If you have an answer, please PM me and let me know how much you want for the code. Any help is appreciated.

Started this thread Reply With Quote
Thanked by:

Can you help answer these questions
from other members on NexusFi?
Trade idea based off three indicators.
Traders Hideout
Exit Strategy
NinjaTrader
MC PL editor upgrade
MultiCharts
ZombieSqueeze
Platforms and Indicators
REcommedations for programming help
Sierra Chart
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Spoo-nalysis ES e-mini futures S&P 500
29 thanks
Just another trading journal: PA, Wyckoff & Trends
24 thanks
Tao te Trade: way of the WLD
24 thanks
Bigger Wins or Fewer Losses?
21 thanks
GFIs1 1 DAX trade per day journal
17 thanks
  #2 (permalink)
 
AllSeeker's Avatar
 AllSeeker 
Mumbai, India
Legendary Pratik_4Clover
 
Experience: Beginner
Platform: TradingView & ZerodhaKite
Trading: NIFTY, BANKNIFTY
Frequency: Daily
Duration: Minutes
Posts: 1,424 since Jan 2019
Thanks Given: 5,249
Thanks Received: 5,012


Alexander Savin View Post
Hi all

I'm at a loss here. I am trying to plot the Regular Trading Hours open and close (EST, 0930 and 1600) on a daily chart in Tradingview.

Instrument = E-mini S&P 500 (ES1!)
New York open = 0930 (New York Time)
New York close = 1600 (New York Time)

The problem is that ES1! trades from 1800 until 1615 the next day, with a short session from 1630-1700, so the Pine Script language operators "open" and "close" return the values for 1800 and 1700. What I want are the values of ES1! at 0930 and 1600.

I've tried the following:

study(title="NY_Open", shorttitle="NY_Open")
newyork_open = "0930-0931"
newyorkprice = time("1", newyork_open) ? open : na
htf = security("CME_MINI:ES1!", "1", newyorkprice)
plot(htf, color=white, linewidth=2)

This works on a 1m chart but not on a daily chart, what am I missing? If you have an answer, please PM me and let me know how much you want for the code. Any help is appreciated.

Its a year old thread but just in case someone else is stuck here, don't be quick to dish out money, only problem here is that you are importing 1 min data, change that 1 to "D" and you will have daily data

Visit my NexusFi Trade Journal Reply With Quote




Last Updated on October 1, 2020


© 2024 NexusFi™, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
All information is for educational use only and is not investment advice. There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Privacy Policy - Downloads - Top
no new posts