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 r68cervera, Today, 05:29 AM
|
0 responses
3 views
0 likes
|
Last Post
by r68cervera
Today, 05:29 AM
|
||
Started by geddyisodin, Today, 05:20 AM
|
0 responses
6 views
0 likes
|
Last Post
by geddyisodin
Today, 05:20 AM
|
||
Started by JonesJoker, 04-22-2024, 12:23 PM
|
6 responses
35 views
0 likes
|
Last Post
by JonesJoker
Today, 05:14 AM
|
||
Started by GussJ, 03-04-2020, 03:11 PM
|
12 responses
3,241 views
0 likes
|
Last Post
by Leafcutter
Today, 05:08 AM
|
||
Hi
by AveryFlynn
Started by AveryFlynn, Today, 04:57 AM
|
0 responses
7 views
0 likes
|
Last Post
by AveryFlynn
Today, 04:57 AM
|
Comment