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

Join Bid or Ask

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

    Join Bid or Ask

    Is it possible to program to join bid or ask or be best bid/ask

    #2
    Hello,

    Thank you for the question.

    I am unsure by the question what you are asking to program, could you provide more details on what you are trying to do?

    I look forward to being of further assistance.
    JesseNinjaTrader Customer Service

    Comment


      #3
      what i mean is can you program if a condition is true to submit an order at the current bid or ask.

      and also keep keep your order as the best bid or ask until filled

      Comment


        #4
        Hello,

        Thank you for the clairification.

        Yes you can utilize the Bid or Ask prices in script. The easiest way is to use the GetCurrentBid and GetCurrentAsk methods:



        You can use these values in whatever equations you need to determine where the order is placed, depending on the order type you could also change the existing order to a new price or to Follow the price until filled.

        To move a order, you would just need to call the Enter method for the entry order again using a new price, as long as the order is open when you call the Enter method it would modify the existing order.

        I look forward to being for further assistance.
        JesseNinjaTrader Customer Service

        Comment


          #5
          Hi Jesse

          How do you avoid submitting multiple entry orders instead of modify existing?

          Do you have an example of Follow the price until filled?

          Comment


            #6
            Hello fiddy,

            Thanks for your reply.

            You can use position information to prevent entries, for example:

            if (Position.MarketPosition == MarketPosition.Flat && your entry conditions)
            {
            // enter order here when flat and my conditions are true.
            }

            In the above "your entry conditions" would be your logic to determine the price to submit at. If the next time the code executes and the order has not filled then MarketPosition will remain flat and you would submit the new price/order using the same signal name, effectively following.
            Paul H.NinjaTrader Customer Service

            Comment


              #7
              what would happen in the example provided if the entry conditions are true and an order is submitted but not yet filled and the conditions are true again.... will a new order be submitted or will the old order be modified.
              it is not clear to me how to go about modifying an existing order as opposed to submit a new order
              Can you please provide some more detail

              Comment


                #8
                Hello fiddy,

                Thanks for your reply.

                I've created a short video with live data showing a simple strategy to address the questions you asked. I've even left out the market position check because the "EntriesPerDirection" is set to 1. http://screencast.com/t/w3zSjMIsqnt

                If you have further questions I would encourage you to use your sim101 account and test out the questions similarly.
                Paul H.NinjaTrader Customer Service

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by lorem, Today, 09:18 AM
                0 responses
                2 views
                0 likes
                Last Post lorem
                by lorem
                 
                Started by hazylizard, Today, 08:38 AM
                4 responses
                10 views
                0 likes
                Last Post hazylizard  
                Started by geddyisodin, Today, 05:20 AM
                2 responses
                18 views
                0 likes
                Last Post geddyisodin  
                Started by Max238, Today, 01:28 AM
                5 responses
                47 views
                0 likes
                Last Post Max238
                by Max238
                 
                Started by giulyko00, Yesterday, 12:03 PM
                3 responses
                13 views
                0 likes
                Last Post NinjaTrader_BrandonH  
                Working...
                X