how to set breakeven to price of entry

Forums ProRealTime English forum ProOrder support how to set breakeven to price of entry

Viewing 2 posts - 1 through 2 (of 2 total)
  • #238407

    Hi,

    I want to write a code so that the breakeven is equal to the price the position was bought for. The system buys 2 contracts initially and sells one after X number of pips, I want the breakeven of the second contract to be set at the entryprice + 2 pips so the 2nd contract can follow a trailing stop instead.

    When I try with:

    It sells the 2nd contract based on where to first sell of the 1st contract took place. I want it to be based on the initial postion instead.

    I´ve also tried with tradeprice (1) instead of  entryprice  but that seems to refer to the previous latest trade of selling 1 contract instead of the initial price when I bought the position.

    anyone have any idea on how I can solve this?

    With kind regards, Victor

     

     

     

    #238410

    First you have to store the Entry Price on the first entry bar (which is when it’s OnMarket, but it wasn’t the prior bar).

    Then SET the stop whenever you have reduced the position size:

     

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

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