RK.
Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Stop that trails at close of prior bar
Collapse
X
-
Hi rasdaka, thanks for posting. We have a few examples of break even and trailing stops in the strategy builder here:
You can do this in a hand-written script as well, while Position.MarketPosition == MarketPosition.Long/ or Short, use SetStopLoss() method, using the Price parameter type e.g.
if(Position.MarketPosition == MarketPosition.Long)
{
if(Close[0] > Close[1])
{
SetStopLoss(CalculationMode.Price, Close[1]);
}
}
Kind regards,
-ChrisL
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by NullPointStrategies, 03-13-2026, 05:17 AM
|
0 responses
89 views
0 likes
|
Last Post
|
||
|
Started by argusthome, 03-08-2026, 10:06 AM
|
0 responses
152 views
0 likes
|
Last Post
by argusthome
03-08-2026, 10:06 AM
|
||
|
Started by NabilKhattabi, 03-06-2026, 11:18 AM
|
0 responses
80 views
0 likes
|
Last Post
|
||
|
Started by Deep42, 03-06-2026, 12:28 AM
|
0 responses
53 views
0 likes
|
Last Post
by Deep42
03-06-2026, 12:28 AM
|
||
|
Started by TheRealMorford, 03-05-2026, 06:15 PM
|
0 responses
63 views
0 likes
|
Last Post
|

Comment