Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
SetStopLoss doesn't work with "fromEntrySignal"
Collapse
X
-
SetStopLoss doesn't work with "fromEntrySignal"
Hello, if I use SetStopLoss only with two parameters (CalculationMode mode, double value) it woks correctly. But if I use SetStopLoss with four parameters (fromEntrySignal, CalculationMode mode, double value, bool isSimulatedStop) the stop order is fixed in a incorrect level. I have made a lot of tests checking this issue. How can I solve it? Thanks in advance.Tags: None
-
Hello Paul,
Thank you for your help. This mi code:
a) SetStopLoss(EtiquetaEntradaCorta, CalculationMode.Ticks, Ticks_StopMax, false);
b) SetStopLoss(CalculationMode.Ticks, Ticks_StopMax);
The variable "EtiquetaEntradaCorta" is a string with the name of the strategy and the currentbar.
The variable "Ticks_StopMax" is a double.
Comment
-
Hello Paul,
The issue continues. I attach a sample. When I use "SetStopLoss" without fromEntrySignal name, it works ok. But when I use the parameter "fromEntrySignal name" it doesn' work.
Thanks in advance for your help.
Attached Files
Comment
-
Hello soyjesus,
Thanks for your reply.
In your example, you are already assigning a setstoploss order in the same block where you are placing the enter long order. Later you are trying to add another setstoploss with the order name but this will not work because the first setstoploss is in place and only one stoploss per order is possible.
Here is an example of how you use signal names:
if (EntryConditions are true)
{
SetStopLoss ("MySignalName", CalculationMode.Ticks, 20, false); // always set the stop/profit values first to ensure they are ready
SetProfitTarget("MySignalName", CalculationMode.Ticks, 20);
EnterLong("MySignalName");
}
if (conditions to adjust the stoploss)
{
SetStopLoss("MySignalName", CalculationMode.Price, Low[0] - 5 * TickSize, false);
}
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by Mindset, 04-21-2026, 06:46 AM
|
0 responses
89 views
0 likes
|
Last Post
by Mindset
04-21-2026, 06:46 AM
|
||
|
Started by M4ndoo, 04-20-2026, 05:21 PM
|
0 responses
135 views
0 likes
|
Last Post
by M4ndoo
04-20-2026, 05:21 PM
|
||
|
Started by M4ndoo, 04-19-2026, 05:54 PM
|
0 responses
68 views
0 likes
|
Last Post
by M4ndoo
04-19-2026, 05:54 PM
|
||
|
Started by cmoran13, 04-16-2026, 01:02 PM
|
0 responses
119 views
0 likes
|
Last Post
by cmoran13
04-16-2026, 01:02 PM
|
||
|
Started by PaulMohn, 04-10-2026, 11:11 AM
|
0 responses
69 views
0 likes
|
Last Post
by PaulMohn
04-10-2026, 11:11 AM
|

Comment