Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Dynamic Order Entry Adjustment

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

    Dynamic Order Entry Adjustment

    I currently dynamically adjust my profit targets with the following code;

    if(Position.MarketPosition == MarketPosition.Long)
    {
    SetProfitTarget(
    "Long RTM76", CalculationMode.Price, Math.Min(MyEntryPrice + (8*TickSize),POC));
    }

    I now want to dynamically adjust my Limit Order before the trade is opened. Initially, my strategy uses this to enter the order;

    EnterLongLimit(1,LongTrigger,"Long 3PB");

    To have it adjust the order dynamically, I know the "if" portion, but what would I put between the brackets below?

    if(Position.MarketPosition == MarketPosition.Flat)
    {
    What goes here?

    }

    Thanks

    Safetrading

    #2
    Hello Safetrading,

    Thank you for your post.

    You can set your Profit Target under the if(Position.MarketPosition == MarketPosition.Flat) condition as well. There would be no need to use another order method.
    Code:
    if(Position.MarketPosition == MarketPosition.Flat)
    {
    SetProfitTarget("Long RTM76".........
    Please let me know if I may be of further assistance.

    Comment


      #3
      I don't think we are on the same page. Let me explain again. I understand how to dynamically change my Target once the trade is open. What I do not know how to do is dynamically change my Entry Order to open the trade.

      So for example, my strategy enters a Limit Order, but it is not hit, price conditions change a little and I want my Limit Order moved before the trade is opened. How do I reference my Limit Order to move it?

      Thanks.

      Comment


        #4
        Hello Safetrading,

        Thank you for your response.

        In this case just use different conditions for the different market action.

        For example:
        Code:
        if(Position.MarketPosition == MarketPosition.Flat)
        {
        
        if(Close[0] > Close[1])
        {
        EnterLongLimit(Close[1]);
        }
        
        if(Close[0] < Close[1]);
        {
        EnterLongLimit(Low[0]);
        }
        
        }
        This does not mean I have two Limit Orders but two conditions to submit a limit order.

        Please let me know if I may be of further assistance.

        Comment


          #5
          OK, we are getting closer. I understand your suggestion, but it is not what I'm trying to do. I'm talking about AFTER my Limit Order is placed, I want the strategy to move it based upon changing price conditions. The example you just gave me allows me to place a Limit Order based upon different criteria, but not to change it after it is placed, and that is what I'm trying to do.

          Thanks,

          Comment


            #6
            Hello Safetrading,

            Thank you for your response.

            If the Limit order is filled, then it no longer exists and the Market Positions is Long or Short.
            There would be no way to adjust the Limit order at that point as it would not exist.

            If you want to adjust it before it is filled then the method I showed was an example of changing the placement of the Limit order depending on market conditions.

            Please let me know if I may be of further assistance.

            Comment


              #7
              Originally posted by safetrading View Post
              OK, we are getting closer. I understand your suggestion, but it is not what I'm trying to do. I'm talking about AFTER my Limit Order is placed, I want the strategy to move it based upon changing price conditions. The example you just gave me allows me to place a Limit Order based upon different criteria, but not to change it after it is placed, and that is what I'm trying to do.

              Thanks,
              You use an IOrder, and simply reissue it at the adjusted price.

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by Geovanny Suaza, 02-11-2026, 06:32 PM
              0 responses
              650 views
              0 likes
              Last Post Geovanny Suaza  
              Started by Geovanny Suaza, 02-11-2026, 05:51 PM
              0 responses
              370 views
              1 like
              Last Post Geovanny Suaza  
              Started by Mindset, 02-09-2026, 11:44 AM
              0 responses
              109 views
              0 likes
              Last Post Mindset
              by Mindset
               
              Started by Geovanny Suaza, 02-02-2026, 12:30 PM
              0 responses
              574 views
              1 like
              Last Post Geovanny Suaza  
              Started by RFrosty, 01-28-2026, 06:49 PM
              0 responses
              577 views
              1 like
              Last Post RFrosty
              by RFrosty
               
              Working...
              X