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

best way to submit Buy Ask or Sell Bid

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

    best way to submit Buy Ask or Sell Bid

    (Indicator) I have some code that submits a Buy ask or Sell Bid,

    but it seems the ChartTrader buttons for the same are more efficient

    my code uses GetCurrentAsk or GetCurrentBid

    and then has to decide if this is ahead or behind the Price to know whether to place a StopLimit or Limit order. Sometimes the broker rejects the order because the StopLimit or Limit is not in the correct relation to the Current Price

    But the Ninja buttons don't seem to have this problem..the fills are better.

    so...questions:

    1) how to press the BuyAsk / SellBid buttons from script?

    2) how can I make my code perform as good as the buttons?

    thx


    #2
    I've submitted a few test BuyAsk / SellBid with the buttons and it appears these don't place StopLimit orders, only Limit orders...would that be correct?

    Do these buttons ever use StopLimit orders/

    Comment


      #3
      the Right Mouse Click on the price panel differentiates between StopLimit and Limit orders, in relation to the current price

      Comment


        #4
        Hello llanqui,

        The chart trader buttons just submit limit orders so that would be working differently than your script is currently. For stop limit orders you do need to make sure that the order is placed on the correct side of the market so that it does not get rejected. If you are seeing rejected orders you may want to add a small offset from the price such as 1 or 2 ticks. Depending on how fast the market is moving that may help to avoid the rejections.
        JesseNinjaTrader Customer Service

        Comment


          #5
          ok, thanks...and is there any sample code that shows how to click the charttrader buttons with script?

          Comment


            #6
            Hello llanqui,

            I don't know of any samples of that concept, it would not be suggested to try and programatically click the UI buttons when you can do those actions using the appropriate NinjaScript order methods. From an indicator the addon framework would be used to submit orders by using CreateOrder and Submit.



            If you wanted to submit a limit order like the chart trader you can change the OrderType to OrderType.Limit.
            JesseNinjaTrader Customer Service

            Comment


              #7
              yes, I did that and it works fine...thank you

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by anton_tymoshchuk, Yesterday, 01:14 AM
              5 responses
              30 views
              0 likes
              Last Post NinjaTrader_Gaby  
              Started by Angus7, Today, 04:43 AM
              0 responses
              3 views
              0 likes
              Last Post Angus7
              by Angus7
               
              Started by Thomas79, 01-23-2014, 10:14 AM
              10 responses
              1,506 views
              0 likes
              Last Post martin70  
              Started by istinethomas, Today, 03:31 AM
              0 responses
              7 views
              0 likes
              Last Post istinethomas  
              Started by joselube001, 05-10-2024, 12:17 PM
              7 responses
              50 views
              0 likes
              Last Post esatino
              by esatino
               
              Working...
              X