Widen stoploss overnight

Forums ProRealTime English forum ProOrder support Widen stoploss overnight

Viewing 6 posts - 16 through 21 (of 21 total)
  • #77953

    You can or cannot use ABS, it depends on your coding style. Look at this code, the most widely used for trailing stops https://www.prorealcode.com/blog/trading/complete-trailing-stop-code-function/.

    To check if the current price has reached your trailing stop treshold you can (but the above example is complete and perfectly working AS IS) write:

     

    #77954

    Negative values do not work with a SET STOP.

    #77957
    Seb

    Alright, so you can only trail to break-even with a SET STOP type stoploss. Than I will try to find out what’s causing the strange overnight behavior with the stops as described in my first post.

    #77962

    Also do not forget that if you send an order to the market that is too close to the price then the order will be rejected. You need to consider the minimum allowed stop distance for whatever instrument you are trading and include something in your code to ensure you never try to place an order that is under it.

    1 user thanked author for this post.
    avatar Seb
    #77964
    Seb

    I experienced that if it tries to put in a stoploss and the current price is beyond the stoploss level, the position closes at market (with IG CFD). Stops too close indeed got rejected. Will this shut the system down after too many rejections?

    #77967

    Will this shut the system down after too many rejections?

    Yes, after 12 rejections, you are closed down on the 13th I think?

    Not sure if there is a time limit on that, like > 12 rejections within 1 week etc??

    1 user thanked author for this post.
    avatar Seb
Viewing 6 posts - 16 through 21 (of 21 total)

Create your free account now and post your request to benefit from the help of the community
Register or Login