Partial reentry issue

Forums ProRealTime English forum ProOrder support Partial reentry issue

Viewing 4 posts - 1 through 4 (of 4 total)
  • #168746

    Good morning,

    I am trying to code a partial reentry code that, in case that an open position goes near the SL, it should buy/sell a position equal to positionsize/2. I am using cumulateorders = true and Countofposition <=2, and I want the robot to perform the reentry only once. I am not sure what am I doing wrong but the robot does not perform the reentry correctly, could someone give me some light about that topic? I am attaching the code for the reentry:

    Thank you so much.

     

     

    #168749

    Remove ONCE from line 3, because it will be set when the strategy starts only, with an incorrect value (you can GRAPH it).

    Line 10 could also be written like that:

    and line 17:

     

     

     

     

    1 user thanked author for this post.
    #168752

    Thank you for your answer, one more question: In case it opens another position, if I use PositionPrice command which price will the robot take, the one corresponding to the first opened position or the second one?

     

    #168753

    Do not use QUOTE when unnecessary, as it makes posts more difficult to read and too long!

    Thank you 🙂

    PositionPrice (apart when there’s only one position open), is an average of all entry prices and SL + TP will refer to that price (see pic to see how it is calculated).

     

     

    1 user thanked author for this post.
Viewing 4 posts - 1 through 4 (of 4 total)

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