NinjaTrader Support Forum  

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 02-01-2008, 06:50 PM   #1
scriabinop23
Senior Member
 
Join Date: May 2007
Posts: 112
Thanks: 0
Thanked 0 times in 0 posts
Default Best way to get priorclose from days previous to the previous

I am having trouble figuring the best way to find the priorclose 2, 3+ days ago...

The closest I can get (no cigar, not accurate) is this:

Code:
int barsperday = 1440 / Bars.Period.Value;
closeratio = PriorDayOHLC().PriorClose[(i-1)*barsperday]/PriorDayOHLC().PriorClose[i*barsperday];
But obviously no contracts actually trade the entire 24 hrs (and thus have 1440 minutes of bars). So any idea how to get priordayohlc in *session* terms instead of *bar* terms?

Same goes for not running an indicator unless X days of data are present ? Instead of
Code:
 
if (CurrentBar < barsperday * period)
    return;
What is recommended?
scriabinop23 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
Current Bid > High of Previous 20 Days davidfw1866 Strategy Development 2 11-27-2007 06:08 AM
Ninja log from previous day geoarb Miscellaneous Support 1 08-16-2007 01:40 AM
Referencing Previous Instance(s) Of Condition roxana Automated Trading 11 08-01-2007 05:13 PM
CrossBelow previous bar and omit current bar ct General Programming 1 06-03-2007 02:54 AM
Reloading a previous sim chart Antraman Miscellaneous Support 7 12-27-2005 03:51 AM


All times are GMT -6. The time now is 03:32 PM.