Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Getting out with Market order

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

    Getting out with Market order

    Hi All,

    I want to be able to get out of a position -at whatever the costs. I therefore use OrderType.market as below. What then is the use of stopPrice and limitPrice?


    ************** CODE 1 **************
    stopUrgent = SubmitOrder(0, OrderAction.SellShort, OrderType.Market, J, limitPrice -1 * TickSize, stopPrice -1 * TickSize, "", "Get out!!");

    ************** END OF CODE 1 **************




    In addition i wish to enter the market but with with a limit so that I don't get any extreme fills. Should I be using OrderType.Stop or stopLimit? Please see code 2 below.

    ************** CODE 2 **************

    longOrder = SubmitOrder(0, OrderAction.Buy, OrderType.Stop, 1, tickPrice +1 * TickSize, tickPrice +1 * TickSize, String.Format("Gold" + qty), "Long " + J + " " + tickPrice);


    ************** END OF CODE 2 **************

    #2
    cocopod, for the market order just set the unneeded stop and limit price parameters to 0.

    The stop order would be a stop market order, so you cannot limit the fill range - that would be done via a StopLimit order, albeit here you risk not getting filled.

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by charlesugo_1, 05-26-2026, 05:03 PM
    0 responses
    52 views
    0 likes
    Last Post charlesugo_1  
    Started by DannyP96, 05-18-2026, 02:38 PM
    1 response
    142 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 05-11-2026, 05:56 AM
    0 responses
    160 views
    0 likes
    Last Post CarlTrading  
    Started by CarlTrading, 05-10-2026, 08:12 PM
    0 responses
    96 views
    0 likes
    Last Post CarlTrading  
    Started by Hwop38, 05-04-2026, 07:02 PM
    0 responses
    276 views
    0 likes
    Last Post Hwop38
    by Hwop38
     
    Working...
    X