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 halgo_boulder, 04-20-2024, 08:44 AM
          2 responses
          21 views
          0 likes
          Last Post halgo_boulder  
          Started by mishhh, 05-25-2010, 08:54 AM
          19 responses
          6,189 views
          0 likes
          Last Post rene69851  
          Started by gwenael, Today, 09:29 AM
          0 responses
          5 views
          0 likes
          Last Post gwenael
          by gwenael
           
          Started by Karado58, 11-26-2012, 02:57 PM
          8 responses
          14,830 views
          0 likes
          Last Post Option Whisperer  
          Started by Option Whisperer, Today, 09:05 AM
          0 responses
          2 views
          0 likes
          Last Post Option Whisperer  
          Working...
          X