Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
SetProfitTarget
Collapse
X
-
SetProfitTarget
Hi, I want to have 3 different profit targets from one entry. So I execute a market order for 3 contracts and want o exit each contract with a separate target. Can you direct me to a resource or example on how to accomplish this? Thank youTags: None
-
Hello pman777,
Thank you for the post.
You must have a unique signal name for each contract. You can write something similar to the following to set individual targets for the same entry.
Please let me know if I can assist further.Code:EnterLong("Entry0"); EnterLong("Entry1"); EnterLong("Entry2"); SetProfitTarget("Entry0", CalculationMode.Ticks, 5); SetProfitTarget("Entry1", CalculationMode.Ticks, 10); SetProfitTarget("Entry2", CalculationMode.Ticks, 20);
-
to correlate with the above recommendation, i set up 3 "SetStopLoss" commands as follows:
SetStopLoss("Entry0",CalculationMode.Ticks, stopInTicks);
SetStopLoss("Entry1",CalculationMode.Ticks, stopInTicks);
SetStopLoss("Entry2",CalculationMode.Ticks, stopInTicks);
But I get this compiler msg: " overload for method 'SetStopLoss' takes 3 arguments" ... any thoughts? thanks
Comment
-
Hello pman777,
Thanks for the reply.
You must use this overload to specify a signal name for SetStopLoss:
SetStopLoss(string fromEntrySignal, CalculationMode mode, double value, bool isSimulatedStop)
Pass in "false" for isSimulatedStop if you do not want a simulated stop.
Please let me know if I can assist further.
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by CarlTrading, 03-31-2026, 09:41 PM
|
1 response
81 views
1 like
|
Last Post
|
||
|
Started by CarlTrading, 04-01-2026, 02:41 AM
|
0 responses
42 views
0 likes
|
Last Post
by CarlTrading
04-01-2026, 02:41 AM
|
||
|
Started by CaptainJack, 03-31-2026, 11:44 PM
|
0 responses
64 views
2 likes
|
Last Post
by CaptainJack
03-31-2026, 11:44 PM
|
||
|
Started by CarlTrading, 03-30-2026, 11:51 AM
|
0 responses
66 views
0 likes
|
Last Post
by CarlTrading
03-30-2026, 11:51 AM
|
||
|
Started by CarlTrading, 03-30-2026, 11:48 AM
|
0 responses
54 views
0 likes
|
Last Post
by CarlTrading
03-30-2026, 11:48 AM
|

Comment