Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

Order Type

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

    Order Type

    I'm not clear on how to set the order types for unmanaged orders.

    1. If I want to buy at the market I'll submit an order with the orderaction.buy and ordertype.market. What do I need for simple stop and limit orders for fixed prices?

    2. If I want to sell at the market I'll submit an order with the orderaction.see and ordertype.market. What do I need for simple stop and limit orders for fixed prices?

    Thanks!!

    #2
    Hello
    Thanks for your post.

    For a limit or stopLimit you will specify the OrderType as OrderType.Limit or OrderType.StopLimit

    You would then need to add the limit price or the limit price and the stop price depending on the order type of limit or stoplimit. The helpguide shows the variation to include the limit price and stop limit price.

    Please see the helpguide here on SubmitOrderUnmanaged(): http://ninjatrader.com/support/helpG...runmanaged.htm

    Limit example:

    SubmitOrderUnmanaged(0, OrderAction.Buy, OrderType.Limit, 1, 2475.25, 0, "", "Enter Long"); In this example it is a buy limit with a price of 2475.25. A quantity of 1. As this is not a stop limit a 0 (zero) is entered for the stop price. As there is no OCO associated the OCO string is empty "". The signal name is "EnterLong". This example matches the last signature shown for the method in the helpguide. SubmitOrderUnmanaged(int selectedBarsInProgress, OrderAction orderAction, OrderType orderType, int quantity, double limitPrice, double stopPrice, string oco, string signalName)
    Paul H.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by MarianApalaghiei, Today, 10:49 PM
    1 response
    7 views
    0 likes
    Last Post NinjaTrader_Manfred  
    Started by love2code2trade, Yesterday, 01:45 PM
    4 responses
    28 views
    0 likes
    Last Post love2code2trade  
    Started by funk10101, Today, 09:43 PM
    0 responses
    8 views
    0 likes
    Last Post funk10101  
    Started by pkefal, 04-11-2024, 07:39 AM
    11 responses
    37 views
    0 likes
    Last Post jeronymite  
    Started by bill2023, Yesterday, 08:51 AM
    8 responses
    46 views
    0 likes
    Last Post bill2023  
    Working...
    X