Cumulating positions ARE NOT WORKING

Forums ProRealTime English forum ProOrder support Cumulating positions ARE NOT WORKING

Viewing 8 posts - 1 through 8 (of 8 total)
  • #176322

    Gents,
    Could you check this code why the Cumulating positions are not working??

     

    #176326

    Hello,
    What is the issue that you have and make you say it’s not working?
    For sure, the variable MaxPositionsAllowed is defined but not used in the code, which is not good, the system will rebuy more than 5 times
    Assuming that the conditions are met, I would try something like this, and verifying the number of positions in the graph once the results are generated.

    #176330

    Conditions in lines 13 and 15 seem to be impossible to be both true at the same time.

     

    #176331

    The issue is that the code buy only once and never buy again when the conditions are met??!!

    #176333

    Condition C2 & C3, you are checking the price with an MACD line?! They do not share the same scale.

    When do you see an order opening? At beginning of the data history or later?

     

    #176337

     

    #176344

    this is the entry code for a cumulating algo I have up and running and I know works. In this case the limit is 3 entries instead of 5, but you can adapt it.

    The logic of MaxPositionsAllowed is to control the total number of contracts, not the number of entries. The code below will make 3 entries of 50 contracts each.

    Another stipulation I use, that you might want to consider, is adding “and positionperf <0” to your additional entries, so that your total position is always averaging down.

     

     

    2 users thanked author for this post.
    #176351

    I really like the addition of the  “and positionperf <0” , neat snippet – thank you for sharing.

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

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