Code for partial close with percentage

Forums ProRealTime English forum ProOrder support Code for partial close with percentage

Viewing 15 posts - 1 through 15 (of 62 total)
  • #153312

    Please, code for partial close with porcentage?

    #153313

    There you go (not tested):

     

    1 user thanked author for this post.
    #153326

    Really fast, thanks Roberto!

    #153428
    AE

    There you go (not tested):

    This is already available with PRT 11? Because on PRT 10 it wasn’t possible partial closed.

     

    Thanks

    #153432

    Yes, it is available with v11.

     

    #154384

    Help for code. I need that if the price falls 0.5% from the opening price, it partially closes 0.2% of the position. Thank you.

    #154392

    There you go (not tested):

    I added a check to make sure the quantity left open is not < to the Minimum Lot Size required (that you can set at line 3, after checking with the broker).

    My code in the previous post was missing the word Contracts.

    #154419

    Sorry… ?

    #154425

    You may either write lines 5-6 manually or try to replace them with:

    Using a different name.

    #154427

    This with partial close is interesting.

    If you want to close 50% of the position when you have 20 points plus.

    What does that code look like?

    #154446

    Long, (1+fallpercent).

    Short, (1-fallpercent).

     

    You can change “ONCE percent” and “ONCE fallpercent” to others %.

     

     

    #154451

    There you go:

     

    #154455

    Thanks Roberto but I got an error “RemainQty” when I run your code.

    what am I doing wrong?

    I have position size = 4 and want to close 2 contracts when I am 20 points plus.

     

    Regards

    #154457

    So how do I enter the values ​​in row 5 if I have 4 contracts from the beginning and want to close 2 contracts.

    #154538

    You may either write lines 5-6 manually or try to replace them with:

    Using a different name.

     

    I’m probably pretty stupid.

    Is there an opportunity to explain in a simpler way how I do with “RemainQty”.

    Gets error no matter what I do!

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

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