Thanks.
Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Trailing Stop in Unmanaged Approach
Collapse
X
-
Trailing Stop in Unmanaged Approach
Dear Sirs,
being that I must use unmanaged approach to develop my strategy and being that I would need StopLoss, ProfitTarget and TrailStop, I substitute ProfitTarget and StopLoss with two oco orders.
My question is: how can I write code lines that perform TrailStop function?
Did someone already write in his strategy own TrailStop routine?
Thanks
Comment
-
Hi mbogliardi, there have been threads on how to implement custom trailing stop code every few weeks. Basically, you will have to follow these steps:
1) monitor your orders for fills
2) when an order is filled, submit the stop and record the price you submit the stop
3) with every tick that comes in, check to see if the new price has moved in your favor
4) when the price has moved far enough in your favor, move/change the stop price
5) when your stop or target has been hit, reset both orders to nullAustinNinjaTrader Customer Service
Comment
-
First of all thanks for quick answer.
But my strategy is based on 60 min bars.
You say that every tick that comes I must adjust stop level.
How can I do this?
In my strategy I have the following statements:
protected override void OnBarUpdate()
protected override void OnOrderUpdate(IOrder order)
protected override void OnExecution(IExecution execution)
If I set "calculate on bar close = false", do the statements inside OnBarUpdate() udate every tick?
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by Geovanny Suaza, 02-11-2026, 06:32 PM
|
0 responses
639 views
0 likes
|
Last Post
|
||
|
Started by Geovanny Suaza, 02-11-2026, 05:51 PM
|
0 responses
366 views
1 like
|
Last Post
|
||
|
Started by Mindset, 02-09-2026, 11:44 AM
|
0 responses
107 views
0 likes
|
Last Post
by Mindset
02-09-2026, 11:44 AM
|
||
|
Started by Geovanny Suaza, 02-02-2026, 12:30 PM
|
0 responses
569 views
1 like
|
Last Post
|
||
|
Started by RFrosty, 01-28-2026, 06:49 PM
|
0 responses
572 views
1 like
|
Last Post
by RFrosty
01-28-2026, 06:49 PM
|

Comment