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.

Reply
 
Thread Tools Display Modes
Old 04-23-2012, 04:41 PM   #1
forrestang
Senior Member
 
Join Date: Aug 2009
Location: Chicago
Posts: 213
Thanks: 39
Thanked 4 times in 4 posts
Default Method for projecting price bars forward?

I have a general question about how to project price movement forward.... just the method for scripting it I mean?

The projection could be either bars, or even lines, but I'm wondering what type of methods i could use for doing this?

An example would be in the picture attached.
Attached Images
File Type: png 2012-04-23_173927.png (31.0 KB, 30 views)
forrestang is offline  
Reply With Quote
Old 04-24-2012, 02:34 AM   #2
NinjaTrader_Bertrand
NinjaTrader Customer Service
 
NinjaTrader_Bertrand's Avatar
 
Join Date: Sep 2008
Location: Germany
Posts: 22,404
Thanks: 252
Thanked 974 times in 957 posts
Default

forrestang, there would be unfortunately no dedicated method for futures bars plotting, you would need to custom code by drawing for example into the future, the draw object overloads would accept a future DateTime anchor as parameter.
NinjaTrader_Bertrand is offline  
Reply With Quote
The following user says thank you to NinjaTrader_Bertrand for this post:
Old 04-24-2012, 09:12 AM   #3
forrestang
Senior Member
 
Join Date: Aug 2009
Location: Chicago
Posts: 213
Thanks: 39
Thanked 4 times in 4 posts
Default

Are you saying the only way would be to use one of those plot void overide functions? I.e. the custom plotting that isn't supported by NT?
forrestang is offline  
Reply With Quote
Old 04-24-2012, 09:13 AM   #4
NinjaTrader_Bertrand
NinjaTrader Customer Service
 
NinjaTrader_Bertrand's Avatar
 
Join Date: Sep 2008
Location: Germany
Posts: 22,404
Thanks: 252
Thanked 974 times in 957 posts
Default

That would be an option as well, but I was referring to using the Draw Methods (DrawLine, Dot, Ray etc) to construct your forecast, those take a future DateTime input to draw at.
NinjaTrader_Bertrand is offline  
Reply With Quote
Old 04-24-2012, 09:29 AM   #5
forrestang
Senior Member
 
Join Date: Aug 2009
Location: Chicago
Posts: 213
Thanks: 39
Thanked 4 times in 4 posts
Default

Quote:
Originally Posted by NinjaTrader_Bertrand View Post
That would be an option as well, but I was referring to using the Draw Methods (DrawLine, Dot, Ray etc) to construct your forecast, those take a future DateTime input to draw at.
Oh ok. To draw at a future date, would that mean just using a negative index for the 'x' position in various draw methods to plot it forward of the last bar?

Or do you literally mean as suggested, and use say for example using:

Code:
DrawLine(string tag, bool autoScale, DateTime startTime, double startY, DateTime endTime, double endY, Color color, DashStyle dashStyle, int width)
As I would always want to start plotting at the bar that is one bar forward of the CurrentBar, which I'm not sure is particularly conducive to accepting a DateTime it seems?
forrestang is offline  
Reply With Quote
Old 04-24-2012, 09:34 AM   #6
NinjaTrader_Bertrand
NinjaTrader Customer Service
 
NinjaTrader_Bertrand's Avatar
 
Join Date: Sep 2008
Location: Germany
Posts: 22,404
Thanks: 252
Thanked 974 times in 957 posts
Default

Unfortunately using a negative index in the plots would not be supported by us - the most current bar is at 0, which is the rightmost bar...

Correct, you would supply a future timestamp to draw at, which would be known for time based bar types.

You know the time of the CurrentBar (Time[0]) so you can add 5 minutes to that if you're running a 5 min chart for example...
NinjaTrader_Bertrand is offline  
Reply With Quote
Reply

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
How Count bars and time forward fawaz79 Charting 2 03-21-2011 04:50 AM
Tool for projecting / measuring moves JoshDance Charting 4 02-19-2011 12:59 AM
is there a Bars.CurrentSession method? WSquared General Programming 1 12-20-2010 02:14 PM
Projecting indicators into the future anituchka Charting 4 09-24-2010 01:52 PM
Marking charts days forward from current price shortstop Charting 3 07-20-2007 05:49 AM


All times are GMT -6. The time now is 01:41 AM.