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
Order with a StopLoss and ProfitTarget
Collapse
X
-
Hello YoutingChu,
Because the Strategy Builder will put SetStopLoss and SetProfitTarget inside State.Configure you would need to use one of the other Stop Order methods to optimize those values. Otherwise, you will need to unlock the strategy and put your SetStopLoss and SetProfitTarget methods elsewhere.
-
I would like it to be parameters where I can set up before I run the strategy.
Maybe I should say, I need it to be parameters so I could optimize it!
And I'm facing a weird problem too.
No matter how big I set my StopLoss, it ALWAYS exit my order at the same price I enter it!!!
On the other hand, it NEVER exit my order no matter how small I set my ProfitTarget!
It was like to whole parameter thing is useless!!!
PLEASE tell me what should I do!
Thank you very VERY much!!!Last edited by YoutingChu; 04-24-2018, 07:41 PM.
Leave a comment:
-
Hello YoutingChu,
Thanks for your post.
Is your goal to set the Stop Loss and Profit Target from the strategies parameters before you start the strategy, or is your goal for the Stop Loss and Profit target to be a dynamic value eg. always 5 ticks above/below the close ?
Will that condition stop me from optimizing the strategy!?Last edited by NinjaTrader_JoshG; 04-25-2018, 09:05 AM.
Leave a comment:
-
Hello
You must to the following :
1- In OnBarUpdate, check that this.Historical == false
2- When this.Historical == false then :
3- Use this.EnterLong() or this.EnterShort() functions with a custom signal name (ex : "MySignalName")
4- Use this.SetProfitTarget() and this.SetStopLoss() with the previously defined signal name
I hope that this helps !
Leave a comment:
-
Order with a StopLoss and ProfitTarget
Greetings,
I'm new to NT8, could anybody teach me how to make a simple strategy placing a market order with a StopLoss at the certain price below the buying price and a ProfitTarget at the certain price above the buying price, PLEASE!?
I'm currently using one made by Strategy Builder and it put
SetProfitTarget(@"", CalculationMode.Currency, PT);
SetStopLoss("", CalculationMode.Currency, SL);
within the State == State.Configure if clause.
Will that do the trick I wish for or it's something totally different!?
Thank you very VERY much!!!Last edited by YoutingChu; 04-24-2018, 02:11 AM.
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by Vietanhnguyen2hotmailcom, Yesterday, 10:29 AM
|
4 responses
23 views
0 likes
|
Last Post Today, 09:06 PM | ||
Started by PhillT, 04-19-2024, 02:16 PM
|
4 responses
35 views
0 likes
|
Last Post
by PhillT
Today, 04:24 PM
|
||
Started by ageeholdings, 05-01-2024, 05:22 AM
|
5 responses
37 views
0 likes
|
Last Post
by ageeholdings
Today, 03:21 PM
|
||
Started by reynoldsn, Today, 02:34 PM
|
0 responses
13 views
0 likes
|
Last Post
by reynoldsn
Today, 02:34 PM
|
||
Started by nightstalker, Today, 02:05 PM
|
0 responses
22 views
0 likes
|
Last Post
by nightstalker
Today, 02:05 PM
|
Leave a comment: