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 Educational Resources > Reference Samples

Reference Samples Official NinjaScript reference code samples

Reply
 
Thread Tools Display Modes
Old 08-03-2009, 07:26 AM   #1
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 Strategy: Stopping a strategy after consecutive losers

Reference sample for NinjaTrader 6.5.xxxx.x or greater.

Trending days or ranging days can make or break a strategy. If you have a system that does extremely well on trending days, you may look for a way to turn that system off during range-bound days. A simple filter you may use could be something like, "If the last three trades were consecutive losers, stop trading for the rest of the session."

This reference sample demonstrates the following concepts:
  • Obtaining previous trade information to decide whether or not to keep trading for the day
Important methods and properties used include:Other methods and properties of interest include:Import instructions for NinjaTrader 6.5.XXXX.X or greater:
  1. Download the file contained in this thread to your PC desktop
  2. From the Control Center window, select the menu File > Utilities > Import NinjaScript
  3. Select the downloaded file
Attached Files
File Type: zip SampleTradeObjects.zip (4.1 KB, 1614 views)
NinjaTrader_Josh is offline  
Reply With Quote
The following user says thank you to NinjaTrader_Josh for this post:
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
BarsSinceExit() Stopping strategy from executing Obi Automated Trading 1 06-25-2009 08:40 AM
Starting and stopping a strategy dpaulw Automated Trading 6 12-09-2008 08:09 AM
Stopping a strategy eswap0 Automated Trading 1 11-29-2008 06:49 AM
Strategy suddenly stopping heech Strategy Development 2 11-21-2008 05:00 PM
Stopping Strategy jlm0@infionline.net Strategy Development 22 04-05-2008 06:37 AM


All times are GMT -6. The time now is 09:01 AM.