Code a DOUBLE STOP at opening price candle and turn it into a TRAILING STOP ???

Forums ProRealTime English forum ProOrder support Code a DOUBLE STOP at opening price candle and turn it into a TRAILING STOP ???

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

    Hello everyone, I’m new here and this is my first post 😊
    I’m just starting to learn programming and I want to create an automated trading robot in PRT (ProRealTime), which I’ve been using manually in demo mode for the past 2 months.

    My idea is to create a code that will execute at a specific time (my research led me to use TIME=153000, on the 1-minute timeframe).

    At exactly 15:30:00, I want to place two STOP orders, each 10 points away from the opening price of the 15:30 candle (or from the close of the 15:29 candle).

    Let’s imagine an opening price at 15:30:00 of $100. I want to place the first STOP at $90 (in case the price goes up) and the second STOP at $110 (in case the price goes down).
    The first of the two stops that gets triggered by the price will become a market order, and the other will remain a STOP order.

    This setup allows taking a position regardless of which direction the price moves at the candle’s opening.

    I’ve already done this manually, but I don’t know how to code it.
    Does anyone have an idea to help me? A code example would be great too.

    (Super) Bonus question: Once one of the stops has been triggered and becomes a market order, can the other one be transformed into a trailing stop instead of remaining a fixed stop?

    Thanks so much in advance!

    #249237

    Hi! here you have:

    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