Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Unable to change order with no native error

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

    #16

    Hi,

    Thanks for the reply. Can you please update the file and send me as I have tried that as well and it doesn't work.

    I have printed the prices on the console too and band upper price is above the market price.

    Bid Price 21877.25

    Band Upper price 21882.3570079829

    This is for the NQ futrures

    if (pos.MarketPosition == MarketPosition.Long)
    {

    Print(GetCurrentBid() + " " + band.Upper[0]);
    AtmStrategyChangeStopTarget(0, band.Upper[0], "TARGET1", atmStrategyId);
    //AtmStrategyChangeStopTarget(0, band.Lower[0], "Target1", atmStrategyId);

    }
    else
    {

    Print(GetCurrentBid() + " " + band.Lower[0]);
    AtmStrategyChangeStopTarget(0, band.Lower[0], "TARGET1", atmStrategyId);
    //AtmStrategyChangeStopTarget(0, band.Upper[0], "Target1", atmStrategyId);
    }​

    Attached Files

    Comment


      #17
      Hello azh_ali,

      As long as the price being used is a valid price that should allow you to change the target price using that method.

      Comment


        #18
        It doesnt do that. Can you confirm if you it works for you?
        I have attached a screenshot and hardcoded the price which is above the current price.

        Click image for larger version  Name:	image.png Views:	0 Size:	509.1 KB ID:	1332270
        Please run the atm and see its not working. However, stop works fine

        Comment


          #19
          I figured it out.

          FOr targets
          AtmStrategyChangeStopTarget(newPrice, 0, "TARGET1", atmStrategyId);

          For stops

          AtmStrategyChangeStopTarget(0, stopPrice, "STOP1", atmStrategyId);

          I was sending values in the second parameter for both the cases.

          thx for looking​

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by CarlTrading, 03-31-2026, 09:41 PM
          1 response
          84 views
          1 like
          Last Post NinjaTrader_ChelseaB  
          Started by CarlTrading, 04-01-2026, 02:41 AM
          0 responses
          47 views
          0 likes
          Last Post CarlTrading  
          Started by CaptainJack, 03-31-2026, 11:44 PM
          0 responses
          66 views
          2 likes
          Last Post CaptainJack  
          Started by CarlTrading, 03-30-2026, 11:51 AM
          0 responses
          69 views
          0 likes
          Last Post CarlTrading  
          Started by CarlTrading, 03-30-2026, 11:48 AM
          0 responses
          58 views
          0 likes
          Last Post CarlTrading  
          Working...
          X