NinjaTrader Support Forum  

Go Back   NinjaTrader Support Forum > NinjaScript Development Support > Strategy Development

Strategy Development Support for the development of custom automated trading strategies using NinjaScript.

Reply
 
Thread Tools Display Modes
Old 11-11-2009, 07:02 AM   #1
d.allen101
Senior Member
 
Join Date: Jun 2009
Location: Chicago
Posts: 154
Thanks: 0
Thanked 0 times in 0 posts
Default Enter trade at open and exit trade at close

how do i exit a trade on a daily time frame at the close of the same bar that i entered the trade?
d.allen101 is offline  
Reply With Quote
Old 11-11-2009, 07:16 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

d.allen101,

You will only be able to do that in real-time or if you have intrabar granularity. In backtesting when you are processing daily bars, all your signals are processed at the end of each bar and because the bar is closed you can't trade on that bar anymore.
NinjaTrader_Josh is offline  
Reply With Quote
Old 11-11-2009, 09:02 AM   #3
d.allen101
Senior Member
 
Join Date: Jun 2009
Location: Chicago
Posts: 154
Thanks: 0
Thanked 0 times in 0 posts
Default

I can't figure how to simply generate signal on daily time frame and buy the open and sell the close following the signal day. are there any threads that address this issue?
d.allen101 is offline  
Reply With Quote
Old 11-11-2009, 10:02 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

Please see this reference sample for intrabar granularity: http://www.ninjatrader-support2.com/...ead.php?t=6652
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
How can strategy enter/exit at current day's close price rnhoo ATM Strategies (Discretionary Trading) 13 02-11-2011 03:41 AM
How to enter a trade based on time KeelRisk Strategy Development 1 08-19-2009 06:12 AM
Exit at close and enter at open Andy_Mil Strategy Development 5 06-24-2009 12:17 PM
Enter at Close, Exit next day Close tjendra Strategy Development 3 04-08-2009 11:33 AM
How enter a Breakout trade? vast524 SuperDOM and other Order Entry Windows 1 07-25-2008 09:01 AM


All times are GMT -6. The time now is 02:59 AM.