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 CarlTrading, 03-31-2026, 09:41 PM
    1 response
    81 views
    1 like
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 04-01-2026, 02:41 AM
    0 responses
    42 views
    0 likes
    Last Post CarlTrading  
    Started by CaptainJack, 03-31-2026, 11:44 PM
    0 responses
    64 views
    2 likes
    Last Post CaptainJack  
    Started by CarlTrading, 03-30-2026, 11:51 AM
    0 responses
    68 views
    0 likes
    Last Post CarlTrading  
    Started by CarlTrading, 03-30-2026, 11:48 AM
    0 responses
    55 views
    0 likes
    Last Post CarlTrading  
    Working...
    X