Announcement
Collapse
Looking for a User App or Add-On built by the NinjaTrader community?
Visit NinjaTrader EcoSystem and our free User App Share!
Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less
Partner 728x90
Collapse
NinjaTrader
place limit entry and stopLoss exit at high and low of bar prior to test bar
Collapse
X
-
place limit entry and stopLoss exit at high and low of bar prior to test bar
I'm trying to do this with this but it won't place any stops. The entries are generated, but no stops.
Tags: None
-
Hello trader3000a,
Thanks for your post.
It appears you are using the Strategy Builder and the strategy builder operates only under the "Managed Approach" (link below) which governs how orders are placed. It is possible that the orders are being placed but if the price is not hitting the limit type orders in the same bar they are submitted then the orders are automatically canceled. (You should also check the "Log" tab of the control center for any strategy generated error messages in case there is something else occurring).
In order to "maintain" your stop and target limit type orders, you would have to resubmit them on each new bar until one or the other is hit.
A way to do this would be to create two double-type variables to hold the stop and profit values. If you do not want these values to change for the duration of the trade then you would set the variables in the same set where the entry is made and this will store your stop and profit values. In another set, you would need to check that (using long entry as an example) the strategy is in a long position (see link below) and when that condition is true then submit your orders in that set. So as long as you are in a long position the orders are submitted on each bar. Once one or the other is hit then the condition (in a market position) is no longer true and the orders are no longer submitted.
Note: It is also a good practice to check that the marketposition is flat in your entry sets as that will prevent your entry conditions from becoming true again while you are in a position potentially changing your stop and target!)
References:
https://ninjatrader.com/support/help...ionComparisons
https://ninjatrader.com/support/help...d_approach.htm
Last edited by NinjaTrader_PaulH; 09-24-2021, 08:01 AM.Paul H.NinjaTrader Customer Service
-
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by AaronKoRn, Today, 09:49 PM
|
0 responses
6 views
0 likes
|
Last Post
by AaronKoRn
Today, 09:49 PM
|
||
Started by carnitron, Today, 08:42 PM
|
0 responses
9 views
0 likes
|
Last Post
by carnitron
Today, 08:42 PM
|
||
Started by strategist007, Today, 07:51 PM
|
0 responses
10 views
0 likes
|
Last Post Today, 07:51 PM | ||
Started by StockTrader88, 03-06-2021, 08:58 AM
|
44 responses
3,976 views
3 likes
|
Last Post
by jhudas88
Today, 06:59 PM
|
||
Started by rbeckmann05, Today, 06:48 PM
|
0 responses
9 views
0 likes
|
Last Post
by rbeckmann05
Today, 06:48 PM
|
Comment