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.
        Paul H.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by r68cervera, Today, 05:29 AM
        0 responses
        2 views
        0 likes
        Last Post r68cervera  
        Started by geddyisodin, Today, 05:20 AM
        0 responses
        3 views
        0 likes
        Last Post geddyisodin  
        Started by JonesJoker, 04-22-2024, 12:23 PM
        6 responses
        34 views
        0 likes
        Last Post JonesJoker  
        Started by GussJ, 03-04-2020, 03:11 PM
        12 responses
        3,239 views
        0 likes
        Last Post Leafcutter  
        Started by AveryFlynn, Today, 04:57 AM
        0 responses
        6 views
        0 likes
        Last Post AveryFlynn  
        Working...
        X