Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Sell only filled quantity

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

    Sell only filled quantity

    8 out of 10 times ninjatrader is selling random amounts. Is there a script that says "sell only filled quantity"? instead of selling whatever it feels like selling?

    #2
    Hello faisamtrader,

    I would not expect NinjaTrader to submit an order with a random quantity. The quantity you type into the Quantity field should be the quantity submitted with the order.

    Fills will be determined by the market activity. (Meaning sometimes an order will part fill until fully filled)

    Are you placing manual orders and the filled quantity is not matching the submission quantity in the Quantity field of the trade window?

    Are you wanting a NinjaScript addon that detects manually placed orders and will submit an order based on the fill quantity of a manually placed order?
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Hey Chelsea,

      Thanks for your response.

      I am using an automated script approach.

      If the code says to buy 5000 shares, and I only get filled for 4500. It will hit pt and sell 4500 shares, the remaining 500 shares will remain and becomes short when the price gets to my stoploss.

      Then it will buy another 5000 share it my conditions meet, if I get filled for 2500 shares, this time it will hold the shorts(as there is no PT for the short positions) and I will be left with a crazy and weird number of shares.

      Just need 2 things....first to disable the option to go short.....and second the PT and SL to be only for whatever is FILLED rather than whatever amount the buy order was for.

      I want it to sell the quantity that was bought only!!!

      Comment


        #4
        Hi faisamtrader, thanks for your reply.

        Does this happen when fewer contracts are used? Like 100? Please provide a reduced example that causes the issue and I can test it out on my PC. I've never seen a strategy attempt to place one amount of orders and fill only a portion of them. There's two ways of setting up a stop loss and profit target, either set the order yourself in OnExecutionUpdate like this example shows or use the SetStopLoss/ProfitTarget methods. The set methods require no intervention, as long as the signal name for your orders match the "fromSignalName" parameter the stop loss/profit target will be applied for each order that has been filled.
        Chris L.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by algospoke, Yesterday, 06:40 PM
        2 responses
        18 views
        0 likes
        Last Post algospoke  
        Started by ghoul, Today, 06:02 PM
        3 responses
        14 views
        0 likes
        Last Post NinjaTrader_Manfred  
        Started by jeronymite, 04-12-2024, 04:26 PM
        3 responses
        44 views
        0 likes
        Last Post jeronymite  
        Started by Barry Milan, Yesterday, 10:35 PM
        7 responses
        20 views
        0 likes
        Last Post NinjaTrader_Manfred  
        Started by AttiM, 02-14-2024, 05:20 PM
        10 responses
        180 views
        0 likes
        Last Post jeronymite  
        Working...
        X