NinjaTrader Support Forum  

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

General Programming General NinjaScript programming questions.

Reply
 
Thread Tools Display Modes
Old 01-09-2009, 02:19 AM   #1
mohdfraz
Member
 
Join Date: Nov 2008
Posts: 59
Thanks: 0
Thanked 0 times in 0 posts
Default bar

Hi,

check the attached, I want to identify Higest bar in the given time. I tried the logic but it is not working check the attached and let me know what is worng with it.

awaiting
Attached Images
File Type: jpg 1.jpg (46.6 KB, 8 views)
mohdfraz is offline  
Reply With Quote
Old 01-09-2009, 07:18 AM   #2
NinjaTrader_Josh
NinjaTrader Product Manager
 
NinjaTrader_Josh's Avatar
 
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 106 times in 70 posts
Default

That will not work. To check the highest bar within that time you need to set your condition to run the check once at 7:50 PM. You need to then move HighestBar to an Action. You want to set Variable0 to take on the value as deterined by HighestBar. In HighestBar you need to pass in a period that would correlate with the number of bars that it would take to bring it back to 7:25 PM. I.e. A period of 25 if you are on 1min charts. Then you can take the value of Variable0 and then use that to plot where you want your diamond.
NinjaTrader_Josh is offline  
Reply With Quote
Old 01-09-2009, 08:43 AM   #3
mohdfraz
Member
 
Join Date: Nov 2008
Posts: 59
Thanks: 0
Thanked 0 times in 0 posts
Default

Hi Josh,

Problem with Highest/Lowest bar using is that they donot look back after X number of bars for example lets say i want to see 6 bars high/low so they will not be trigered until after 6 bars we get some high/low. suppose by 7:50 PM there is NO lower low bars then it cannot identify Lower bars. Check the attached today market open pic i attached. The above blue Triangles high light is showing the time and bars when we are going to find out the high and low. and the Red bar are showing highest bars.

did you get the point?

awaiting
Attached Images
File Type: jpg Untitled.jpg (47.0 KB, 7 views)
mohdfraz is offline  
Reply With Quote
Old 01-09-2009, 08:52 AM   #4
NinjaTrader_Josh
NinjaTrader Product Manager
 
NinjaTrader_Josh's Avatar
 
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 106 times in 70 posts
Default

Sorry I do not follow. HighestBar has a period as defined by the user. When you move forward a few more bars your period remaining the same will result in a comparison for highest bar across a different range. For sure you will experience a lowering of your dots because you are not including those prior higher bars in your analysis.
NinjaTrader_Josh is offline  
Reply With Quote
Old 01-09-2009, 11:18 AM   #5
mohdfraz
Member
 
Join Date: Nov 2008
Posts: 59
Thanks: 0
Thanked 0 times in 0 posts
Default

Hi,

Ok I have done,, code is bit length as i have no other choice and I checked on each bar if it is higher then other bars.

thanks
mohdfraz 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
current bar previous bar frankvdplas General Programming 4 12-08-2008 07:59 AM
Bar index from the session or plot bar number on an intraday chart eneratom General Programming 1 02-27-2008 06:48 AM
change bar time to start of bar interval bi9foot Charting 3 01-18-2008 01:51 AM
Stop Loss @ Low/High of Entry Bar minus one Bar SamIam Strategy Development 5 08-29-2007 03:55 AM
CrossBelow previous bar and omit current bar ct General Programming 1 06-03-2007 02:54 AM


All times are GMT -6. The time now is 03:29 AM.