NinjaTrader Support Forum  

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 01-14-2009, 05:39 AM   #1
starrynight
Member
 
Join Date: Sep 2008
Posts: 72
Thanks: 0
Thanked 0 times in 0 posts
Default Exit on close

Can I overide " exit on close" so my position stays open until the trade plays out ?

I'm trying automation in Forex on a demo and want the position open over the course of days or weeks .
starrynight is offline  
Reply With Quote
Old 01-14-2009, 05:45 AM   #2
NinjaTrader_Jason
NinjaTrader Customer Service
 
NinjaTrader_Jason's Avatar
 
Join Date: Aug 2007
Location: Breda, Netherlands
Posts: 11,327
Thanks: 92
Thanked 354 times in 345 posts
Default

Please see the following link for more information.
http://www.ninjatrader-support.com/H...itOnClose.html

If set to true, strategy will not exit on close.
NinjaTrader_Jason is offline  
Reply With Quote
Old 01-14-2009, 06:46 AM   #3
starrynight
Member
 
Join Date: Sep 2008
Posts: 72
Thanks: 0
Thanked 0 times in 0 posts
Default

I see , Just shut it off when applying the strategy , thanks .

Also , how do I set a trailing stop . I got as far as stops and targets / strategy action in the wizard and selected trailing stop . From the parameters box how do I define how to trail the stop ?

Thanks again I appreciate it .
starrynight is offline  
Reply With Quote
Old 01-14-2009, 06:52 AM   #4
NinjaTrader_Jason
NinjaTrader Customer Service
 
NinjaTrader_Jason's Avatar
 
Join Date: Aug 2007
Location: Breda, Netherlands
Posts: 11,327
Thanks: 92
Thanked 354 times in 345 posts
Default

Please see the link below for more information regarding SetTrailStop().
http://www.ninjatrader-support.com/H...TrailStop.html
NinjaTrader_Jason is offline  
Reply With Quote
Old 01-14-2009, 07:32 AM   #5
starrynight
Member
 
Join Date: Sep 2008
Posts: 72
Thanks: 0
Thanked 0 times in 0 posts
Default

Can I set the parameters to trail the stop from the wizard ?
starrynight is offline  
Reply With Quote
Old 01-14-2009, 07:35 AM   #6
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

Trailing stops are available on the last page of the Wizard where you define Stops & Targets.
NinjaTrader_Josh is offline  
Reply With Quote
Old 01-14-2009, 10:21 AM   #7
starrynight
Member
 
Join Date: Sep 2008
Posts: 72
Thanks: 0
Thanked 0 times in 0 posts
Default question

If I backtest the 12/08 ES contract and run the backtest from 8/08 through 1/13/09 will it factor in the 9/08 and 3/09 contract for the results .
starrynight is offline  
Reply With Quote
Old 01-14-2009, 11:00 AM   #8
NinjaTrader_Ray
Administrator
 
NinjaTrader_Ray's Avatar
 
Join Date: Nov 2004
Location: Denver, CO, USA
Posts: 11,164
Thanks: 6
Thanked 46 times in 32 posts
Default

With NT 6.5 or earlier, if you have merged past contracts into 12/08 then yes, otherwise no.

More info on merging - http://www.ninjatrader-support.com/H...eV6/Merge.html
NinjaTrader_Ray is offline  
Reply With Quote
Old 01-14-2009, 12:11 PM   #9
starrynight
Member
 
Join Date: Sep 2008
Posts: 72
Thanks: 0
Thanked 0 times in 0 posts
Default

Thanks for that Ray. I made a mistake with that last question though . If I run a backtest for the 03/09 ES contract ( or another contract ) and choose a timeframe from around 01/08 ,or before the 03/09 contract trades, until today will the result be based upon the ES contracts that expired up until the 03/09 contract ?

Is there a maximum timeframe to look back ?

Also , I dont store any real time bar data and am getting the data to backtest from Esignal . Is there anything I should do that I might be missing ?
starrynight is offline  
Reply With Quote
Old 01-14-2009, 12:21 PM   #10
NinjaTrader_Jason
NinjaTrader Customer Service
 
NinjaTrader_Jason's Avatar
 
Join Date: Aug 2007
Location: Breda, Netherlands
Posts: 11,327
Thanks: 92
Thanked 354 times in 345 posts
Default

The same answer holds up; if you did not merge the 12-08 contract or prior contracts into the 03-09 contract, it will not.

The Strategy Analyzer does not have a limitation regarding look back period.

I suggest to create a continuous contract, since these are supported with eSignal. Go to Tools-->Instrument Manager, highlight the ES and set Expiry to ##-##. Add the ES to your instrument list. I suggest to use this instrument upon backtesting.
NinjaTrader_Jason is offline  
Reply With Quote
Old 01-14-2009, 12:24 PM   #11
starrynight
Member
 
Join Date: Sep 2008
Posts: 72
Thanks: 0
Thanked 0 times in 0 posts
Default

Thanks again , I'll do that .
starrynight is offline  
Reply With Quote
Old 01-14-2009, 07:50 PM   #12
starrynight
Member
 
Join Date: Sep 2008
Posts: 72
Thanks: 0
Thanked 0 times in 0 posts
Default

When I apply conditions and actions how do I tell the condition builder the MACD must be falling or rising ?

On the right side I see rising , falling and slope but how can I apply these ?
starrynight is offline  
Reply With Quote
Old 01-15-2009, 05:59 AM   #13
NinjaTrader_Bertrand
NinjaTrader Customer Service
 
NinjaTrader_Bertrand's Avatar
 
Join Date: Sep 2008
Location: Germany
Posts: 22,569
Thanks: 262
Thanked 1,018 times in 999 posts
Default

Starrynight, please see the attached sample strategy for a way to tell the Condition Builder the MACD is rising, you can express it as MACD is greater than the MACD from 5 bars ago.
Attached Files
File Type: zip macdSlope.zip (3.9 KB, 7 views)
NinjaTrader_Bertrand 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
Exit On Close TraderGuy Strategy Development 15 01-07-2009 02:10 AM
'Exit on Close' in Strategy Wizard Elliott Wave Strategy Development 1 05-07-2008 10:14 PM
Time to flatten vs. Exit on close dtf139 Automated Trading 1 01-11-2008 07:11 AM
Exit On Close doesn't work fine MrBaffalo General Programming 6 11-30-2007 06:18 AM
Profit Targets & 'Exit on Close' dgregor5 General Programming 2 07-15-2007 01:35 PM


All times are GMT -6. The time now is 08:22 PM.