Is it possible to scale in and scale out of trades

Forums ProRealTime English forum ProOrder support Is it possible to scale in and scale out of trades

Viewing 5 posts - 1 through 5 (of 5 total)
  • #252227

    I want to write a program where I build up a number of short positions say 5. (Sellshort)

    When CountOfPosition = say 5 start buying them back.
    Boolean variable BuybackMode = False during build up of short position
    BuybackMode = True once CountOfPosition = 5 and stays True whilst positions bought back.

    The issue I am having is that I can build up the sellshort positions according to criteria 1 through 5 ok.

    The issue I am having although I specify Buy 1 Contract back at a time the first time the first buy criteria is met the whole
    position, all 5 contracts are bought back.

    So trades entered using Sellshort singlely 1 through 5
    Plan to exit them singlely using Buy.

    My question is of concept in the first instance.

    “Is it possible to scale in and scale out of trades in PRT?”

    #252231

    Sure, but in your example you must ExitShort (or Sell when your position is Long).
    This works only with Market Orders. But beware, Backtesting allows it with Pending Orders as well – hence don’t use them accidentally.

    1 user thanked author for this post.
    #252240

    Try this one (not tested):

     

     

    #252328

    I realized that the above snippet closes ALL the positions, you might prefer this line 9:

     

    1 user thanked author for this post.
    #252337

    Thank you.

    I have my code working now in Demo.

    I worked out, having been given the heads up about ExitShort, the correct syntax.

    Thanks again

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

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