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 Tim-c, Today, 08:36 AM
|
1 response
2 views
0 likes
|
Last Post Today, 08:45 AM | ||
Started by goodknight777, Today, 08:43 AM
|
0 responses
1 view
0 likes
|
Last Post Today, 08:43 AM | ||
Started by martini, Yesterday, 04:45 PM
|
3 responses
27 views
0 likes
|
Last Post Today, 08:38 AM | ||
Started by Mestor, Today, 03:15 AM
|
2 responses
10 views
0 likes
|
Last Post
by Mestor
Today, 08:36 AM
|
||
Started by roblogic, 11-30-2023, 06:20 PM
|
57 responses
1,364 views
0 likes
|
Last Post
by playr101
Today, 08:35 AM
|
Comment