NinjaTrader Support Forum  

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-13-2012, 08:15 AM   #1
Adamdetx
Member
 
Join Date: Mar 2012
Posts: 30
Thanks: 7
Thanked 0 times in 0 posts
Default Position Size based on account size

I recently completed a strategy using the NT7 strategy wizard. I am very inexperienced in coding but I am happy with the outcome of this strategy. I have been looking on this site for suggestions on some way to change the order quantity according to account size. I am trading Futures contracts, and I am hoping to find some way to have the script get the account size, divide by 5000, and then round down to nearest whole number in order to allow $5000+ of margin per contract trading. I would also like it to update after each trade. Is there a good way to do this?
Thanks.
--Adam.
Adamdetx is offline  
Reply With Quote
Old 04-13-2012, 08:44 AM   #2
NinjaTrader_Joydeep
NinjaTrader Customer Service
 
NinjaTrader_Joydeep's Avatar
 
Join Date: Dec 2011
Location: India
Posts: 3,286
Thanks: 580
Thanked 546 times in 541 posts
Default

Hello Adam,
Welcome to the forum and I am happy to assist you.
Unfortunately the strategy is for coding simple ideas. If you want to code a account size like you described, you have to unlock your code and edit it further in the NinjaScript editor.

The GetAccountValue function will get you the account value and once you have it you can simply divide it with the margin amount. Please refer here for more on GetAccountValue http://www.ninjatrader.com/support/h...countvalue.htm

You can check the values in the OnExection event for any updates after each trades http://www.ninjatrader.com/support/h...nexecution.htm

Please let me know if I can assist you any further.
NinjaTrader_Joydeep is offline  
Reply With Quote
Old 04-13-2012, 09:01 AM   #3
Adamdetx
Member
 
Join Date: Mar 2012
Posts: 30
Thanks: 7
Thanked 0 times in 0 posts
Default

Thanks for the help, I'll see what I can do with that.
Adamdetx is offline  
Reply With Quote
Old 04-13-2012, 09:10 AM   #4
NinjaTrader_Joydeep
NinjaTrader Customer Service
 
NinjaTrader_Joydeep's Avatar
 
Join Date: Dec 2011
Location: India
Posts: 3,286
Thanks: 580
Thanked 546 times in 541 posts
Default

Hello Adam,
Thanks for your note.
Please let me know if I can assist you any further.
NinjaTrader_Joydeep is offline  
Reply With Quote
Reply

Tags
account size, order entry

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
Set Entry Size Based on Current Account Size Anagoge Strategy Analyzer 4 09-30-2010 04:57 AM
Trade based off of Sim account size shazzmoe Strategy Analyzer 3 08-04-2010 04:59 PM
Please add Bid size, Ask size, Last size to Market Analyzer Profitmake Version 7 Beta General Questions & Bug Reports 3 05-26-2010 09:21 AM
Recalculating position size based on account size, % risked and stop loss clivehunt Strategy Development 18 03-22-2009 11:25 AM
position sizing using account size bkout Automated Trading 1 03-12-2009 06:04 AM


All times are GMT -6. The time now is 09:53 PM.