Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Trailing stop attachment
Collapse
X
-
Hi Teebone21, thanks for your question.
I have an example here on a break even in the strategy builder. You can take this same concept and update the stop loss to a value that changes over time instead of the average entry price.
Please let me know if I can assist any further.
Attached Files
- Likes 2
-
Hello Chris,
please could you explain:
when StopLossMode == 0 is likely expected a stop loss set on the next tab of the SB?
I remember a similar sample using state/ bool, is there a specific reason this sample now uses a StopLossMode/ integer ? What is the advantage?
How would it be possible to add another exit condition working together with the breakeven when StopLossMode==1, for example exit when current price crosses low[1] ?
thank you.
Comment
-
Hello guidoisot,
Thanks for your post.
When there are two condition states you can use a bool or you can use a numerical value, either way makes no difference as it is up to you as the programmer to know if you are using a bool or a numerical value.
Yes, you can add another exit condition when the variable StopLossMode is equal to 1. You would basically copy set 4 and add the cross condition and change the exit to an ExitLong.
- Likes 1
Comment
-
thank you.
I have added a third exit but it does not work.
At time 16:00 there is also a trade that does not breakeven.
Please can you help to find out why?
BREAKEVENstrategyMANUAL02.cs
Last edited by guidoisot; 04-29-2020, 06:54 AM.
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by CarlTrading, 03-31-2026, 09:41 PM
|
1 response
43 views
0 likes
|
Last Post
|
||
|
Started by CarlTrading, 04-01-2026, 02:41 AM
|
0 responses
21 views
0 likes
|
Last Post
by CarlTrading
04-01-2026, 02:41 AM
|
||
|
Started by CaptainJack, 03-31-2026, 11:44 PM
|
0 responses
30 views
1 like
|
Last Post
by CaptainJack
03-31-2026, 11:44 PM
|
||
|
Started by CarlTrading, 03-30-2026, 11:51 AM
|
0 responses
50 views
0 likes
|
Last Post
by CarlTrading
03-30-2026, 11:51 AM
|
||
|
Started by CarlTrading, 03-30-2026, 11:48 AM
|
0 responses
40 views
0 likes
|
Last Post
by CarlTrading
03-30-2026, 11:48 AM
|

Comment