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 File Sharing > NinjaScript File Sharing Discussion

NinjaScript File Sharing Discussion Discussion for shared NinjaScript files.

Reply
 
Thread Tools Display Modes
Old 11-22-2008, 11:20 AM   #1
Brutus
Junior Member
 
Join Date: Oct 2008
Posts: 25
Thanks: 0
Thanked 1 time in 1 post
Default Session midpoint indicator

Attached is a simple midpoint indicator which dynamically draws a midpoint line - to watch the 50% retracement.

My problem is Ideally I would like an indicator that calculates from the 9:30 open as I have a 24 hour 1min ES chart.

I set the Session begins and End to 4:15pm so that I can use the PriorDayOHLC indicator. Changing session begins and end to 9:30am stuffs up the PriorDayOHLC indicator (the 4:15 close).

I'm a new NT user so does anybody have suggestions, tips etc.

TIA
Attached Files
File Type: zip Middle.zip (3.7 KB, 81 views)
Brutus is offline  
Reply With Quote
Old 11-22-2008, 04:44 PM   #2
NinjaTrader_Ray
Administrator
 
NinjaTrader_Ray's Avatar
 
Join Date: Nov 2004
Location: Denver, CO, USA
Posts: 11,163
Thanks: 6
Thanked 45 times in 32 posts
Default

Could you clarify?

- You want to plot on a 24 hour chart but calculate data based on a defined session or;

- Plot on a chart with a defined session but calculate off of 24 hour data?

If the latter, this is not possible.
NinjaTrader_Ray is offline  
Reply With Quote
Old 11-23-2008, 07:40 AM   #3
Brutus
Junior Member
 
Join Date: Oct 2008
Posts: 25
Thanks: 0
Thanked 1 time in 1 post
Default

Hi Ray

Firstly slightly different question, which may help with my middle indicator
Futures traders commonly want to show yesterdays High, Low and close (4:15pm) on a 24hr chart. Can this be done? If I define session is 9:30 to 4:15, I cannot display globex data. This must be a common question?

"- Plot on a chart with a defined session but calculate off of 24 hour data"

This picture is what I ideally want, of an indicator I dont have access to (the lines mainly). I added the 50% line, considering they calculated the OR (open range) lines it must be possible to calculate and draw a 50% of current range line (9:30:to 4:15pm)

If anybody knows of some way of coding something similar or one I could purchase please let me know.
Attached Images
File Type: jpg ES_OHLCMID.jpg (84.4 KB, 93 views)
Brutus is offline  
Reply With Quote
Old 11-23-2008, 08:07 AM   #4
Brutus
Junior Member
 
Join Date: Oct 2008
Posts: 25
Thanks: 0
Thanked 1 time in 1 post
Default

If I use the code


if (ToTime(Time[0])>=093000 && ToTime(Time[0])<161500)
{
High[y]; ///how to get the highest high during the period?
}

Then I could draw a horizontal line, but how could I reference the X points on the chart for the start and end times of the line? (ToTime(Time[0])>=093000 && ToTime(Time[0])<161500)
Brutus is offline  
Reply With Quote
Old 11-23-2008, 12:41 PM   #5
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

Hi Brutus,

To get the highest high you will want to use MAX(High, 20)[0] or something like that at the end of the time period. You need to calculate how many bars are included in your specific time period to pass in for the period parameter.
NinjaTrader_Josh 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
Globex session indicator Angel Indicator Development 12 07-13-2012 02:10 AM
Last bar of session doesn't have indicators until next session begins cunparis Charting 8 11-04-2008 06:45 AM
Changing Session Begins and Session Ends time forexample Charting 1 10-21-2007 01:16 AM
SMA of Midpoint nybangali Indicator Development 5 08-20-2007 02:09 AM
How to plot an indicator only on the current session max1ci6 Indicator Development 2 04-24-2007 07:50 PM


All times are GMT -6. The time now is 07:45 PM.