Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Limit order short and long at once

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

    Limit order short and long at once

    Hi,
    There is some problem in pending limit order to long and short in one strategy.
    it is impossible insert short limit order and long limit order at once time.
    I used this arguments:

    if (GetCurrentBid() > EMA(50)[0]) EnterLongLimit(0,true,1,EMA(50)[0], "B1-EMA50");
    if (GetCurrentBid() > EMA(200)[0]) EnterShortLimit(0,true,1,EMA(200)[0], "S1-EMA200");

    Although both conditions are true, strategy insert only first order.
    Is any solution?

    Btw. How can I cancel limit order by command? I tried CancelOrder( "B1-EMA50"), but unsuccessfully.
    Thank

    #2
    Hello Pavoda,

    Thank you for your note.

    You cannot place a Long and Short order at the same time with the Managed Approach. This can only be done with the Unmanaged approach.
    See the Internal order handling rules from the link below -
    http://www.ninjatrader.com/support/h...d_approach.htm

    Additionally, you need to use IOrder Objects when wanting to use CancelOrder();
    http://www.ninjatrader.com/support/h...tml?iorder.htm

    Let me know if I can be of further assistance.
    Cal H.NinjaTrader Customer Service

    Comment


      #3
      Thanks you for quick response, my problems was resolved, but
      when I use Unmanaged approach and insert limit order so strategy inserting more and more orders of same command. Is it possible define how many orders will be inserted? hope that I can managed it by conditions in script, but it is not too confortable.
      It looks that command EntriesPerDirection and EntryHandling isn´t available for Unmanaged approach.
      Is any tip to resolve this?

      Thanks

      Comment


        #4
        Hello pavoda,

        Thanks for your reply.

        Correct, in the unmanaged approach EntriesPerDirection and EntryHandling are not available to assist so you must control all the conditions.

        If the issue is that your strategy is submitting multiple orders in the same entry condition you may want to use a bool to control the order condition. For example:

        if ( yourentryconditions && !orderPlaced)
        {
        // place entry order here
        orderPlaced = true; // Set bool so only happens once until reset
        }


        After exiting the order your code would then need to reset the bool.

        Please let us know if we can be of further assistance.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by argusthome, 03-08-2026, 10:06 AM
        0 responses
        64 views
        0 likes
        Last Post argusthome  
        Started by NabilKhattabi, 03-06-2026, 11:18 AM
        0 responses
        41 views
        0 likes
        Last Post NabilKhattabi  
        Started by Deep42, 03-06-2026, 12:28 AM
        0 responses
        22 views
        0 likes
        Last Post Deep42
        by Deep42
         
        Started by TheRealMorford, 03-05-2026, 06:15 PM
        0 responses
        25 views
        0 likes
        Last Post TheRealMorford  
        Started by Mindset, 02-28-2026, 06:16 AM
        0 responses
        51 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Working...
        X