-thanks
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
Send stop order within same bar as entry
Collapse
X
-
Send stop order within same bar as entry
I have a strategy that works on CalculateOnBarClose=true. When it enters an order (mkt) at the next bar open, the strategy waits until the next bar to enter a stop order using ExitLong(Short)Stop(). Is there a simple way of sending a stop order when the entry order is filled? I don't use SetStopLoss() because the value is based on ATR and thus not fixed for the whole strategy.
-thanksTags: None
-
laparker, I think you could still use SetStopLoss with the ATR value in the OnBarUpdate() then for this. Another solution is to move this to the OnExecution() to send the stop once the entry order is filled -
The OnOrderUpdate() and OnExecution() methods are reserved for experienced programmers. Instead of using Set() methods to submit stop-loss and profit target orders, you can submit and update them manually through the use of IOrder and IExecution objects in the OnOrderUpdate() and OnExecution() methods. The OnOrderUpdate()BertrandNinjaTrader Customer Service
-
Bertrand - your example relates to using OnExecution() which would be a big code change and learning curve for me. Using SetStopLoss() looks like I can keep within OnBarUpdate() but I don't see how to cancel the previous SetStopLoss(). Do I include a new SetStopLoss() order when flat and before the new entry order and if so, what do I use as the value?
-thanks
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by rhyminkevin, Today, 04:58 PM
|
4 responses
52 views
0 likes
|
Last Post
by dp8282
Today, 06:13 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