Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Unable to change order using NTChange fucntion

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

    Unable to change order using NTChange fucntion

    I don't seem to be able to change the stop price with this code:
    Code:
    var:
    intrabarpersist string NTOID("");
    
    if getappinfo(airealtimecalc) = 1 then begin
    print("NTOID = ",NTOID);
    if NTOID <> "" and NTOrderStatus(NTOID) = "Accepted" then begin
    value1 = NTChange(NTOID,0,0,low);
    print(value1:0:0," ",NTOrderStatus(NTOID));
    end;
    if NTOID = "" then begin
    NTOID = string.format("{0:000000}",random(100000));
    value1 = NTCommand("PLACE","Sim101","Sell",1,"StopMarket",l ow - 10,0,"Day","",NTOID,"","");//STOP LOSS
    end;
    
    end;
    This is the print:
    NTOID =
    NTOID = 041173
    0 Accepted
    NTOID = 041173
    0 Accepted
    NTOID = 041173
    0 Accepted
    NTOID = 041173
    0 Accepted
    NTOID = 041173
    0 Accepted
    NTOID = 041173
    0 Accepted

    Seems like I must be missing something obvious, but I can't see it. I've been using this code for a long time.​

    I have recently started using the C2 platform transmit and I believe it is related to that.
    Last edited by Atomic; 02-16-2023, 09:50 AM.

    #2
    Hello Atomic,

    Thanks for your post.

    So I may accurately assist, please answer all of the questions below.
    • What version of NinjaTrader are you using (8.0.X.X)? Please provide the full version number found in the Help > About window.
    • Are you using the NTDirect.dll in an external application to interface with NinjaTrader?
    • The code you shared seems like it might be EasyLanguage code. Is this correct?
    • Does the NTCommand() method in the other platform call the Command() method in the NTDirect.dll?
    I look forward to assisting further.
    <span class="name">Brandon H.</span><span class="title">NinjaTrader Customer Service</span><iframe name="sig" id="sigFrame" src="/support/forum/core/clientscript/Signature/signature.php" frameborder="0" border="0" cellspacing="0" style="border-style: none;width: 100%; height: 120px;"></iframe>

    Comment


      #3
      Originally posted by NinjaTrader_BrandonH View Post
      Hello Atomic,

      Thanks for your post.

      So I may accurately assist, please answer all of the questions below.
      • What version of NinjaTrader are you using (8.0.X.X)? Please provide the full version number found in the Help > About window.
      • Are you using the NTDirect.dll in an external application to interface with NinjaTrader?
      • The code you shared seems like it might be EasyLanguage code. Is this correct?
      • Does the NTCommand() method in the other platform call the Command() method in the NTDirect.dll?
      I look forward to assisting further.
      I am using NT 8. I send orders from the Tradestation platform using Easylanguage and the NtDirect.dll functions, which I have used for a long, long time. The help guide says that for a change command, you can pass zero for the quantity or price if you don't want to change it, and that has been the way it always seemed to work. However, in doing a test just now, it would not execute a change unless I put a non-zero value for the quantity.

      value1 = NTChange(NTCurrentOrderIDsTL[0],1,NewPrice,0);
      I had to change the above from zero to one (after the orderID before it would do a change).

      Comment


        #4
        Hello Atomic,

        Thanks for your note.

        That is correct. From the CHANGE command documentation linked below: "Pass in zero (0) values for price and quantity if you do not wish to change these order parameters."



        So that I may accurately assist, please answer ALL of the questions asked in my previous post (listed below) that you did not answer.
        • What version of NinjaTrader are you using (8.0.X.X)? Please provide the full version number found in the Help > About window.
        • Are you using the NTDirect.dll in an external application to interface with NinjaTrader?
        Thanks in advance; I look forward to your reply.
        <span class="name">Brandon H.</span><span class="title">NinjaTrader Customer Service</span><iframe name="sig" id="sigFrame" src="/support/forum/core/clientscript/Signature/signature.php" frameborder="0" border="0" cellspacing="0" style="border-style: none;width: 100%; height: 120px;"></iframe>

        Comment


          #5
          Originally posted by NinjaTrader_BrandonH View Post
          Hello Atomic,

          Thanks for your note.

          That is correct. From the CHANGE command documentation linked below: "Pass in zero (0) values for price and quantity if you do not wish to change these order parameters."



          So that I may accurately assist, please answer ALL of the questions asked in my previous post (listed below) that you did not answer.
          • What version of NinjaTrader are you using (8.0.X.X)? Please provide the full version number found in the Help > About window.
          • Are you using the NTDirect.dll in an external application to interface with NinjaTrader?
          Thanks in advance; I look forward to your reply.
          I am using NT 8.0.26.1 and I send orders from a Tradestation platform using the NtDirect dll.
          I may have done something to cause this problem. Do not worry about it unless I post back to confirm that there is a problem.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by Geovanny Suaza, 02-11-2026, 06:32 PM
          0 responses
          596 views
          0 likes
          Last Post Geovanny Suaza  
          Started by Geovanny Suaza, 02-11-2026, 05:51 PM
          0 responses
          343 views
          1 like
          Last Post Geovanny Suaza  
          Started by Mindset, 02-09-2026, 11:44 AM
          0 responses
          103 views
          0 likes
          Last Post Mindset
          by Mindset
           
          Started by Geovanny Suaza, 02-02-2026, 12:30 PM
          0 responses
          556 views
          1 like
          Last Post Geovanny Suaza  
          Started by RFrosty, 01-28-2026, 06:49 PM
          0 responses
          554 views
          1 like
          Last Post RFrosty
          by RFrosty
           
          Working...
          X