Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Close all unmanaged orders and use take profit

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

    Close all unmanaged orders and use take profit

    Hi and congratulations for this very well maintained forum.

    I am working on opening hedged positions on the same timeframe and instrument and after searching a lot, I found out that the way to go is by using unmanaged orders , which by the way is a great add. I switched to NT7 only because of that

    # - Is anyone that knows how to simulate the set target profit with unmanaged orders ?
    If e.g. I want to place a buy order with take profit at a certain price (e.g 1.454) how can I do that ?



    #- Finally, concerning the IOrder object. What is the difference between:

    OrderActions:

    OrderAction.BuyToCover
    OrderAction.Sell
    OrderAction.SellShort


    Or alternatively where in the manuals does it explain them with details ?


    Thanks in advance
    Last edited by TakisTakis; 07-05-2010, 08:29 AM.

    #2
    TakisTakis, for your first question - you could simply submit a limit exit order at your price and qty then, which is what SetProfitTarget does.



    BuyToCover would be closing a open short, while Sell would be cloing ouf of a long position.

    Comment


      #3
      Thanks a lot Bertrand, you sure have one of the best forum support ever!

      So I submit a code for other people to use and please correct me If I am wrong.

      This is under the scenario where I want to submit a takeprofit order using unmanaged orders at a price e.g 1.234 = TakeProfit

      Instead of putting a simple managed order of buy i will put

      // Open a buy position at the market price
      entryOrder = SubmitOrder(0, OrderAction.Buy, OrderType.Market, 1, 0, 0, "", "Long Market");
      // place a take profit position that will only come into action only if the price goes above 1.234
      entryOrder = SubmitOrder(0, OrderAction.Sell, OrderType.Limit, 1, 1.234, 0, "", "Sell Limit");
      Correct ?

      2) And if I understood well:

      We open a long position buy and close it with sell
      We open a short position with shortsell and close it with buytocover

      Correct ?

      Thanks again you guys have a great forum!

      Comment


        #4
        You're welcome TakisTakis, thanks for the kind words - that sounds correct in both cases. You can easily test your codes with the Market Replay interface in NT7, we now provide the needed data to replay from our servers making this more convenient and easy to use -

        Comment


          #5
          Ok, here are two challenges that arise from this method:

          - Normally, each long position should be closed by the its counterparty sell position. The code I am using is the following:

          // buy - order
          entryOrder = SubmitOrder(0, OrderAction.Buy, OrderType.Market,
          orderQuantity, 0, 0, "", "Buy_"+ordernumber.ToString());



          // place the stop in form of limit

          entryOrderTP = SubmitOrder(0, OrderAction.Sell, OrderType.Limit,
          orderQuantity, TakeProfit, 0, "", "TP_Buy_"+ordernumber.ToString());
          And when checking the Trades (from the tab in historic backtesting) each Buy should have been closed by its counterparty e.g.

          Entry Name - Exit Name
          Buy_1 TP_Buy_1
          Buy_2 TP_Buy_2
          Buy_3 TP_Buy_3
          ...
          Buy_24 TP_Buy_24
          etc


          INSTEAD when the price jumps some other limit price gets triggered in its place and from that point on things get funny as they cross

          Buy_1 TP_Buy_1
          Buy_2 TP_Buy_2
          Buy_3 TP_Buy_3
          Buy_4 TP_Buy_6
          Buy_5 TP_Buy_4
          Buy_6 TP_Buy_5
          ...




          Why is that , and how can we correct this ? Anyone has ideas ? And how is different in this context a stop order from a limit order ? How can I place a stop order using the unmanaged orders ? Who killed JFK ? mmmm ?

          Thanks in advance!

          Comment


            #6
            TakisTakis, in the unmanaged approach there's no signal tracking done by NT, you just have the option to Submit, Change or Cancel an order. As there's no tracking, you can't time them together via the signal names you assign as you've become familiar with in the managed approach.

            Comment


              #7
              Thanks for the answer. I guess these are the rules, nothing to do to change them. Thanks for your time again.

              What about the second question ? What is the difference between a limit order and a stop order in NT7 unmanaged ?

              Comment


                #8
                You're welcome, just use Intellisense to guide you through the overload for SubmitOrder, you can just use OrderType.Stop with a valid stop price to submit a stop order -

                Comment


                  #9
                  What to check when playing with unmanaged orders

                  Ok, I found a small bug.

                  Remember earlier where I had a problem with how the orders were coupled ?

                  I made a function that was closing the orders automatically, meaning checking each order, where it should have been closed and then placing the a reverse order (Sell or BuyToCOver) where appropriate.

                  Then by examining the lines on the graph and the trades tab in the history backetsting windows, things still looked wierd. It seemed that the positions were not closing as they should.

                  However, after examining both the orders tab and the output window it became clear that the orders were all closed exactly where they should, however I understood that NT7 has some form of pairing algorithm trying to figure out which order acts as an exit to which entry order and with unmanaged orders it cannot work properly.

                  SUMMARY - too long didnt read

                  When using unmanaged orders, they only way to check things is by seeing the text printed (not the lines) on the graph, the blue and pink errors and above all the Orders tab.


                  Now, must find about JFK ...
                  Last edited by TakisTakis; 07-06-2010, 11:32 AM.

                  Comment


                    #10
                    TakisTakis, you're findings sound correct as there's just no signal tracking done by NT in this mode.

                    Comment

                    Latest Posts

                    Collapse

                    Topics Statistics Last Post
                    Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                    0 responses
                    648 views
                    0 likes
                    Last Post Geovanny Suaza  
                    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                    0 responses
                    369 views
                    1 like
                    Last Post Geovanny Suaza  
                    Started by Mindset, 02-09-2026, 11:44 AM
                    0 responses
                    108 views
                    0 likes
                    Last Post Mindset
                    by Mindset
                     
                    Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                    0 responses
                    572 views
                    1 like
                    Last Post Geovanny Suaza  
                    Started by RFrosty, 01-28-2026, 06:49 PM
                    0 responses
                    574 views
                    1 like
                    Last Post RFrosty
                    by RFrosty
                     
                    Working...
                    X