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 > Strategy Development

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

Reply
 
Thread Tools Display Modes
Old 03-20-2009, 03:07 PM   #1
gg80108
Senior Member
 
Join Date: Dec 2008
Location: Castle Pines, Co
Posts: 621
Thanks: 1
Thanked 2 times in 2 posts
Default Orders not closing End of Session

I have open orders at the end of the session. Inclosed are some picture of the chart setting, and the order entry strategy. Whats the trick to making this work?
Attached Images
File Type: png strat exit.png (10.9 KB, 10 views)
File Type: png chart time.png (11.7 KB, 9 views)
gg80108 is offline  
Reply With Quote
Old 03-20-2009, 03:13 PM   #2
NinjaTrader_Josh
NinjaTrader Product Manager
 
NinjaTrader_Josh's Avatar
 
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 107 times in 70 posts
Default

Please track your orders with TraceOrders = true and see if it encountered problems submitting the order. http://www.ninjatrader-support2.com/...ead.php?t=3627
NinjaTrader_Josh is offline  
Reply With Quote
Old 03-20-2009, 05:20 PM   #3
gg80108
Senior Member
 
Join Date: Dec 2008
Location: Castle Pines, Co
Posts: 621
Thanks: 1
Thanked 2 times in 2 posts
Default Trade LOG

Quote:
Originally Posted by NinjaTrader_Josh View Post
Please track your orders with TraceOrders = true and see if it encountered problems submitting the order. http://www.ninjatrader-support2.com/...ead.php?t=3627
what do ya think?
Attached Files
File Type: txt short hanging log.txt (7.5 KB, 4 views)
gg80108 is offline  
Reply With Quote
Old 03-21-2009, 07:09 AM   #4
NinjaTrader_Josh
NinjaTrader Product Manager
 
NinjaTrader_Josh's Avatar
 
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 107 times in 70 posts
Default

As evidenced by your logs no Exit on Close order was placed. Please try with the SampleMACrossOver strategy to see if you can get Exit on Close to place.
NinjaTrader_Josh is offline  
Reply With Quote
Old 03-22-2009, 10:23 AM   #5
gg80108
Senior Member
 
Join Date: Dec 2008
Location: Castle Pines, Co
Posts: 621
Thanks: 1
Thanked 2 times in 2 posts
Default

The SampleMACrossover, did not close orders at end of session.. Ran it on two different PCs and did not close orders.

The SampleMACrossover would not let me add the TraceOrders = true,, saying something about thats its a system strategy.
gg80108 is offline  
Reply With Quote
Old 03-22-2009, 12:56 PM   #6
NinjaTrader_Ben
NinjaTrader Customer Service
 
NinjaTrader_Ben's Avatar
 
Join Date: May 2008
Location: Denver, CO
Posts: 3,157
Thanks: 0
Thanked 3 times in 3 posts
Default

Hello,

Can you post your log and trace files after running the sample strategy so we can verify?

Try right clicking the code>Save as... and change the name. Then add TraceOrders = true.
NinjaTrader_Ben is offline  
Reply With Quote
Old 03-22-2009, 04:47 PM   #7
gg80108
Senior Member
 
Join Date: Dec 2008
Location: Castle Pines, Co
Posts: 621
Thanks: 1
Thanked 2 times in 2 posts
Default trace and log

Quote:
Originally Posted by NinjaTrader_Ben View Post
Hello,

Can you post your log and trace files after running the sample strategy so we can verify?

Try right clicking the code>Save as... and change the name. Then add TraceOrders = true.
trace and log
Attached Files
File Type: txt traceandlog.txt (17.9 KB, 4 views)
gg80108 is offline  
Reply With Quote
Old 03-23-2009, 07:12 AM   #8
NinjaTrader_Josh
NinjaTrader Product Manager
 
NinjaTrader_Josh's Avatar
 
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 107 times in 70 posts
Default

Please post complete trace and logs along with timestamps of your latest version. Also, to please be using SampleMACrossOver and try on different instruments. Thank you.
NinjaTrader_Josh is offline  
Reply With Quote
Old 03-23-2009, 07:35 AM   #9
gg80108
Senior Member
 
Join Date: Dec 2008
Location: Castle Pines, Co
Posts: 621
Thanks: 1
Thanked 2 times in 2 posts
Default

