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 CarlTrading, 03-31-2026, 09:41 PM
|
1 response
67 views
0 likes
|
Last Post
|
||
|
Started by CarlTrading, 04-01-2026, 02:41 AM
|
0 responses
36 views
0 likes
|
Last Post
by CarlTrading
04-01-2026, 02:41 AM
|
||
|
Started by CaptainJack, 03-31-2026, 11:44 PM
|
0 responses
60 views
1 like
|
Last Post
by CaptainJack
03-31-2026, 11:44 PM
|
||
|
Started by CarlTrading, 03-30-2026, 11:51 AM
|
0 responses
62 views
0 likes
|
Last Post
by CarlTrading
03-30-2026, 11:51 AM
|
||
|
Started by CarlTrading, 03-30-2026, 11:48 AM
|
0 responses
53 views
0 likes
|
Last Post
by CarlTrading
03-30-2026, 11:48 AM
|

Comment