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 04-25-2008, 03:22 AM   #1
total3
Junior Member
 
Join Date: Apr 2008
Posts: 12
Thanks: 0
Thanked 0 times in 0 posts
Default Defining AccountSize in Strategy

Hello,
I am trying to define the accountsize for a strategy but I am lost:

I have put
protected override void Initialize()
{
AccountSize = 5000;
}
to define the accountsize. So far so good. Now when I open a chart & add the strategy under "Order properties" it says set order quanity "by strategy". Now I have to change this manually to "by account size" which is not good when I have to do this many times over.

Is there a way to have this done automatically so that orders are always handeled using the accountsize ?

My order routine says: EnterLong(DefaultQuantity, "EnterLong1");

Is there a way to reference to the accountsize or somehow set the DefaultQuantity to the accountsize ?

Thank you
Martin
total3 is offline  
Reply With Quote
Old 04-25-2008, 04:48 AM   #2
NinjaTrader_Josh
NinjaTrader Product Manager
 
NinjaTrader_Josh's Avatar
 
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 106 times in 70 posts
Default

You will simply need to keep track of what your account size is and just submit orders that match your current account size. NinjaTrader does not currently access your true brokerage account size so you will need to adjust for that accordingly.
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
Defining Default Chart Trader ATM jeremymgp ATM Strategies (Discretionary Trading) 1 12-28-2007 09:19 AM


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