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 FrancisMorro, Today, 03:24 AM
    0 responses
    1 view
    0 likes
    Last Post FrancisMorro  
    Started by Segwin, 05-07-2018, 02:15 PM
    10 responses
    1,769 views
    0 likes
    Last Post Leafcutter  
    Started by Rapine Heihei, 04-23-2024, 07:51 PM
    2 responses
    30 views
    0 likes
    Last Post Max238
    by Max238
     
    Started by Shansen, 08-30-2019, 10:18 PM
    24 responses
    943 views
    0 likes
    Last Post spwizard  
    Started by Max238, Today, 01:28 AM
    0 responses
    10 views
    0 likes
    Last Post Max238
    by Max238
     
    Working...
    X