NinjaTrader Support Forum  
X

Attention!

This website will be down for maintenance from Friday May 24th at 6PM MDT until Sunday May 26th at 12PM 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 03-09-2010, 08:18 AM   #1
poseidon_sthlm
Senior Member
 
Join Date: Aug 2009
Posts: 153
Thanks: 11
Thanked 5 times in 4 posts
Default Counting the number of loosing and winning trades during the last 30 days

Hi!
For money management reasons I want to stop my strategy if the ratio of winning and loosing trades during the last 30 days falls below X%. How can I do this? I can't find a way to use the strategy performance methods with a time property.

/Regards
poseidon_sthlm is offline  
Reply With Quote
Old 03-09-2010, 09:11 AM   #2
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

poseidon_sthlm,

Unfortunately there is no built in function for this. You will have to custom program your own.
NinjaTrader_Josh is offline  
Reply With Quote
Old 03-10-2010, 02:48 AM   #3
poseidon_sthlm
Senior Member
 
Join Date: Aug 2009
Posts: 153
Thanks: 11
Thanked 5 times in 4 posts
Default

Ok, I got it. The key is to use the DateTime objekt TIME in the IExecution object returned by the trade property EXIT
Code:
Trade trade;

trade.Exit.Time
poseidon_sthlm is offline  
Reply With Quote
Old 06-11-2010, 09:13 AM   #4
wahooj
Member
 
Join Date: Mar 2010
Posts: 30
Thanks: 0
Thanked 0 times in 0 posts
Default

Hi poseidon_sthlm,

How are you checking the performance of the last 30 days. Are you checking if today's date is > 30 days ago and then applying your win/loss formula? Does it work for backtesting?

-thx
wahooj 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
Compute Highest High between 9:30 AM and 10:30 AM mgbloomfield Indicator Development 5 03-20-2013 04:26 PM
Maximum number of days for non-minute timeframe chart RK_trader Miscellaneous Support 1 05-10-2008 09:50 PM
Exit on Close exited 30 Minutes Early (instead of 30 secs) wayneFH Strategy Development 6 04-28-2008 04:52 AM
General Question about indicators on Min(x) charts over a number of days Sidhartha General Programming 2 04-10-2008 08:01 AM
$97.30 Sell-Stop Order Filled at $96.30! davidfw1866 ATM Strategies (Discretionary Trading) 3 11-08-2007 06:43 AM


All times are GMT -6. The time now is 05:24 PM.