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

order dont get submitted

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

    order dont get submitted

    protected override void OnBarUpdate()
    {

    IOrder orderBuy=null;
    IOrder orderSell= null;

    orderBuy = EnterLongStopLimit(Qty, 1, 1, "buy s1");
    orderSell = EnterShortStopLimit(Qty, 1, 1, "sell s1");

    }

    the orderSell will not be submitted.
    Last edited by mike4398; 03-05-2008, 05:54 AM.

    #2
    That is correct. You can not have 2 entry order at both sides of the market at the same time.

    Comment


      #3
      it doesn't give me any error messages, I have tried to use the limit orders instead and get incorrect results also.

      How do I realize this:

      if the price goes up (to price1) I want long position triggered,
      if down (to price2) then enter a short position.

      the best way to achieve this is to place two orders in opposite directions since we dont know where the price is going to (the next bar)

      this is a standard situation and supported by most of the software and you say I cannot do that in NT? (!)

      If you go to Elitetrader, software section, all the software that I know does that. I feel the customers should be aware about this limitation.
      I looked up the help file and it doesn't say anything about this.

      When it should generate the error I guess instead of the weird results like execution outside high-low range I get yesterday.
      Last edited by mike4398; 03-05-2008, 05:50 AM.

      Comment


        #4
        FYI, this is a second limitation of NT which I encountered while doing a simple test strategy, the first was that you cannot have multiple orders at the SAME direction and targetprofits working correctly!!!

        Do the multiple orders at the same direction "throw off internal logic of a strategy" as well?

        So for example if you have SetprofitTarget 100 ticks and more than one order at the same direction the results will be incorrect.

        It doesnt give you error messages as well and it takes lots of time to figure out what the NT gives you completely wrong results.

        I think the order handling engine needs some serious development.

        Comment


          #5
          You will see how NT internal order logic works as you turn TraceOrders on: http://www.ninjatrader-support.com/H...aceOrders.html

          You always should should test your strategy to understand how the logic works. TraceOrders help you understanding the order details.

          Comment


            #6
            Originally posted by NinjaTrader_Dierk View Post
            You will see how NT internal order logic works as you turn TraceOrders on: http://www.ninjatrader-support.com/HelpGuideV6/TraceOrders.html

            You always should should test your strategy to understand how the logic works. TraceOrders help you understanding the order details.
            Thats that I 've been doing, however you can spot only some discrepancies like negative profit with ProfitTarget exit.

            If the NT does not allow to have opposite orders, why would it take them without errors? The same for profit targets, any profit target exit with negative profit should generate at least some alert.

            It would be nice to have the alert (or assertion) when the code works not as expected because of "it's internal logic".

            If the program in computer have error it terminates, the strategy should do the same, just my opinion.

            I would prefer the strategy terminate itself other than running with errors.
            Last edited by mike4398; 03-05-2008, 09:20 AM.

            Comment


              #7
              Thanks for your suggestion. We'll add it to the list of future considerations.

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by cls71, Today, 04:45 AM
              0 responses
              1 view
              0 likes
              Last Post cls71
              by cls71
               
              Started by mjairg, 07-20-2023, 11:57 PM
              3 responses
              213 views
              1 like
              Last Post PaulMohn  
              Started by TheWhiteDragon, 01-21-2019, 12:44 PM
              4 responses
              544 views
              0 likes
              Last Post PaulMohn  
              Started by GLFX005, Today, 03:23 AM
              0 responses
              3 views
              0 likes
              Last Post GLFX005
              by GLFX005
               
              Started by XXtrader, Yesterday, 11:30 PM
              2 responses
              12 views
              0 likes
              Last Post XXtrader  
              Working...
              X