Set price to buy

Viewing 3 posts - 1 through 3 (of 3 total)
  • #113524
    AE

    Hi folks!

    I would like to know if there is any way to set a price to buy using the last positionprice of my last operation.

    Example:

    Step 1. Strategy condition is met and buy DAX at 13.200. Set TP at 13.230

    Step 2. DAX move up to 13.230 so it closed the position

    Step 3. Create a new order limit to buy at last positionprice (13.200)

    Thanks

    #114285

    Yes use TRADEPRICE(1)

    https://www.prorealcode.com/documentation/tradeprice/

    However, reading the link above confused me a bit … to use your example …

    IS

    TRADEPRICE(1) =  13.230 (exit order)

    AND

    TRADEPRICE(2) =  13.200 (entry order)

    I’m sure some helpful member will spot this post and clarify for us?

    #114286

    Yes TRADEPRICE is the last order price (or last Nth order price) so if the last order was an exit that is what TRADEPRICE will be so this does not work for position price.

    You need to record POSITIONPRICE at the close of each bar.

    Then you can buy at that price using a pending order.

    2 users thanked author for this post.
Viewing 3 posts - 1 through 3 (of 3 total)

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