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 11-15-2007, 02:51 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: Using trade performance statistics for money management

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

For money management reasons you may want to limit your strategy from aggressive daytrading or you may want to cut your losses short on volatile sessions that are not playing out in your favor. This can be done through the utilization of the Performance object.

The attached reference sample demonstrates the following concepts:
  • Locking in realized profits after a certain amount of gains have been achieved during the trading session
  • Cutting realized losses short after a certain amount of losses have been accrued over the trading session
  • Preventing aggressive amounts of trading
Important methods and properties include:* This reference sample uses the .AllTrades property. This property will include all historical virtual trades as well as real-time trades. If you wish to only make calculations based on real-time trades you can use the .RealtimeTrades property.

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 SamplePnL.zip (1.4 KB, 5729 views)
NinjaTrader_Josh is offline  
Reply With Quote
The following 2 users say 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
No money going in Realized P&L when trade closes jlm0@infionline.net Historical NinjaTrader 6.5 Beta Threads 12 11-12-2007 07:01 AM
Trade management samples simul316 ATM Strategies (Discretionary Trading) 6 06-23-2007 07:47 PM
Money Management Coding wiguidry Strategy Development 1 04-11-2007 07:53 AM
feature request - money management equitydealer Suggestions And Feedback 1 11-11-2006 02:32 AM
Performance Manager Trade Deletion aspTrader Miscellaneous Support 2 03-25-2005 07:20 AM


All times are GMT -6. The time now is 03:59 PM.