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,
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.
NinjaTrader's Strategy Builder empowers traders of all levels with point-and-click automated trading strategy development. Create your own advanced automated...
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 rhyminkevin, Today, 04:58 PM
|
3 responses
48 views
0 likes
|
Last Post
by Anfedport
Today, 05:24 PM
|
||
Started by iceman2018, Today, 05:07 PM
|
0 responses
5 views
0 likes
|
Last Post
by iceman2018
Today, 05:07 PM
|
||
Started by lightsun47, Today, 03:51 PM
|
0 responses
7 views
0 likes
|
Last Post
by lightsun47
Today, 03:51 PM
|
||
Started by 00nevest, Today, 02:27 PM
|
1 response
14 views
0 likes
|
Last Post
by 00nevest
Today, 03:48 PM
|
||
Started by futtrader, 04-21-2024, 01:50 AM
|
4 responses
50 views
0 likes
|
Last Post
by futtrader
Today, 03:01 PM
|
Comment