Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
ATR stop out on multipule orders
Collapse
X
-
ATR stop out on multipule orders
Hello - My strategy has multiple entries and I'd like to pull my stop out up to one ATR below (or above on shorts) to my last entry. Can you point me in the right direction to program this? thanksTags: None
-
titleistbb22, you would need to use unique entry names for the signals and then attach the SetStopLoss() as needed -
You can for example calculate the ATR stop value as tried to price and then use SetStopLoss in price mode to set / update the stop.
BertrandNinjaTrader Customer Service
-
Thank you - very helpful - I think the below code is what you are refering to in tying ATR to price
//Breakeven stop
if (Position.GetProfitLoss(Close[0], PerformanceUnit.Points) > ATR(15)[0])
{
SetStopLoss(CalculationMode.Price, Position.AvgPrice);
}
This seems to make sense but it kicks me out on some short positions with our hitting the 1 ATR in profit. Any thoughts? thanksLast edited by titleistbb22; 05-14-2010, 11:14 PM.
Comment
-
Fair enough - a few questions for you on SetTrailStop and SetStopLoss.
I understand that SetStopLoss takes precedence, but can I use multiple StopLoss and TrailStop entries together? Or does the StopLoss simply cancel out the TrailStop?
Can I simply use either multiple StopLoss OR TrailStop orders on the same entry instead of using a mix of StopLoss and TrailStop orders?
Also, what is the difference in how the TrailStop works vs the StopLoss?
Thanks in advance for your time in answering these questions
Comment
-
If you don't use the advanced overload then SetStopLoss() is applied to all entries.
You would have to use an advanced overload method that includes FromEntrySignal if you wanted to use both methods in the same strategy.
SetStopLoss(string fromEntrySignal, CalculationMode mode,double value,bool simulated)
You could then apply SetStopLoss() to one entry and SetTrailStop() to another.
A stop loss submits a fixed order in relation to your entry price.
A trailstop is ammended on a tick by tick basis in relation to the current traded price.Ryan M.NinjaTrader Customer Service
Comment
-
thank you - so I read that I can not use Trailing and Set Stop loss on the same entry. Is that correct?
Comment
-
That's correct titleistbb22 - to have a static stop after entry and then a trail later as the trade progresses, please see the reference sample for adapting stop and target orders from one of my previous replies, this will be the way to go, there're also good starting points in the sharing section on custom trailing algorithms.BertrandNinjaTrader Customer Service
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by judysamnt7, 03-13-2023, 09:11 AM
|
4 responses
53 views
0 likes
|
Last Post
by DynamicTest
Today, 08:25 PM
|
||
Started by ScottWalsh, Today, 06:52 PM
|
4 responses
33 views
0 likes
|
Last Post
by ScottWalsh
Today, 07:40 PM
|
||
Started by olisav57, Today, 07:39 PM
|
0 responses
5 views
0 likes
|
Last Post
by olisav57
Today, 07:39 PM
|
||
Started by trilliantrader, Today, 03:01 PM
|
2 responses
19 views
0 likes
|
Last Post
by helpwanted
Today, 07:25 PM
|
||
Started by cre8able, Today, 07:24 PM
|
0 responses
6 views
0 likes
|
Last Post
by cre8able
Today, 07:24 PM
|
Comment