Announcement
Collapse
Looking for a User App or Add-On built by the NinjaTrader community?
Visit NinjaTrader EcoSystem and our free User App Share!
Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less
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.
Code:EnterLong("Entry0"); EnterLong("Entry1"); EnterLong("Entry2"); SetProfitTarget("Entry0", CalculationMode.Ticks, 5); SetProfitTarget("Entry1", CalculationMode.Ticks, 10); SetProfitTarget("Entry2", CalculationMode.Ticks, 20);
Chris L.NinjaTrader Customer Service
-
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.Chris L.NinjaTrader Customer Service
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by SightCareAubetter, Today, 12:55 PM
|
0 responses
3 views
0 likes
|
Last Post Today, 12:55 PM | ||
Started by traderqz, Today, 12:06 AM
|
8 responses
15 views
0 likes
|
Last Post
by traderqz
Today, 12:51 PM
|
||
Started by SightCareAubetter, Today, 12:50 PM
|
0 responses
1 view
0 likes
|
Last Post Today, 12:50 PM | ||
Started by Mongo, Today, 11:05 AM
|
4 responses
15 views
0 likes
|
Last Post
by Mongo
Today, 12:40 PM
|
||
Started by Skifree, Today, 03:41 AM
|
5 responses
14 views
0 likes
|
Last Post
by Skifree
Today, 12:36 PM
|
Comment