the current logs are two posts down
gg80108 is offline  
Reply With Quote
Old 03-23-2009, 07:42 AM   #10
NinjaTrader_Josh
NinjaTrader Product Manager
 
NinjaTrader_Josh's Avatar
 
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 107 times in 70 posts
Default

gg80108,

It looks like you are backtesting. I am assuming you are doing it on the Strategy Analyzer. Please ensure you actually defined out the 9:30-4pm time frame in the strategy selection dialogue.

Please then try increasing the seconds till exit significantly. We are just trying to get a base case that works so we have somewhere to start.
NinjaTrader_Josh is offline  
Reply With Quote
Old 03-23-2009, 08:24 AM   #11
gg80108
Senior Member
 
Join Date: Dec 2008
Location: Castle Pines, Co
Posts: 621
Thanks: 1
Thanked 2 times in 2 posts
Default

Quote:
Originally Posted by NinjaTrader_Josh View Post
gg80108,

It looks like you are backtesting. I am assuming you are doing it on the Strategy Analyzer. Please ensure you actually defined out the 9:30-4pm time frame in the strategy selection dialogue.

Please then try increasing the seconds till exit significantly. We are just trying to get a base case that works so we have somewhere to start.
I was using the Market replay function to test, setting up the start and stop times in the Chart Properties.

Strategy Analyzer seems only to contain "Exit on close" but does not have the "Exit on close seconds" to change, in order handling..
I did move the session time back in Strategy Analyzer to create an open order at end of session and open orders were closed everytime, but I also set "Exit on close" to false and it still generated the "Exit on close" order. Strategy Analyzer just doesn't seem to be useful in this test.
gg80108 is offline  
Reply With Quote
Old 03-23-2009, 08:34 AM   #12
NinjaTrader_Josh
NinjaTrader Product Manager
 
NinjaTrader_Josh's Avatar
 
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 107 times in 70 posts
Default

Not sure I follow. If you want Exit on Close you need to set it to true. At the very end of the backtest you will always get an Exit on Close order regardless of the setting too.

If you are running on replay please don't run it at 500x. Please slow it down or just set session times that will trigger an exit a few minutes into the replay and let it go at 1x.
NinjaTrader_Josh is offline  
Reply With Quote
Old 03-23-2009, 08:50 AM   #13
gg80108
Senior Member
 
Join Date: Dec 2008
Location: Castle Pines, Co
Posts: 621
Thanks: 1
Thanked 2 times in 2 posts
Default

Quote:
Originally Posted by NinjaTrader_Josh View Post
Not sure I follow. If you want Exit on Close you need to set it to true. At the very end of the backtest you will always get an Exit on Close order regardless of the setting too.

If you are running on replay please don't run it at 500x. Please slow it down or just set session times that will trigger an exit a few minutes into the replay and let it go at 1x.
Maybe your Strategy Analyzer has "seconds to close" but mine doesn't .
Attached Images
File Type: jpg backtest.jpg (60.9 KB, 7 views)
gg80108 is offline  
Reply With Quote
Old 03-23-2009, 08:53 AM   #14
NinjaTrader_Josh
NinjaTrader Product Manager
 
NinjaTrader_Josh's Avatar
 
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 107 times in 70 posts
Default

Backtesting would not have this since there is no "intrabar" handling.
NinjaTrader_Josh is offline  
Reply With Quote
Old 03-23-2009, 08:56 AM   #15
gg80108
Senior Member
 
Join Date: Dec 2008
Location: Castle Pines, Co
Posts: 621
Thanks: 1
Thanked 2 times in 2 posts
Default

Seems like we are not communicating anymore.. How can we reset this and get back on the same page?
gg80108 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
Put Session Begin and Session End times in chart title Jim W. Suggestions And Feedback 1 03-12-2009 03:32 AM
Using different timeframes AND session begin / end Brian1 Strategy Development 4 03-06-2009 12:59 PM
Session start, Session end TedLincoln Charting 4 02-25-2009 02:03 PM
Session begins and end in script. Czarek Strategy Development 2 02-23-2009 07:40 AM
Orders auto closing at end of day jyounk Strategy Development 3 08-01-2008 11:34 AM


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