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 08-20-2009, 07:13 AM   #16
tamas
Senior Member
 
Join Date: Jan 2009
Location: Budapest, HUNGARY
Posts: 258
Thanks: 0
Thanked 0 times in 0 posts
Default

Hello,

i had so many problems with this, here is my experiences:
In your strategy:
  • If you use default quantity, all trades will be submited always with the same quantity.
  • If you use AccountSize, all trades will be submited like it will count how many can be bought from AccountSize. (Eg, at FOREX trading, it uses Margin for counting.)
Accourding to my experience if you use these two, then it will not use the quantity written in the code, eg:

Code:
EnterLong(50000);
and profit result of these will not be added to AcoountSize. But you can reach profit result, use TradeCollection class and add it to AccountSize value (accourding to my oppinion) in OnExecution() method. At the next trade it will use new AccountSize value.
  • If you use "by strategy" you can define everything from the code.
I hope it helps
tamas is offline  
Reply With Quote
Old 08-20-2009, 07:16 AM   #17
tamas
Senior Member
 
Join Date: Jan 2009
Location: Budapest, HUNGARY
Posts: 258
Thanks: 0
Thanked 0 times in 0 posts
Default

Quote:
Originally Posted by NinjaTrader_Josh View Post
Try using DefaultQuantity for the Enter() orders.
Opps, this is new for me also, thanks
tamas is offline  
Reply With Quote
Old 08-20-2009, 07:30 AM   #18
tamas
Senior Member
 
Join Date: Jan 2009
Location: Budapest, HUNGARY
Posts: 258
Thanks: 0
Thanked 0 times in 0 posts
Default

I tried, and accourding to my oppinion it did not add profit to AccountSize
tamas is offline  
Reply With Quote
Old 08-20-2009, 07:41 AM   #19
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 need to use ByAccountSize and not specify any quantity then if you want it to take control of the aggregation of the size.
NinjaTrader_Josh is offline  
Reply With Quote
Old 08-20-2009, 08:29 AM   #20
Anagoge
Senior Member
 
Join Date: Sep 2008
Posts: 183
Thanks: 0
Thanked 1 time in 1 post
Default

Quote:
Originally Posted by NinjaTrader_Josh View Post
You need to use ByAccountSize and not specify any quantity then if you want it to take control of the aggregation of the size.
Using my test case steps already posted, I've also tried using "by account size" and no quantity using EnterLong() as well as EnterLong(DefaultQuantity), and neither cause the AccountSize to update. Does anyone have any test case at all where it updates during a backtest? The order quantities do change to approximately match the AccountSize, but AccountSize itself is completely static throughout the backtest, similar to what others are reporting. This is the confusing part that I believe should be better documented.
Anagoge is offline  
Reply With Quote
Old 08-20-2009, 08:47 AM   #21
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

Clarified with development, the AccountSize updates in the sense that it will help you keep the quantity dynamic for order placement, not in the sense that accessing the property will give you updated values.

If you want to see actual AccountSize updates you will need to track with your own variables.
NinjaTrader_Josh is offline  
Reply With Quote
Old 08-20-2009, 10:20 AM   #22
Anagoge
Senior Member
 
Join Date: Sep 2008
Posts: 183
Thanks: 0
Thanked 1 time in 1 post
Default

Thanks for checking - please consider sending a note to the doc people to make note of this in the AccountSize topic, since it can be confusing.
Anagoge is offline  
Reply With Quote
Old 08-20-2009, 10:51 AM   #23
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

Thank you for the suggestion. They will be informed.
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
AccountSize drolles Strategy Development 9 06-09-2009 04:29 AM
AccountSize zooinek Strategy Development 4 04-26-2009 02:54 AM
AccountSize and PnL fxRichard Strategy Analyzer 3 01-18-2009 12:30 AM
Defining AccountSize in Strategy total3 Strategy Development 1 04-25-2008 04:48 AM


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