NinjaTrader Support Forum  
X

Attention!

This website will be down for maintenance from Friday May 24th at 6PM MDT until Saturday May 25th at 11AM MDT. We apologize for the inconvenience. If you need assistance during this time, please email sales@ninjatrader.com


Go Back   NinjaTrader Support Forum > NinjaScript Development Support > General Programming

General Programming General NinjaScript programming questions.

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Old 04-26-2012, 09:33 AM   #1
ij001
Senior Member
 
Join Date: Apr 2010
Posts: 125
Thanks: 18
Thanked 3 times in 3 posts
Default Prior Day values using GetBar

Hi there

I created a method that finds the High and Low of yesterdays values from a specific point in time using DateTime.

startDateTime = new DateTime(Time[0].Year, Time[0].Month, Time[0].Day-1, 10, 00, 0);

int barsAgo = CurrentBar - Bars.GetBar(startDateTime); // Store price data from 10:30 AM

getHighestHigh = MAX(High, 1)[barsAgo];
...

It works fine except when I get to Monday then it spits out values that are maybe from Sunday since they are futures?

I prefer only US Equities RTH and assumed it would only use Monday-Friday...

Do I have to add a line that specifies the days?

Irvin
ij001 is offline  
Reply With Quote
 

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Prior day OHLC BigAAPL Charting 15 12-01-2010 09:49 AM
Prior Day Values for ADX, +DMI, and -DMI TrendTracker General Programming 1 05-11-2010 11:59 AM
On starting values of HighestBar, GetBar(), etc. binwang2 General Programming 1 04-07-2010 04:11 AM
Keeping indicator internal values from prior bar roland_nt Charting 1 10-22-2008 08:31 AM
Re: Prior Day OHLC Indicator Antraman Indicator Development 12 06-07-2006 12:31 AM


All times are GMT -6. The time now is 08:04 AM.