Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Trouble with stop loss in strategy
Collapse
X
-
Hello Kudos,
Thank you for your post.
The syntax for this would be the following:Code:SetStopLoss(CalculationMode.Ticks, Low[0] - (2*TickSize));
For information on TickSize please visit the following link: http://www.ninjatrader.com/support/h...7/ticksize.htm
Please let me know if I may be of further assistance.
-
Patrick Thank you for your reply
Testing the code in a very basic program it compiled just fine but it changed the program.. The test was a long only entry but now it goes short and long. The only part of code changed was the stop loss.
SetProfitTarget("long", CalculationMode.Ticks, 6);
SetStopLoss("long", CalculationMode.Ticks, 2, false);
Is what the wizard compiled. I changed the script to
SetProfitTarget("long", CalculationMode.Ticks, 6);
SetStopLoss("long", CalculationMode.Ticks, Low[0]-(2*TickSize), false);
The basic test with the wizard was if
low[0]<low[1]
and
close[0]>close[1]
go long and then profit of 6 nd the the stop loss
Thanks
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by nicthe, 08-23-2023, 07:53 AM
|
7 responses
195 views
0 likes
|
Last Post
by nicthe
Today, 09:26 AM
|
||
Started by nicthe, Today, 09:24 AM
|
0 responses
4 views
0 likes
|
Last Post
by nicthe
Today, 09:24 AM
|
||
Started by stalt, 12-28-2015, 01:36 PM
|
6 responses
1,536 views
0 likes
|
Last Post
by giulyko00
Today, 09:16 AM
|
||
Started by Tburg1073, Today, 08:36 AM
|
0 responses
5 views
0 likes
|
Last Post
by Tburg1073
Today, 08:36 AM
|
||
Started by alexstox, 10-16-2018, 03:29 PM
|
10 responses
333 views
0 likes
|
Last Post
by Tburg1073
Today, 08:32 AM
|
Comment