![]() |
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
|
|||||||
| Strategy Development Support for the development of custom automated trading strategies using NinjaScript. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Junior Member
Join Date: Oct 2011
Posts: 3
Thanks: 2
Thanked 0 times in 0 posts
|
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? |
|
|
|
|
|
#2 |
|
Senior Member
Join Date: Sep 2008
Posts: 543
Thanks: 80
Thanked 187 times in 131 posts
|
CumProfit resets to zero every time the strategy is disabled.
|
|
|
|
|
The following 2 users say thank you to Radical for this post: |
|
|
|
#3 |
|
Junior Member
Join Date: Oct 2011
Posts: 3
Thanks: 2
Thanked 0 times in 0 posts
|
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. |
|
|
|
|
|
#4 |
|
Senior Member
Join Date: Sep 2008
Posts: 543
Thanks: 80
Thanked 187 times in 131 posts
|
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.
|
|
|
|
|
The following user says thank you to Radical for this post: |
|
|
|
#5 | |
|
Junior Member
Join Date: Oct 2011
Posts: 3
Thanks: 2
Thanked 0 times in 0 posts
|
Quote:
http://www.ninjatrader.com/support/f...ead.php?t=3477 Am I headed down the right road? Thanks again, R3 |
|
|
|
|
![]() |
| Tags |
| position sizing |
| Thread Tools | |
| Display Modes | |
|
|
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 |