Trailing stop minimum increase? Reject orders

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #250273 quote
    Tropic
    Participant
    New

    Hi everyone

    I created a code with a trailing stop using the classic “set stop ptrailing”. I ran the backtest and everything was fine, but when I tested it live on ProOrder, it rejected my orders with this message:

    “The trailing stop increase is less than the required minimum. The minimum amount on the increase for this market is 5”.

    What does this mean? It had never happened to me with other codes. I set the “set stop ptrailing” to 50. How can i solve it?

    Thanks

    #250282 quote
    robertogozzi
    Moderator
    Master

    The instruction:

    set stop ptrailing 50

    is an order to START trailing the stop loss after 50 pips.

    Once the trailing starts, the STEP is fixed in 1 pip (this can’t be changed) and that’s likely to be the issue with the error you reported.

    I suggest that you replace that instruction with a trailing stop code. You will find many examples in this forum, but the simplest and probably most used one is Nicolas’ code at https://www.prorealcode.com/blog/trading/complete-trailing-stop-code-function/ (lines 17-56). You simply need to append those lines to your code and set trailingstart = 50 and trailingstep to 5+.

    Iván González thanked this post
    #250312 quote
    Tropic
    Participant
    New

    Oh ok thanks Roberto, ill try  😉

    #250329 quote
    Tropic
    Participant
    New

    Wait, I analyzed the code you proposed to me and it doesn’t seem to me to be a real trailing stop, but more of a TP with steps of 5 if the price goes in favor of the position of 20 but I want there to be a  trailing stop even if the position doesn’t go in my favor and it has to be updated every time.

    I would like the trailing (the newSL in our case) to be placed immediately at 50 distance from the price as soon as I enter the position even if the trade does not go in my favor so it will stop at -50 like a normal SL, if the price goes in my favor for example by 1 it will update to -49 etc… I do not want to wait for a certain threshold to be reached to activate it.

    Do you think that by doing it manually we can avoid the minimum threshold of 5 of the increment that the broker wants with the “set stop ptrailing” instruction?

    so something like:

    trailDistance = 50
    
    IF NOT ONMARKET THEN
    
    newSL = 0 ENDIF
    
    // LONG
    
    IF LONGONMARKET THEN
    
    theoreticalSL = close - trailDistance * pipsize
    
    IF newSL = 0 THEN
    
    newSL = theoreticalSL
    
    ENDIF
    
    IF theoreticalSL > newSL THEN
    
    newSL = theoreticalSL
    
    ENDIF
    
    ENDIF
    
    
    #250332 quote
    robertogozzi
    Moderator
    Master

    Then SET STOP PTRAILING seems the right choice. Ask ProRealTine pressing Ctrl+M from the platform.

    Iván González thanked this post
Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.

Trailing stop minimum increase? Reject orders


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
Tropic @tropic Participant
Summary

This topic contains 4 replies,
has 2 voices, and was last updated by robertogozzi
5 months, 2 weeks ago.

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 09/02/2025
Status: Active
Attachments: No files
Logo Logo
Loading...