NinjaTrader Support Forum  

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 03-18-2009, 03:00 PM   #1
SuperDriveGuy
Member
 
Join Date: Mar 2009
Posts: 60
Thanks: 0
Thanked 0 times in 0 posts
Default How to set ProfitTarget and Stoploss as (open price+x) and (open price -x)

Hi,
I have created my first strategy and see some results, but I have not set the ProfitTarget and Stoploss correctly so I get skewed figures.

How do I set the ProfitTarget to (opening price + 37 points) and StopLoss to (opening price - 10 points)?

Thanks,
SuperDriveGuy is offline  
Reply With Quote
Old 03-18-2009, 03:15 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

In the Initialize() method please use SetProfitTarget(CalculationMode.Ticks, 37) and SetStopLoss(CalculationMode.Ticks, 10). Please see these articles: http://www.ninjatrader-support.com/H...fitTarget.html
http://www.ninjatrader-support.com/H...tStopLoss.html
NinjaTrader_Josh is offline  
Reply With Quote
Old 03-18-2009, 04:06 PM   #3
SuperDriveGuy
Member
 
Join Date: Mar 2009
Posts: 60
Thanks: 0
Thanked 0 times in 0 posts
Default

Quote:
Originally Posted by NinjaTrader_Josh View Post
In the Initialize() method please use SetProfitTarget(CalculationMode.Ticks, 37) and SetStopLoss(CalculationMode.Ticks, 10). Please see these articles: http://www.ninjatrader-support.com/H...fitTarget.html
http://www.ninjatrader-support.com/H...tStopLoss.html
Hi Josh,

I have tried this before, but it does not have the desired effect. The entries are being opened and closed the same second. If I use percentage, it does resemble what I want, but not with points.

So for the DJIA I am able to say ProfitTarget is .5% and TrailingStopLoss .17 and that works! So for a position opened at 7450, I would get a profittarget of 7487 and trailing stoploss of 7438.

Want I want is if I buy the DJIA at 7450, then I want the ProfitTarget to be 7487 and the trailing stoploss to be 7440.

I hope I am making some sense :-)

Regards
SuperDriveGuy is offline  
Reply With Quote
Old 03-18-2009, 04:22 PM   #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

Ticks are not points depending on your instrument. You need to do the math to figure out what would equate to the points.
NinjaTrader_Josh is offline  
Reply With Quote
Old 03-19-2009, 02:19 AM   #5
SuperDriveGuy
Member
 
Join Date: Mar 2009
Posts: 60
Thanks: 0
Thanked 0 times in 0 posts
Default

Quote:
Originally Posted by NinjaTrader_Josh View Post
Ticks are not points depending on your instrument. You need to do the math to figure out what would equate to the points.
Thanks! I got the point.
SuperDriveGuy 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
Startegy involving previous day close price and current open price kirankksimon General Programming 3 03-11-2009 08:59 AM
Does OnOrderUpdate() report every price change while an order is open? tradefaz General Programming 1 08-27-2008 10:34 PM
Phantom price spikes with open tick? mazachan Charting 12 04-29-2008 09:55 PM
Open market price with Tick data skynetman Strategy Development 1 04-15-2008 07:03 PM
Need Help with plotting line at the open price on the hour dpanglin Indicator Development 5 01-18-2008 10:33 AM


All times are GMT -6. The time now is 12:17 AM.