Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Exit + new signal double the size on same bar

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

    Exit + new signal double the size on same bar

    I have used this command to exit trades
    "Exit long-"
    Success = NTsellMarket("MyOrderId",NTMarketPosition(""));

    and

    "sell short"
    Success = NTsellMarket("MyOrderId",NTMarketPosition+1(""));

    When an exit and a short occur on the same bar the sell still trades 2 lots short even though the exit should have already closed the open long

    how do I avoid this please.
    Last edited by jsl12; 04-22-2008, 10:05 AM.

    #2
    You need to write some code to ensure that the you only sell short when your NTMarketPosition is flat....for example.
    RayNinjaTrader Customer Service

    Comment


      #3
      The logic of
      Success = NTsellMarket("MyOrderId",NTMarketPosition+1(""));
      means that if ntmarketposition=0 then only 1 lot would be sold

      both exit and entry seem to have been have activated on the basis of an existing long 1 position

      I placed the exit before the entry but the NTmarket position references the previous bars market position
      How can i get the short signal to recognise that the long exit this bar already flattened the position

      Does NT MarketPosition only recognise T-1

      Comment


        #4
        Don't assume that just because you made a call to sell that the position is flat. NTMarketPosition() returns the position as it is at that exact moment not relative to any bar but relative to your account.
        RayNinjaTrader Customer Service

        Comment


          #5
          Have you tried the REVERSE command?

          If your intention is to reverse your position from long to short, then the REVERSE is better suited to your needs.

          If your current position is short, REVERSE will close the short position and go long in the same bar.

          If your current position is long, REVERSE will close the long position and go short in the same bar.

          In fact, REVERSE is smart... If my current long position is 2 contracts and I REVERSE with 1 contract, it will close 2 contracts and go short 1 contract.

          Comment


            #6
            Great suggestion mgbloomfield, thanks for throwing it out there...Completey escaped my mind!
            RayNinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by algospoke, Today, 06:40 PM
            0 responses
            9 views
            0 likes
            Last Post algospoke  
            Started by maybeimnotrader, Today, 05:46 PM
            0 responses
            7 views
            0 likes
            Last Post maybeimnotrader  
            Started by quantismo, Today, 05:13 PM
            0 responses
            7 views
            0 likes
            Last Post quantismo  
            Started by AttiM, 02-14-2024, 05:20 PM
            8 responses
            168 views
            0 likes
            Last Post jeronymite  
            Started by cre8able, Today, 04:22 PM
            0 responses
            10 views
            0 likes
            Last Post cre8able  
            Working...
            X