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 argusthome, 03-08-2026, 10:06 AM
|
0 responses
111 views
0 likes
|
Last Post
by argusthome
03-08-2026, 10:06 AM
|
||
|
Started by NabilKhattabi, 03-06-2026, 11:18 AM
|
0 responses
59 views
0 likes
|
Last Post
|
||
|
Started by Deep42, 03-06-2026, 12:28 AM
|
0 responses
38 views
0 likes
|
Last Post
by Deep42
03-06-2026, 12:28 AM
|
||
|
Started by TheRealMorford, 03-05-2026, 06:15 PM
|
0 responses
41 views
0 likes
|
Last Post
|
||
|
Started by Mindset, 02-28-2026, 06:16 AM
|
0 responses
78 views
0 likes
|
Last Post
by Mindset
02-28-2026, 06:16 AM
|

Comment