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!
See more
See less

Partner 728x90

Collapse

Problem with SetStopLoss

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Problem with SetStopLoss

    Hi,

    I am trying to develop a system that uses two orders to stop to go out of the position:

    -The first order is based on the break of a channel.
    -The second order is a protection stop across SetStopLoss.

    When I combine these two orders inside an alone system there works correctly the order SetStopLoss and the first order stops working. To that it can be due?

    This problem can be seen with a code as simple as this:

    protectedoverridevoid Initialize()
    {
    SetStopLoss("", CalculationMode.Percent, 0.005, false);-------->This Order Works OK

    CalculateOnBarClose = true;
    }

    ///<summary>
    /// Called on each bar update event (incoming tick)
    ///</summary>
    protectedoverridevoid OnBarUpdate()
    {
    // Condition set 1
    if (Close[0] > Open[0])
    {
    EnterLong(DefaultQuantity, "");
    }

    ExitLongStop(MIN(Low, 14)[0], "", "");------>This Order do not Work
    }


    I am using the version 6.5.1000.8, nevertheless with other versions the same thing was not happening. How it might solve it?

    Regards and thank you very much in yours time

    #2
    MGDavid,

    You are likely running into the internal order handling rules. Please review them at the bottom of this link: http://www.ninjatrader-support.com/H...verview36.html

    The reason these are required and are in place is to prevent overfills.
    Josh P.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Belfortbucks, Today, 09:29 PM
    0 responses
    3 views
    0 likes
    Last Post Belfortbucks  
    Started by zstheorist, Today, 07:52 PM
    0 responses
    7 views
    0 likes
    Last Post zstheorist  
    Started by pmachiraju, 11-01-2023, 04:46 AM
    8 responses
    150 views
    0 likes
    Last Post rehmans
    by rehmans
     
    Started by mattbsea, Today, 05:44 PM
    0 responses
    6 views
    0 likes
    Last Post mattbsea  
    Started by RideMe, 04-07-2024, 04:54 PM
    6 responses
    33 views
    0 likes
    Last Post RideMe
    by RideMe
     
    Working...
    X