Tradeprice and Limits

Forums ProRealTime English forum ProOrder support Tradeprice and Limits

Viewing 7 posts - 1 through 7 (of 7 total)
  • #26204

    Hi Guys, Hoping you can help…….

    My question is in 2 parts:

    1: I enter a buy position, and i can tell what the entry is by Tradeprice(1)
    Then a few bars later I enter a 2nd (cumulate) buy position.
    Question: Is the 1st position still Tradeprice(1) and the 2nd position Tradeprice(2)? (or visa versa)?

    2: I enter a buy position, with Take Profit (Limit) at 20 pips
    Then a few bars later buy another (cumulative) position. (My 2nd added position also then automatically has a Take Profit of 20 pips).
    I now have 2 positions both with a Take profit of 20 pips
    Question: How do i now alter only the 1st position to take profit at a different level (ie change the limit to say 50 only on the 1st position)?

    Any help is appreciated.

     

    #26234

    Hello pips_103,

    1. The very last position opened is tradeprice(0). So the order is in reverse from when the trades were executed.
    2. Maybe this thread will help: https://www.prorealcode.com/topic/stop-loss-profit-target-do-they-affect-all-positions/

    Concerning 2) does this help?

    1 user thanked author for this post.
    #26263

    Thanks Derek, appreciated

    #26332

    Hello Pips,

    just got into this topic myself and found this in the proorder manual:

    Multiple stop and target levels

    Only one “Set Stop” and one “Set Target” command can be active at a time under normal circumstances. If there are successive “Set Stop” or “Set Target” commands in a code, the last command replaces the previous command.

    Example:

     

    So, I guess the answer is “no”, unfortunately.

     

    #26333

    ah yes, your right, Thanks Derek 🙂

    #94374

    The very last position opened is tradeprice(0). So the order is in reverse from when the trades were executed.

    Follow up on this — on a candle there could be an “buy long” order that happens as well as “trailing stop loss” order triggered exiting a previous position (or perhaps the one you just entered if it’s a long candle).

    Question — in your code how do you know/determine which came first on that candle and what the value of each order was?

    THank you

    #94380

    If you want to know if the last tradeprice is the trailing stop activated, check if the order is in profit or not.

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

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