Take position after initial movement after open

Forums ProRealTime English forum ProOrder support Take position after initial movement after open

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

    Hi,

    I am trying to create a code that helps me with placing two orders.

    • One sellshort x1% below the opening price
    • one buy order X2% above the opening price.

    When one of these is opened, the other one should be cancelled.

    The order that is executed should have a SET TARGET %PROFIT of X3
    and a SET STOP %LOSS X4.

    Super grateful for any assistance!

    #215805

    There you go:

    the pending orders that haven’t been triggered are automatically cancelled when a candle closes.

    Be warned that it’s not possible to prevent both of them from being triggered, as PRT has no control over pending orders once they are sent to the broker, until the candle closes. If both pending orders are triggered, the latter one will close the first one triggered, as there cannot be opposite trades open at the same time.

     

    #215821

    Many thanks Roberto!

    Seems to be working fine! When using this “live” (i.e. not back testing) I suppose I would be able to define “max position” as 1 contract which would in practice cancel the other pending order thus preventing both to be triggered. Would that be correct?

     

     

    #215848

    I never tried it, but I don’t think so, as max positions is a directive to ProRealTime. But PRT loses control over orders as soon as thay are sent to the broker.

    You can have a try…

     

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