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 07-03-2012, 11:14 PM   #1
r3algood
Junior Member
 
Join Date: Oct 2011
Posts: 3
Thanks: 2
Thanked 0 times in 0 posts
Default CumProfit and Position Sizing

Hi, I am using the CumProfit in the following manner:

Performance.AllTrades.TradesPerformance.Currency.C umProfit

and using this value to determine position size for the next trade.

My question is this: What happens if NinjaTrader is closed, does my strategy still know to trade the proper size or is the cumprofit forgotten about?
r3algood is offline  
Reply With Quote
Old 07-04-2012, 09:32 AM   #2
Radical
Senior Member
 
Join Date: Sep 2008
Posts: 543
Thanks: 80
Thanked 187 times in 131 posts
Default

CumProfit resets to zero every time the strategy is disabled.
Radical is offline  
Reply With Quote
The following 2 users say thank you to Radical for this post:
Old 07-05-2012, 09:00 PM   #3
r3algood
Junior Member
 
Join Date: Oct 2011
Posts: 3
Thanks: 2
Thanked 0 times in 0 posts
Default

Thank you Radical for the response.

After much searching around this forum and other forums around the net I am still unsure of how to implement a system so that the strategy DOES remember the cumulative profit, even after turning NinjaTrader off to reboot computer. I assume (and probably incorrectly) that I would write the data to some sort of file for storage on my local hard drive and read that file into the strategy to use the proper position sizing?

Any help would be much appreciated!

Thanks, R3.
r3algood is offline  
Reply With Quote
Old 07-05-2012, 10:02 PM   #4
Radical
Senior Member
 
Join Date: Sep 2008
Posts: 543
Thanks: 80
Thanked 187 times in 131 posts
Default

This may not be the best option, and I'm sure some people here would know a better way, but I guess a simple way of doing it would just be to get the CumProfit while the strategy is running, and every time it updates (maybe use OnPositionUpdate for this), write the value of CumProfit to a text file. Then the next time you run the strategy, just get the CumProfit value from the text file and use that to adjust your position size.
Last edited by Radical; 07-05-2012 at 10:18 PM.
Radical is offline  
Reply With Quote
The following user says thank you to Radical for this post:
Old 07-06-2012, 12:03 AM   #5
r3algood
Junior Member
 
Join Date: Oct 2011
Posts: 3
Thanks: 2
Thanked 0 times in 0 posts
Default

Quote:
Originally Posted by Radical View Post
This may not be the best option, and I'm sure some people here would know a better way, but I guess a simple way of doing it would just be to get the CumProfit while the strategy is running, and every time it updates (maybe use OnPositionUpdate for this), write the value of CumProfit to a text file. Then the next time you run the strategy, just get the CumProfit value from the text file and use that to adjust your position size.
Radical, I cannot thank you enough for taking your time and posting here. I am now looking into the following link as a way to accomplish what you have described:

http://www.ninjatrader.com/support/f...ead.php?t=3477

Am I headed down the right road?

Thanks again, R3
r3algood is offline  
Reply With Quote
Reply

Tags
position sizing

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
Sync Account position and equity-based position sizing does not seem to work... JezzaNT Automated Trading 6 06-05-2012 06:46 AM
Position sizing melvinferds Strategy Development 3 06-04-2009 11:02 PM
Position Sizing magicboiz Strategy Analyzer 9 12-05-2008 01:01 PM
Position Sizing sauer11155 Strategy Analyzer 1 08-18-2008 02:13 PM
Position Sizing............ Angel ATM Strategies (Discretionary Trading) 5 11-20-2007 01:21 PM


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