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

Strategy Analyzer Support for automated system backtesting and optimization using the NinjaTrader Strategy Analyzer.

Reply
 
Thread Tools Display Modes
Old 07-16-2008, 10:05 PM   #1
tazmaan
Junior Member
 
Join Date: Jun 2008
Posts: 19
Thanks: 0
Thanked 0 times in 0 posts
Default Ending strategy once day profit target hit?

Hi,
Been playing with ninja for awhile but just recently got around to messing with the strategy tester.
I wanted to know if there was a way, for example, to end trading once $x profit was hit? I see you can set it to cap each trade at a certain profit as an exit strategy, however I am not able to figure out how to just have it use a dollar amount as a trading end time.
Thanks for any help
tazmaan is offline  
Reply With Quote
Old 07-16-2008, 10:41 PM   #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

Please check out these reference samples: http://www.ninjatrader-support.com/v...ead.php?t=4084
http://www.ninjatrader-support.com/v...ead.php?t=4804
NinjaTrader_Josh is offline  
Reply With Quote
Old 07-17-2008, 01:58 AM   #3
tazmaan
Junior Member
 
Join Date: Jun 2008
Posts: 19
Thanks: 0
Thanked 0 times in 0 posts
Default

Thank you very much Josh, I will take a look at those and see if I can figure them out.
I have another question in the meantime however.
I am trying to get an exit strategy working, and not having much luck.
It's basic, when the close of a bar is 10 ticks higher than the sma, close the short, when close is 10 ticks lower than the sma, close the long.
I have only been using the wizard until now, as this is very new to me, and have tried quite a few times to get it working, but not working quite right yet.
I have tried when close +10 < sma then exit, and close -10 > sma then exit, not quite right
also tried close +10 crosses under sma etc still not working.
I am using the offset field as it's the only place i see where I might add those 10 ticks, and have tried on both the close parameter and the sma parameter. Also tried setting the offset as price instead of ticks.

I can give exact details if you need them, as to the example where it's not working, but hopefully you know what I am doing wrong without alot more detail (you seem to know your stuff so I am sure you are already typing )
Thanks again!
tazmaan is offline  
Reply With Quote
Old 07-17-2008, 04:05 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

You want to do it like these screenshots. For the Exit order you want to match it to your entry order's signal name.
Attached Images
File Type: jpg 12.JPG (35.5 KB, 23 views)
File Type: jpg 13.JPG (44.9 KB, 25 views)
NinjaTrader_Josh is offline  
Reply With Quote
Old 07-17-2008, 07:35 AM   #5
tazmaan
Junior Member
 
Join Date: Jun 2008
Posts: 19
Thanks: 0
Thanked 0 times in 0 posts
Default

Josh,
That is exactly how I had it, but it was exiting incorrectly.
Also, the example you gave was for exiting the short, but you had +10 offset. If I wanted the short exited only when the close price was 10 ticks above the sma, wouldn't I have to subtract 10 ticks from the close price in order to get this?

Also, the setting for exiting long, the offset would be opposite right?
tazmaan is offline  
Reply With Quote
Old 07-17-2008, 10:50 PM   #6
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

It depends what you want. Take a calculator to both sides and determine what you want in terms of + or -.

Please describe why you feel it is exiting incorrectly? The picture I have shown will exit the short position if the closing price is 10 ticks above the SMA value. Let us say the close price is 100 and the SMA price is 99.99 right now. According to our example 100 + 0.10 = 100.1. That is > 99.99 so we will exit short.

Your orders will exit/enter exactly whenever your condition evaluates to true. It is easiest just to use a calculator and run through some examples by hand with pen and paper to see exactly what values and how your conditions interact.
NinjaTrader_Josh is offline  
Reply With Quote
Old 07-18-2008, 12:28 AM   #7
tazmaan
Junior Member
 
Join Date: Jun 2008
Posts: 19
Thanks: 0
Thanked 0 times in 0 posts
Default

Thanks Josh,
For some reason, I didn't change a thing but now it is working correctly. The platform did get laggy on me last night and actually ended up crashing and I had to start it up again. Maybe it was just a fluke with the platform.
Anyhow, thanks for your help, I had it correct the entire time but apparently the strat tester just wasn't running properly at the time.

Thanks for the wonderful support!
tazmaan 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
Profit target reached, how to stop strategy? eb486 Automated Trading 3 06-05-2008 09:31 AM
Strategy: Monitoring Stop-Loss and Profit Target Orders NinjaTrader_Josh Reference Samples 0 02-23-2008 11:15 PM
Ending Ninjascript strategy jlm0@infionline.net General Programming 50 11-14-2007 10:59 PM
Strategy: Modifying the price of stop loss and profit target orders NinjaTrader_Josh Reference Samples 0 09-06-2007 12:46 PM
Strategy Wizard and variable Profit Target scjohn Strategy Development 1 06-21-2007 07:16 AM


All times are GMT -6. The time now is 12:58 PM.