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 > Application Technical Support > Automated Trading

Automated Trading Support for automated trading systems using NinjaScript. Support for our ATI (Automated Trading Interface) used to link an external application such as TradeStation and eSignal to NinjaTrader.

Reply
 
Thread Tools Display Modes
Old 03-25-2011, 09:56 AM   #1
fhege
Junior Member
 
Join Date: Mar 2011
Posts: 2
Thanks: 0
Thanked 0 times in 0 posts
Default Opening 30 min. bar breakout strategy

I would like a strategy based on a one tick breakout above or below the first daily session 30 min. bar high and low for a long and short trade respectively. I do not know how to structure this. Could someone please show me how or where I could get this strategy? Thanks.
fhege is offline  
Reply With Quote
Old 03-25-2011, 10:00 AM   #2
NinjaTrader_RyanM
NinjaTrader Customer Service
 
NinjaTrader_RyanM's Avatar
 
Join Date: Sep 2009
Location: Denver, CO
Posts: 8,117
Thanks: 249
Thanked 418 times in 415 posts
Default

Hello fhege,

Welcome to the NinjaTrader forums!

Yes, we have a sample available for this. You can download from here and import into your NinjaTrader installation:

http://www.ninjatrader.com/support/f...ead.php?t=3223
NinjaTrader_RyanM is offline  
Reply With Quote
Old 06-13-2011, 01:58 AM   #3
smegey
Junior Member
 
Join Date: May 2011
Posts: 13
Thanks: 1
Thanked 0 times in 0 posts
Default

Hi

Im new to Ninjatrader, understand markets well but just now trying to get a better grasp of implementing 'custom' stategies like the one you have kindly provided.

I have downloaded this strategy, opened it in the custom strategies tool and saved it as a ninjascript strategy. Unfortunately, when i use the strategy analyzer, I cannot select it from the list of dropdown strategies. I can however see it on the left hand side folder view when expanding 'strategies'. I have not modified the code in any way. Just trying to test out anythint to understand the product further.

I have provided a screenshot.

Thanks for your time!
Attached Images
File Type: jpg strategy.jpg (379.4 KB, 59 views)
smegey is offline  
Reply With Quote
Old 06-13-2011, 08:21 AM   #4
NinjaTrader_RyanM
NinjaTrader Customer Service
 
NinjaTrader_RyanM's Avatar
 
Join Date: Sep 2009
Location: Denver, CO
Posts: 8,117
Thanks: 249
Thanked 418 times in 415 posts
Default

Hi smegey,

Thanks for the post and welcome to the NinjaTrader forums. You should not have to manually open this file and place in strategy folder To bring this into your platform, you can use File > Utilities > Import NinjaScript > Select the zip file.

http://www.ninjatrader.com/support/h...nt7/import.htm
NinjaTrader_RyanM is offline  
Reply With Quote
Old 06-13-2011, 08:48 AM   #5
smegey
Junior Member
 
Join Date: May 2011
Posts: 13
Thanks: 1
Thanked 0 times in 0 posts
Default

Thanks so much RyanM. Ill give this a shot when i next get in front of my trade computer.
smegey is offline  
Reply With Quote
Old 09-13-2011, 06:29 PM   #6
c4matted
Junior Member
 
Join Date: Sep 2011
Posts: 2
Thanks: 0
Thanked 0 times in 0 posts
Default Breakout strategy question

Not sure if this is the correct place to post such a question but I am wondering if anyone knows how to change this strategy a little so that the range of the 30 minute candle excludes the wicks? Only trades the breakout of the body of the candle. Could anyone help?
Thank You
c4matted is offline  
Reply With Quote
Old 09-14-2011, 08:34 AM   #7
NinjaTrader_RyanM
NinjaTrader Customer Service
 
NinjaTrader_RyanM's Avatar
 
Join Date: Sep 2009
Location: Denver, CO
Posts: 8,117
Thanks: 249
Thanked 418 times in 415 posts
Default

Hello c4matted,

Thanks for the post and welcome to the NinjaTrader forums! If you want to exclude wicks for your breakout strategy, you would have to work with Open and Close instead of High and Low. To find which is higher/lower for Open and Close there are methods Math.Min() and Math.Max().
NinjaTrader_RyanM is offline  
Reply With Quote
Old 09-14-2011, 08:52 AM   #8
c4matted
Junior Member
 
Join Date: Sep 2011
Posts: 2
Thanks: 0
Thanked 0 times in 0 posts
Default Breakout strategy question

Ryan,
I appreciate the information. Definitely something I am interested in. Would you know of any documentation or the best way for someone that is new to Ninjatrader to start building an automated strategy or a strategy for backtesting? Is there tools within Ninjatrader to help me modify the current breakout strategy? Thank You again
c4matted is offline  
Reply With Quote
Old 09-14-2011, 09:07 AM   #9
NinjaTrader_RyanM
NinjaTrader Customer Service
 
