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

    Hi,

    I am new so I need help :

    How can I change the order type to :
    1. Last price.
    2. For Long, Join Bid intead of Market order
    3. For Sell, Join Offer instead of Market order

    OrderType.Market for Market order

    Thanks in advance

    #2
    Hello futpro,

    There are two different order systems. Please review the following links on the managed and unmanaged systems.

    Managed Orders
    Unmanaged Orders

    If you're just getting started with NinjaScript, take a look at the managed orders section for some examples on formatting. Another good way to learn the syntax is using the strategy wizard condition builder. You can select parameters for orders in a point and click interface, and then view the resulting code.

    Let us know if you have any additional questions.
    Ryan M.NinjaTrader Customer Service

    Comment


      #3
      Hi,

      I just want to change the Ordertype to join bid/offer or last traded price. Here is part of the code :

      AtmStrategyCreate(Action.SellShort, OrderType.Market,
      0, 0, TimeInForce.Day, atmOrderIdShort, ATMStrategy, atmIdShort);

      Thanks

      Comment


        #4
        You would need to decide at which price to submit the order, for the current bid you can use GetCurrentBid() and for the last price Close[0] on CalculateOnBarClose = false.

        BertrandNinjaTrader Customer Service

        Comment


          #5
          Thanks Bertrand for the tip.

          Any easy way of copying the Strategy and then making slight changes to make new ones instead of cutting and pasting existing Strategy.

          Comment


            #6
            Please right click in the code and select 'Save as' to save under a new name for creating a 'modded' version.
            BertrandNinjaTrader Customer Service

            Comment


              #7
              Thanks Bertrand. Have a wonderful day.

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by junkone, 04-28-2024, 02:19 PM
              8 responses
              92 views
              1 like
              Last Post brucerobinson  
              Started by mkouitra, 10-23-2021, 04:40 PM
              17 responses
              1,962 views
              0 likes
              Last Post NinjaTrader_Jason  
              Started by Vietanhnguyen2hotmailcom, 05-03-2024, 10:29 AM
              4 responses
              29 views
              0 likes
              Last Post Vietanhnguyen2hotmailcom  
              Started by PhillT, 04-19-2024, 02:16 PM
              4 responses
              37 views
              0 likes
              Last Post PhillT
              by PhillT
               
              Started by ageeholdings, 05-01-2024, 05:22 AM
              5 responses
              39 views
              0 likes
              Last Post ageeholdings  
              Working...
              X