Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Limit order

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

    Limit order

    Hello, I want to enter a limit order

    //EnterShortLimit(DefaultQuantity, Open[0]*1.001, ""); this doesnt work

    Basically what I'm trying to do is enter a limit order within certain limits of the opening price to get the best fill.

    EX: opening price + 0% to 1%

    Any idea how?

    #2
    calhawk01, what do you mean by 'it doesn't work'?

    Do you want to place an order for the bars open or the day's open here? So meaning when do you submit it?

    Comment


      #3
      Yes I want to enter a ''range'' limit order at the day's opening price + zero to .1%

      ex: opening price = 10
      limit order should be
      10 to 10*1.001

      Comment


        #4
        You are then referring to a StopLimit order?



        A true limit order would just be price x or better...

        Comment


          #5
          No I wasn't referring to a stoplimit, I wanted a limit order within a certain range. I guess that's not possible

          Just want to verify:

          If I have 1 min data series.

          My signal occurs at 9:30, and COBC is true, will Open[0] limit order send a order for the opening price of the 9:31 bar?

          Thank you for help

          Comment


            #6
            For a limit order you don't specify a range, but state which price at worst you would pay. It can immediately marketable as well giving your instant execution, meaning you send it at a higher price for example for a long than the current price. Then the current price is the better price since it's lower and thus you would see a fill.

            No Open[0] would refer to the current bar's open only - if you have your signal and work in FirstTickOfBar of the following then this would be giving you the evening of the opening tick. You can then try placing a limit order at or below the current bar's Open price to get in.

            Comment


              #7
              Originally posted by NinjaTrader_Bertrand View Post
              For a limit order you don't specify a range, but state which price at worst you would pay. It can immediately marketable as well giving your instant execution, meaning you send it at a higher price for example for a long than the current price. Then the current price is the better price since it's lower and thus you would see a fill.

              No Open[0] would refer to the current bar's open only - if you have your signal and work in FirstTickOfBar of the following then this would be giving you the evening of the opening tick. You can then try placing a limit order at or below the current bar's Open price to get in.
              I'm using strategy wizard to create this strat

              So if I want to enter at the opening price of the bar at 9:31 (the bar AFTER my signal was generated (at 9:30) since I have COBC=true) what can I do? Open[1]??

              Another question-

              If I have a crossover strategy where I go long and short for crossover above/below, and lets say that I sent a limit order to go long, but my limit order is never executed and is still pending, however, not there is a crossover to go short, will my system, cancel my previous limit order to go long and send another limit order to go short?

              Thx
              Last edited by staycool3_a; 05-15-2013, 09:38 AM.

              Comment


                #8
                Originally posted by calhawk01 View Post
                ... So if I want to enter at the opening price of the bar at 9:31 (the bar AFTER my signal was generated (at 9:30) since I have COBC=true) what can I do? Open[1]??
                You use Close[0]. because if COBC=true, then the open of the current bar is the same event as the close of the previous bar. However, because COBC is true, the only event is the close at the end of the bar, so the open of the 9:31 bar is the same as the close of the 9:30 bar, which is the bar that just closed. i.e., Close[0].

                Another question-

                If I have a crossover strategy where I go long and short for crossover above/below, and lets say that I sent a limit order to go long, but my limit order is never executed and is still pending, however, not there is a crossover to go short, will my system, cancel my previous limit order to go long and send another limit order to go short?

                Thx
                If you are using crossovers, this scenario is not possible. There will never be an open order when the reversal signal arrives, because orders are closed on the close of the bar if they are not filled. On the other hand, if you are using liveUntilCancelled, that is a different kettle of fish, and will be subject to the entry handling restrictions for managed positions, as detailed in the NT Help.

                Comment


                  #9
                  One more question: (i know I'm an idiot)

                  how can I achieve:

                  Let's say I enter at 10.00, I want to send a LIMIT order if the price goes below 10.

                  EX: 9:30 price is 10 and I am long
                  9:31 price is 9.99, at this moment I want to send a limit order at 9.99

                  In order to do the above, I used a limit order for Close[0] which will give me 9.99 since my COBC for this example is false. But what If my limit order does not get filled? How can I enter a hard stoploss.. at let's say .4%? I did enter a hard stop using the last option in strategy wizard, but that stoploss is sent with the order, and as a result, my limit order at 9.99 is never sent. Any work around this? Thank you

                  Comment


                    #10
                    Originally posted by calhawk01 View Post
                    One more question: (i know I'm an idiot)

                    how can I achieve:

                    Let's say I enter at 10.00, I want to send a LIMIT order if the price goes below 10.

                    EX: 9:30 price is 10 and I am long
                    9:31 price is 9.99, at this moment I want to send a limit order at 9.99

                    In order to do the above, I used a limit order for Close[0] which will give me 9.99 since my COBC for this example is false. But what If my limit order does not get filled? How can I enter a hard stoploss.. at let's say .4%? I did enter a hard stop using the last option in strategy wizard, but that stoploss is sent with the order, and as a result, my limit order at 9.99 is never sent. Any work around this? Thank you
                    If the order is not filled, there is no position, so no StopLoss will be placed for a position that does not exist.

                    Comment


                      #11
                      Originally posted by koganam View Post
                      You use Close[0]. because if COBC=true, then the open of the current bar is the same event as the close of the previous bar. However, because COBC is true, the only event is the close at the end of the bar, so the open of the 9:31 bar is the same as the close of the 9:30 bar, which is the bar that just closed. i.e., Close[0].


                      If you are using crossovers, this scenario is not possible. There will never be an open order when the reversal signal arrives, because orders are closed on the close of the bar if they are not filled. On the other hand, if you are using liveUntilCancelled, that is a different kettle of fish, and will be subject to the entry handling restrictions for managed positions, as detailed in the NT Help.
                      Thank you Koganam, The open of the current bar doesn't always = the close of the previous bar. Prices move. Am I missing something?

                      As far as the crossover is concerned, the major problem I am seeing is that sometimes the reversal never does arrive. I don't have any hard stoplosses implemented in this system. Reversal it's self is a hard stop. So i'm not sure why there are times when I am long, and now the price has reversed and is going the other way around, my system never reverses the position.

                      Comment


                        #12
                        Originally posted by calhawk01 View Post
                        Thank you Koganam, The open of the current bar doesn't always = the close of the previous bar. Prices move. Am I missing something?
                        You are not missing anything, and I did not say that the prices were equal: the events are equal, and as long as you are using COBC, there is naught else to be done. On an intraday chart, are you really going to sweat the occasional one-tick gap that might occur? If you insist on using the open of the bar, then you must use COBC=false, and probably also should use FirstTickOfBar.
                        As far as the crossover is concerned, the major problem I am seeing is that sometimes the reversal never does arrive. I don't have any hard stoplosses implemented in this system. Reversal it's self is a hard stop. So i'm not sure why there are times when I am long, and now the price has reversed and is going the other way around, my system never reverses the position.
                        If you are entering with limit orders, the aforesaid occasional gap will mean that the reversal price will not be hit, so no reversal will occur. This will be true regardless the COBC setting.

                        Comment


                          #13
                          Originally posted by koganam View Post
                          You are not missing anything, and I did not say that the prices were equal: the events are equal, and as long as you are using COBC, there is naught else to be done. On an intraday chart, are you really going to sweat the occasional one-tick gap that might occur? If you insist on using the open of the bar, then you must use COBC=false, and probably also should use FirstTickOfBar.

                          If you are entering with limit orders, the aforesaid occasional gap will mean that the reversal price will not be hit, so no reversal will occur. This will be true regardless the COBC setting.
                          Have to sweat all the ticks

                          Crossover problem, fine, that's fine. If the limit order for reversal never occurs b/c of the occasional gap, how can I direct my system to at least exit my long position? I have tried entering sets such as, if the price < long crossover price, then exit. But this condition seems to be overridden by the hard stoploss I have for 1% loss.

                          ideally i want to reverse my position when opposite crossover occurs at a limit order, if limit is not hit, then i want to exit if my current positions last price is above/below crossover threshold, if that never occurs (which should be never) i have a hard stoploss.

                          dumb question time: how to exit at if price goes above/below entry price?

                          Comment


                            #14
                            any idea how i can have a trailing limit order at close[0] instead of sending a market order? it seems the market order creates sometimes huge spreads (which will only increase in real time trading b/c of trading bots at exchanges) and perhaps a hard stoploss as well

                            Comment


                              #15
                              Originally posted by calhawk01 View Post
                              any idea how i can have a trailing limit order at close[0] instead of sending a market order? it seems the market order creates sometimes huge spreads (which will only increase in real time trading b/c of trading bots at exchanges) and perhaps a hard stoploss as well

                              Disregard the top.

                              BUT I have another question I have looked EVERYWHERE but no answer:

                              Do you want to explain what CalculationMode is?

                              CalculationMode.Ticks= 1 would mean that stoploss is $1 away from entry price?
                              CalculationMode.Price= ?? would this be a variable? Low[0] ?? I tried using low[0] but the strategy does not compile
                              CalculationMode.Percent= 0.02 would mean that stoploss is 1% away from entry price.

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                              0 responses
                              670 views
                              0 likes
                              Last Post Geovanny Suaza  
                              Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                              0 responses
                              379 views
                              1 like
                              Last Post Geovanny Suaza  
                              Started by Mindset, 02-09-2026, 11:44 AM
                              0 responses
                              111 views
                              0 likes
                              Last Post Mindset
                              by Mindset
                               
                              Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                              0 responses
                              575 views
                              1 like
                              Last Post Geovanny Suaza  
                              Started by RFrosty, 01-28-2026, 06:49 PM
                              0 responses
                              582 views
                              1 like
                              Last Post RFrosty
                              by RFrosty
                               
                              Working...
                              X