Bug with Limit pending orders when partially close position

Forums ProRealTime English forum ProOrder support Bug with Limit pending orders when partially close position

Viewing 5 posts - 1 through 5 (of 5 total)
  • #207651

    Hello,

    I was trying to code a Management strategy for my Bot and noticed that there is a bug with Limit pending orders when partially close position.

    If i use Sell mypartialclosesize at market it work, but if i try to use Sell mypartialclosesize at mylimit Limit, it does not work.

    It can work sometimes with Limit pending orders when partially close position though : for that you need to enter a position with more than one order, and then when you will try to close partially the position, Limit pending orders allows only to close partially the first opened position… Not sure if i am clear here 🙂

    For example, if my bot buy 10 shares with one order only, and try to close partially the position with Limit pending orders, it does not work (i had to use at market pending orders to do so)
    If my bot buy 10 shares with 2 or more orders (for example, it buy 2 shares, then 3 shares, then 5 shares), then it is possible to close partially the position with Limit pending orders, but not the whole position : only the part of the position that is not the last buy order (in my exemple, the last 5 shares are not partially closeable with Limit pending orders).

    Srange ? Have you notice same thing ?
    I think this bug ex^plane several issues like this that have found no solution :
    https://www.prorealcode.com/topic/vente-partielle-de-contrat-sur-indice/page/2/

    #207656

    Pending orders cannot partially close positions. Only market orders can.

     

     

    #207658

    Hello Roberto,

    They do, only if you enter the position with more than one order.

    This don’t work :
    Buy 2 shares at x limit or Buy 2 shares at market, can’t be partially closed by Pending Limit orders

    This work :
    Buy 1 share at x limit
    Buy 3 share at market
    then
    Sell 1 Share at x+10 limit => this works because it does not try to close the last buy order

    This does not work :
    Buy 1 share at x limit
    Buy 3 share at market
    Sell 2 Share at x+10 limit => this does not work because it is impossible to close partilly the partilly the last buy order with pending orders…

    Strange ?

    #207720

    They do only in backtests, not possible through ProOrder. Sorry if there are misleading codes here and there in the forums that embed pending orders that close partially positions.

    1 user thanked author for this post.
    #207740

    Ok. Thank you for the precision… Good to know sooner! 🙂
    I will change the code and try with MTF to stick with the limits i want…

Viewing 5 posts - 1 through 5 (of 5 total)

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