Close operation and open a new operation.

Forums ProRealTime English forum ProOrder support Close operation and open a new operation.

Viewing 15 posts - 1 through 15 (of 21 total)
  • #165975

    I am in the market with an operation for several days.

    I see that these days the conditions have been given several times to re-enter the market.

    What I want is that if I am in the market and the conditions to enter are met, the operation is closed and a new operation is opened.

    Thanks.

    #165982

    It makes no sense, as the reopening price will be the closing price of the old trade and there are no advantages.

    Even overnight fees won’t change.

    You can easily  do this by exiting and reopening after 30 bars have elapsed:

     

     

    #165990

    or you could try “cumulative orders = true” to add to your position each time conditions are met

    #165991

    Please, no cumulative órders.

     

    If onmarket aNd conditions then

    Sell at market

    Exitshort at market

    #166043

    It makes no sense, as the reopening price will be the closing price of the old trade and there are no advantages.

    Even overnight fees won’t change.

    You can easily do this by exiting and reopening after 30 bars have elapsed:

    When you code “sell at market” and “buy at market” in the same bar, ProRealtime won’t do anything. At least not in a backtest, and I think neither in reality with IG. It will just leave the old position open, because in effect, nothing changes. No orders will be executed.

    I think what was implied in the original question is : How do you get a new entry price for an old position on whose basis exits (trailing stops, target profits, and so on) are being calculated. Instead of taking “positionprice” for that purpose, you can remember the closing price of a certain bar as “newpositionprice” and do all exit calculations with this one from then on.

    #166053

    The position should be Closed, and start a new operation.

    #166055

    This will make the broker happy by paying more fees.

    #166062

    What is the point of closing a position and immediately opening a new one? You will just have to pay the spread to the broker each time just to be in exactly the same position as you were (except now holding at a worse price than you were before). This is why if a buy order and a sell order are sent to the broker at the same time by a strategy they just cancel each other out.

    #166064

    Maybe he wishes to lock in profit and start a new trade with a fresh stoploss.

    #166065

    Sounds like a rather expensive type of trailing stop.

    #166068

    Close and reentry in same direction in the same bar can happen with cumulated orders and maintaining 1 position-size I believe.

    Some code will run into a problem, because i.e. a trailingstop won’t reset unless it’s modified for this specific issue. I use it with these adjustments for backtesting only.

    #166071

    I just re-checked on demo today : When you close a position and re-open it again in the same bar, nothing happens. No orders are executed, and the old position is kept open with all stops and limits as they were before.

    #166078

    When you close a position and re-open it again in the same bar, nothing happens.

    Yes – each order cancels out the other.

    #166079

    Maybe he wishes to lock in profit and start a new trade with a fresh stoploss.

    Then just move the stop loss – it achieves exactly the same thing but without paying the spread.

    #166131

    ‘set stoploss’ can’t be moved right? You’d have to code in a separate exit which only activates on bar close.

    I mean I personally wouldn’t do that but I can see reasons for it

Viewing 15 posts - 1 through 15 (of 21 total)

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