Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Limitorders in script strategies

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

    Limitorders in script strategies

    Hello,

    I have a question about the behavior of limitorders in NT-script-strategies.

    EG when enabling a long script I place a buy-limit below an expected price.
    When GetCurrentAsk() is only 2 Ticks away from this expected price and conditions are true in my script then the script moves the limit to that price.

    But it often occurs that there appear the messages in the attachment.

    Why? If the limitprice is moved by the script and it is below the CurrentAsk then its a limit order. Yes?
    If price spikes down fast and the limit is therefore above then it should act as a market order. No?

    Why do the attached messages appear please?

    Is there a better entry method that I can use that would avoid this errors for what I intend to do with my description?

    Thank you!
    Tony
    Attached Files

    #2
    Hello tonynt,

    Thank you for your post.

    The message indicates the order violation is due to a Buy Stop Market or Buy Stop Limit being submitted below the market price.

    Do you have any Stop orders that might be submitted at the same time and possibly the same price as the Buy Limit order?

    I look forward to your response.

    Comment


      #3
      Hello Patrick,

      thank you for your reply. I have in onbarupdate enterlonglimit() and in onexecution setstoploss and setprofittarget and both with calculationmode.Price And I have a long script and a short script to avoid issues.

      Could the message come from an incorrect price in setstoploss or setprofittarget?

      Thank you
      Tony

      Comment


        #4
        Hello tonynt,

        Thank you for your response.

        It is possible this is the case. Are you using unique signal names for the entries and referring to those signal names in the SetStopLoss to ensure a different Stop Loss is used for each entry type?

        I look forward to your response.

        Comment


          #5
          Hello Patrick,

          thank you for your reply. Yes, I do like

          (onbarupdate)
          entryOrderLAa=EnterLongLimit(0,true,1,startlimit, "LAa");
          entryOrderLAb=EnterLongLimit(0,true,1,startlimit, "LAb");

          (onExecution)
          SetStopLoss("LAa", CalculationMode.Price, stop1, false);
          SetProfitTarget("LAa", CalculationMode.Price, startt1);
          SetStopLoss("LAb", CalculationMode.Price, stop1, false);
          SetProfitTarget("LAb", CalculationMode.Price, startt2);

          Thank you for your support!

          Tony

          Comment


            #6
            Hello Tony,

            Thank you for your patience.

            Is the "stop1" value ever changed in the code? It would appear it is adjusted to a level invalid for the new Stop Loss to cover the short position.

            I would start by tracking this value with Print() commands.

            Please let me know if you have any questions.

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by Geovanny Suaza, 02-11-2026, 06:32 PM
            0 responses
            576 views
            0 likes
            Last Post Geovanny Suaza  
            Started by Geovanny Suaza, 02-11-2026, 05:51 PM
            0 responses
            334 views
            1 like
            Last Post Geovanny Suaza  
            Started by Mindset, 02-09-2026, 11:44 AM
            0 responses
            101 views
            0 likes
            Last Post Mindset
            by Mindset
             
            Started by Geovanny Suaza, 02-02-2026, 12:30 PM
            0 responses
            553 views
            1 like
            Last Post Geovanny Suaza  
            Started by RFrosty, 01-28-2026, 06:49 PM
            0 responses
            551 views
            1 like
            Last Post RFrosty
            by RFrosty
             
            Working...
            X