Automatically place a reverse trade

Forums ProRealTime English forum ProOrder support Automatically place a reverse trade

Viewing 6 posts - 1 through 6 (of 6 total)
  • #67138

    I wonder if anyone can help… I’m trying to write code so that a new order is placed automatically if our stop is hit. For example we go long on the DAX with a stop of 14. The DAX falls and hits our stop. I then want to automatically open a new order to go short with a stop and limit in place for the new trade….

     

    #67139

    Show us how far you got with this.

    I assume your stop is a pending stop order? In that case the new order can be triggered at the open of the next bar. More instantly I think it is not possible with PRT.

    #67141

    An entry Buy limit order at same price level as the exit sell stop order or vice versa?

     

    #67143

    Good idea Grahal! Might end up in some case that not both orders are filled simultaneously though.

    Ah how stupid. Just place a stop order of double size so you end up with a switched position and don’t risk that only one side was filled. Jesus I better go to bed again. 🙂

    1 user thanked author for this post.
    #67147

    The stop is coded as :

    SET STOP pLOSS vSLoss

    It is when this stop is triggered I want to enter the new trade. If the original trade moves in to profit I then start trailing the stop up…..

    This is the code to trail the stop :

     

    I have the reverse of this code for Buy trades.

    #67148

    Like I wrote above. Don’t use SET STOP PLOSS. Just place a normal stop order at the desired level but double the positionsize. Then you will end up with an reversed position.

    BTW your code is much easier to read if you use the “insert code” function and not simply copy/paste it in the text.

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

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