Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
CalculateMode.Percent stop loss gets cancelled
Collapse
X
-
CalculateMode.Percent stop loss gets cancelled
I'm using the simulator version of NT and when I try to use SetStopLoss(CalculateMode.Percent, 2) the stop gets cancelled. If I use one of the other modes the stop will trigger. Why is the percent mode always cancelling?Tags: None
-
Tried it and the stop orders still get cancelled.
I just added it to the MAcrossover template:
protectedoverridevoid Initialize()
{
SMA(Fast).Plots[0].Pen.Color = Color.Orange;
SMA(Slow).Plots[0].Pen.Color = Color.Green;
Add(SMA(Fast));
Add(SMA(Slow));
CalculateOnBarClose = true;
SetStopLoss(CalculationMode.Percent, 0.02);
}
///<summary>
/// Called on each bar update event (incoming tick).
///</summary>
protectedoverridevoid OnBarUpdate()
{
if (CrossAbove(SMA(Fast), SMA(Slow), 1))
{
EnterLong("CrossLong");
}
elseif (CrossBelow(SMA(Fast), SMA(Slow), 1))
{
EnterShort("CrossShort");
}
}
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
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
|
||
Started by smartromain, 03-13-2024, 01:42 AM
|
6 responses
98 views
0 likes
|
Last Post
by smartromain
Today, 08:30 AM
|
||
Started by Jonker, 04-27-2024, 01:19 PM
|
4 responses
29 views
0 likes
|
Last Post
by Jonker
Today, 08:26 AM
|
Comment