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 05-17-2012, 09:00 PM   #1
mal1954
Junior Member
 
Join Date: Mar 2012
Posts: 12
Thanks: 0
Thanked 0 times in 0 posts
Default Exit Strategy after certain number of ticks obtained

Hello all,
I would like to program a Strategy so it makes at minimum of say 20 ticks a day.
Say that my StopLoss is 10 ticks and my ProfitTarget is 20 ticks.

I could see 3 main scenarios:

1. 1st trade wins 20 ticks and strategy stops running ( gets disabled? )
2. 1st trade looses 10 ticks. 2nd trade wins 20 ticks. 3rd trade wins 20 ticks - I have a profit of 30 ticks and strategy stops running
3. Likewise I would like to limit my losses. Eg in case I have 3 consecutive losses of say 30 ticks total, the strategy stops running.

So I need a variable to cummulate my losses and my profit and when it reaches certain amount I want strategy to get disabled.

Any thoughts?

M
mal1954 is offline  
Reply With Quote
Old 05-18-2012, 03:15 AM   #2
NinjaTrader_Bertrand
NinjaTrader Customer Service
 
NinjaTrader_Bertrand's Avatar
 
Join Date: Sep 2008
Location: Germany
Posts: 22,411
Thanks: 252
Thanked 976 times in 959 posts
Default

mal1954, you can check into this example - http://www.ninjatrader.com/support/f...ead.php?t=4084

It deals with using the Performance class available in our NinjaScript to halt a strategy once certain PnL levels for the session are hit.
NinjaTrader_Bertrand is online now  
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
Program CLOSING a trade after PROFIT/LOSS of 10 ticks obtained mal1954 Automated Trading 1 05-14-2012 10:26 AM
Please: Ruler Draw Object to include number of Ticks Turtle Trader Suggestions And Feedback 1 01-12-2011 08:58 AM
Volume chart with number of ticks per bar jim380 Charting 3 10-27-2010 07:35 AM
Number of ticks up and down in a bar. xTrader1 Version 7 Beta General Questions & Bug Reports 3 07-20-2010 05:16 AM
Number of ticks... justme Suggestions And Feedback 5 03-09-2008 11:27 PM


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