Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Strategy Builder Quantity entry based on close price
Collapse
X
-
Strategy Builder Quantity entry based on close price
Is there a way in Strategy Builder to set the entry quantity based on price close? I want to set order quantity = 1000/close. So the entry quantity varies depending on close price. Thanks.Tags: None
-
Hello designer01,
In the strategy builder to do any math this has to be done with the offset of a series.
Add a custom int series object on the Additional Data page.
In the first condition set with no conditions set the value of the int series on the current bar to 1000.
Then set the value of the int series again, this time to the value of itself (select from the Misc -> Custom series), and in the Offset select the '/' for divide in the arithmetic type drop-down, and for the value click set -> Price -> Close.
When selecting Exit long position with a market order, click to set the stop quantity, set this to Misc -> Custom series.Last edited by NinjaTrader_ChelseaB; 08-30-2022, 08:17 AM.Chelsea B.NinjaTrader Customer Service
-
Hello Chelsea, I am following your instructions but on the Additional Data page under Custom Series it does not allow me to place a numeric value for 1000, only Name and Type. Am I missing a setting? See image below. Thanks.
In the Script Editor should look like this...
if (CrossAbove(Close, EMA1, 1))
{
Qty = ( 1000/ Close[0] ) ;
EnterLong(Convert.ToInt32(Qty), "");
}
Last edited by designer01; 08-28-2022, 09:01 PM.
Comment
-
Hello Chelsea,
I added a custom double series object on the Additional Data page but on the conditions Set does not show it, only shows User input and User variables on the list but no Custom Series for the double I placed under the Custom Series tab. Could you show me some screenshots of these method. I must be missing a step.
I was able to do Qty = ( Close[0] /1000) ; but not the formula I want which is Qty = ( 1000/ Close[0] ) ;
See image below. Thank you.
Last edited by designer01; 08-29-2022, 03:12 PM.
Comment
-
Hello designer01,
Screenshots attached.Add a custom int series object on the Additional Data page.
In the first condition set with no conditions set the value of the int series on the current bar to 1000.
Then set the value of the int series again, this time to the value of itself (select from the Misc -> Custom series), and in the Offset select the '/' for divide in the arithmetic type drop-down, and for the value click set -> Price -> Close.
May I have a screenshot of the Additional Data page from your script?Last edited by NinjaTrader_ChelseaB; 08-30-2022, 08:17 AM.Chelsea B.NinjaTrader Customer Service
Comment
-
Hello Chelsea,
Thank you works great!
Where is a good place to learn this? Any advance Strategy Builder videos?
Comment
-
Hello designer01,
There are not any advanced Strategy Builder videos on the NinjaTrader YouTube channel at this time.
The 'Automate Your Trading with NinjaTrader's Strategy Builder' does discuss the only math available is with series.
With that knowledge a custom series has to be used to do any math operations, that becomes the building tool anywhere math is needed.Chelsea B.NinjaTrader Customer Service
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by argusthome, 03-08-2026, 10:06 AM
|
0 responses
80 views
0 likes
|
Last Post
by argusthome
03-08-2026, 10:06 AM
|
||
|
Started by NabilKhattabi, 03-06-2026, 11:18 AM
|
0 responses
46 views
0 likes
|
Last Post
|
||
|
Started by Deep42, 03-06-2026, 12:28 AM
|
0 responses
29 views
0 likes
|
Last Post
by Deep42
03-06-2026, 12:28 AM
|
||
|
Started by TheRealMorford, 03-05-2026, 06:15 PM
|
0 responses
32 views
0 likes
|
Last Post
|
||
|
Started by Mindset, 02-28-2026, 06:16 AM
|
0 responses
66 views
0 likes
|
Last Post
by Mindset
02-28-2026, 06:16 AM
|

Comment