Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

prior day close price

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • asmmbillah
    replied
    thanks everyone. I have replace priordayohlc close with adding add data series of daily bartype with period 1 and getting Closes[1][1]. That solved my issue. thanks again.

    Leave a comment:


  • NinjaTrader_ChelseaB
    replied
    Hello asmmbillah,

    NT-Roland is suggesting that if the primary series is a daily series, High[1] would be the high of 1 bar ago, or 1 day ago.

    If this is not achieving the goal, for reasons like applying a custom trading hours template, it is possible to add a minute series to the script with AddDataSeries and use this for the input series of the PriorDayOHLC indicator.

    Leave a comment:


  • NT-Roland
    replied
    Hi asmmbillah,
    I'm not sure, I understand the issue with your data feed. You shouldn't need a separate indicator to determine prior day data.
    I assume, you get market data for the entire session, be it as 1 min bars or greater.

    To grab the close of the day before, just check on OnBarUpdate if the date of the bar is different from the date of the bar before.
    If Yes, you have a day break in between and it just happened.

    if (Times[1][0].Date != Times[1][1].Date) // true once a day when the first bar of the new day closes.
    {
    myYesterdayClose = Closes[1][1]; // goes back one bar = yesterday and grabs the close of such session.

    You can also use IsFirstBarOfSession logic to identify the bar from which to go back one bar to grab the prior day close.

    NT-Roland

    Leave a comment:


  • asmmbillah
    started a topic prior day close price

    prior day close price

    Hi,
    Currently I am getting prior day close price from priordayOHLC indicator due to FXCM as my data provider, as they don't provide last day close price. But using priordayOHLC, does not allow me to use the value in a daily or higher time frame chart. Is there any other way I could get prior day close price to calculate and use it in my ninjascirpt code? thanks in advance.

Latest Posts

Collapse

Topics Statistics Last Post
Started by AttiM, 02-14-2024, 05:20 PM
12 responses
213 views
0 likes
Last Post DrakeiJosh  
Started by cre8able, 02-11-2023, 05:43 PM
3 responses
238 views
0 likes
Last Post rhubear
by rhubear
 
Started by frslvr, 04-11-2024, 07:26 AM
8 responses
117 views
1 like
Last Post NinjaTrader_BrandonH  
Started by stafe, 04-15-2024, 08:34 PM
10 responses
47 views
0 likes
Last Post stafe
by stafe
 
Started by rocketman7, Today, 09:41 AM
3 responses
13 views
0 likes
Last Post NinjaTrader_Jesse  
Working...
X