NinjaTrader Support Forum  

Go Back   NinjaTrader Support Forum > NinjaScript Educational Resources > Reference Samples

Reference Samples Official NinjaScript reference code samples

Reply
 
Thread Tools Display Modes
Old 02-23-2008, 11:15 PM   #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: Monitoring Stop-Loss and Profit Target Orders

Reference sample for NinjaTrader 6.5.XXXX.X or greater.

At times you may have a need to monitor the stop-loss and profit target orders generated by the SetStopLoss(), SetTrailStop() or SetProfitTarget() methods. You can accomplish this by capturing their unique IOrder.Token values as the the OnOrderUpdate() method is called and process them into a collection for future referencing.


The attached reference sample demonstrates the following concepts:
  • Monitoring stop-loss order states
  • Monitoring profit target order states
Important methods and properties 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 SampleMonitorStopProfit.zip (1.8 KB, 1845 views)
File Type: zip SampleMonitorStopProfit_NT7.zip (1.9 KB, 1291 views)
NinjaTrader_Josh 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 and Stop Loss not honored pjwinner Strategy Analyzer 6 11-30-2007 09:45 AM
Stop Loss - profit target settings deanldavis475 Miscellaneous Support 1 11-26-2007 07:31 AM
Strategy: Modifying the price of stop loss and profit target orders NinjaTrader_Josh Reference Samples 0 09-06-2007 12:46 PM
Target and Stop Loss Orders on Dome Quicktrader10 General Programming 3 06-27-2007 02:00 PM
Default stop loss and profit target as GTC equitydealer General Programming 4 06-18-2007 11:31 PM


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