NinjaTrader_RyanM's Avatar
 
Join Date: Sep 2009
Location: Denver, CO
Posts: 8,117
Thanks: 249
Thanked 418 times in 415 posts
Default

Yes, you can build from existing samples and is a good way to get familiar with acceptable code syntax. For an introduction to strategy development in NinjaTrader, please see following link:
http://www.ninjatrader.com/support/h...nt_process.htm

To make copies of any existing strategies: Right Click in editor > Save as and provide a new name.
NinjaTrader_RyanM is offline  
Reply With Quote
Old 01-16-2013, 08:34 AM   #10
GeoOrtiz
Junior Member
 
Join Date: Jan 2013
Location: Coral Gables, FL
Posts: 11
Thanks: 2
Thanked 2 times in 2 posts
Default First Bar of Session

Hi All,

I'm new to NinjaTrader and this is my first post on the forum. Please have patience with me.

I have a question about the Bars.FirstBarOfSession function. When dealing with the ES, which practically trades around the clock, does the system consider the start of the session the 9:30 USA market open? Is the overnight session ignored?

Thank you in advance for your responses!
GeoOrtiz is offline  
Reply With Quote
Old 01-16-2013, 08:46 AM   #11
NinjaTrader_Joydeep
NinjaTrader Customer Service
 
NinjaTrader_Joydeep's Avatar
 
Join Date: Dec 2011
Location: India
Posts: 3,286
Thanks: 580
Thanked 546 times in 541 posts
Default

Hello GeoOrtiz,
Welcome to the forum and I am happy to assist you.

It would depend on the session template you are using. If you are using an RTH session template then only the FirstBarOfSession will return the bar number @ 9:30.

http://www.ninjatrader.com/support/h...on_manager.htm
NinjaTrader_Joydeep is offline  
Reply With Quote
The following user says thank you to NinjaTrader_Joydeep for this post:
Old 01-16-2013, 05:54 PM   #12
koganam
Senior Member
 
Join Date: Feb 2008
Location: Durham, North Carolina, USA
Posts: 3,201
Thanks: 24
Thanked 1,227 times in 998 posts
Send a message via Skype™ to koganam
Default

Quote:
Originally Posted by c4matted View Post
Not sure if this is the correct place to post such a question but I am wondering if anyone knows how to change this strategy a little so that the range of the 30 minute candle excludes the wicks? Only trades the breakout of the body of the candle. Could anyone help?
Thank You
Replace the trigger, High[0], with Math.Max(Open[0], Close[0]) and Low[0] with Math.Min(Open[0], Close[0]).
koganam is offline  
Reply With Quote
The following user says thank you to koganam for this post:
Old 01-22-2013, 09:53 AM   #13
GeoOrtiz
Junior Member
 
Join Date: Jan 2013
Location: Coral Gables, FL
Posts: 11
Thanks: 2
Thanked 2 times in 2 posts
Default

Hi All,

I downloaded and ran this sample strategy on one day (01/17/13) on ES, but it is calculating the wrong highest high of the first 30 min of trading. Am I running the backtest incorrectly?
Attached Images
File Type: png Result.png (45.3 KB, 7 views)
Last edited by GeoOrtiz; 01-22-2013 at 10:00 AM.
GeoOrtiz is offline  
Reply With Quote
Old 01-22-2013, 10:47 AM   #14
NinjaTrader_Joydeep
NinjaTrader Customer Service
 
NinjaTrader_Joydeep's Avatar
 
Join Date: Dec 2011
Location: India
Posts: 3,286
Thanks: 580
Thanked 546 times in 541 posts
Default

Hello GeoOrtiz,
If you set the Min bars required to 0, or better backtest the strategy with 2 days or more data then are you getting the correct fills.
NinjaTrader_Joydeep is offline  
Reply With Quote
Old 01-22-2013, 12:20 PM   #15
GeoOrtiz
Junior Member
 
Join Date: Jan 2013
Location: Coral Gables, FL
Posts: 11
Thanks: 2
Thanked 2 times in 2 posts
Default

Thank you Joydeep. That did the trick.
GeoOrtiz is offline  
Reply With Quote
The following user says thank you to GeoOrtiz for this post:
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
Opening range breakout bradypreston General Programming 7 02-28-2010 05:13 AM
Conversion 30 min. historical data to daily Argo1 Strategy Development 7 10-28-2009 04:05 AM
Opening Range Breakout maninjapan Strategy Development 32 10-20-2009 02:55 PM
Please help with Opening Range Breakout Strategy OrderFlow Strategy Development 2 08-03-2009 04:30 AM
Possible to chart the first 30 min candle of day and that's it? brownsfan019 Charting 4 04-17-2008 11:36 AM


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