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

Limit orders using GetCurrentAsk()/Bid()

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

    Limit orders using GetCurrentAsk()/Bid()

    I am getting order errors that state "cannot modify a filled order", is that because the limit order which uses GetCurrentAsk() will change the price as the getcurrentask() moves around and when partially filled the limit price cannot be moved / modified? If that is possibly the case would I need to create a static value out of the getCurrentAsk(1) or Closes[1][0] for example?
    Regards to all

    #2
    Hello elliot5,

    Thanks for your post.

    Testing with Trace Orders enabled can help to see where the original change order came from.

    If you ultimately confirm that your observations are correct, you could rewrite your entry conditions so that the order is only placed once. For example, using a bool variable called orderPlaced to control:

    if (conditions to enter && orderPlaced == false);
    {
    EnterLongLimit(...getCurrentAsk()...);
    orderPlaced = true; // set to true so only placed once.
    }

    Once the order has filled you can then reset the bool back to false for the next entry.
    Paul H.NinjaTrader Customer Service

    Comment


      #3
      Thank you Paul - but will a limit order that was placed using GetCurrentAsk() be still changing the limit price as the CurrentAsk moves around? Regards

      Comment


        #4
        Hello elliot5,

        Thanks for your reply.

        When the OnBarUpdate() is called and the order is submitted it would grab the Ask value in play at that time of that moment. If the OnBarUpdate() is called again and the order is executed again then it would again get the current ask which may be different. The logic example provided would prevent that situation.
        Paul H.NinjaTrader Customer Service

        Comment


          #5
          Ok thank you . Then my native order errors have a different source. I shall use TraceOrders to locate the issue. Thank you for you help. Much appreciated.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by cmtjoancolmenero, Yesterday, 03:58 PM
          12 responses
          42 views
          0 likes
          Last Post NinjaTrader_ChelseaB  
          Started by FrazMann, Today, 11:21 AM
          0 responses
          5 views
          0 likes
          Last Post FrazMann  
          Started by geddyisodin, Yesterday, 05:20 AM
          8 responses
          52 views
          0 likes
          Last Post NinjaTrader_Gaby  
          Started by DayTradingDEMON, Today, 09:28 AM
          4 responses
          27 views
          0 likes
          Last Post DayTradingDEMON  
          Started by George21, Today, 10:07 AM
          1 response
          22 views
          0 likes
          Last Post NinjaTrader_ChristopherJ  
          Working...
          X