Announcement

Collapse
No announcement yet.

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.
    https://ninjatrader.com/support/help...dataseries.htm
    https://ninjatrader.com/support/help.../barsarray.htm

    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 MyrtleMcAlpin, Today, 04:25 AM
0 responses
1 view
0 likes
Last Post MyrtleMcAlpin  
Started by fernlicht, Today, 02:38 AM
1 response
7 views
0 likes
Last Post NinjaTrader_Jason  
Started by b16_aln, Today, 01:48 AM
1 response
7 views
0 likes
Last Post NinjaTrader_Jason  
Started by james272, Yesterday, 10:50 PM
1 response
11 views
0 likes
Last Post NinjaTrader_Marco  
Started by vaz21102, Yesterday, 09:22 PM
2 responses
10 views
0 likes
Last Post vaz21102  
Working...
X