Change size depending on result

Forums ProRealTime English forum ProOrder support Change size depending on result

Viewing 15 posts - 1 through 15 (of 18 total)
  • #203165

    Hi, took a look at the snippet library but could not find what i was looking for. I want to add to my system following:

     

    • If x of last trades were losses, increase size by y
    • If x of last trades were wins, decrease size back to y

    Saw something similar on ICT and how to flatline your equitycurve by going down to normal size after x number of wins in a row

    #203170

    There you go (not tested):

     

    1 user thanked author for this post.
    #203173

    Link to above added as Log 342 here …

    Snippet Link Library

    1 user thanked author for this post.
    #203174

    Thanks as always Roberto!!

     

    This is what i got this far, but size does not reset back to 0.2 lots, i want the system to have:

    • 0.2 lot size as STANDARD.
    • When making one loss, i want to add 0.2 lots, if it makes a loss again (two in a row) Add another 0.2 lots. Makes 3 in a row, another 0.2 lots and so on until it makes a win, then i want it to reset back to Standard 0.2 lot size
    • When got a win, add 0.2 up to 5 wins, if system reaches 5 wins in a row, reset back to standard 0.2 lot size.
    • If possible, also add max lotsize of MAXLOTSIZE
    1 user thanked author for this post.
    #203175

    Add 1 in lines 6 and 12, not 0.2.

     

    1 user thanked author for this post.
    #203176

    thanks! But still does not reset lotsize, in the end size is 20 lots ^^,

    #203177

    Here is the full code if it helps 🙂

    #203179

    Ulle, the above is from your example. It should work better with these corrections.

    Btw, I don’t find this back in your main code (which is not for my brains anyway – it really is too full with mistakes/faults 😉 ).

    Try to get your sample code to work, and when it does what you want, slowly expand it to your strategy idea.
    🙂

    1 user thanked author for this post.
    #203182

    Sorry for mispelling, but I could not test it, as I was writing it from my mobile phone.

    In such cases using GRAPH may help quite a lot!

     

    #203186

    It is a best example of why PRT should not allow to use variables (without producing an error) that were not defined earlier in the code. Thus :

    PRT developers apply the intelligence that because the WiningTrades = 0 line exists, the If above it does not produce an error.
    I once lost money because of such a typo and IIRC the response was that I should not make typos.
    So I repeat from back then : there is no language that I know of which allows this.  And it is worse :

    The official response from PRT support (in Paris) was :
    If we don’t do it this way, nobody is able to get his program to run because of errors.

    A weirdest response ever. Apparently it is better to lose money.

     

    PS: V12 provides a kind of solution to this.

    #203188

    To be honest I prefer the current solution to the previous one, when it was difficult to test variables as you always got the “undefined  variable” error message and you had to always comment/uncomment lines. It was so much time consuming!

     

    #203189

    nobody is able to get his program to run because of errors.

    PRT likely got many Coding Support Queries due to above and so easy way to reduce Queries … make errors not show as errors at all!?

     

    #203196

    To be honest I prefer the current solution to the previous one, when it was difficult to test variables as you always got the “undefined  variable” error message and you had to always comment/uncomment lines. It was so much time consuming!

    I 100% agree with you. That is, would it be really like that. But it was not ..

    The crazy time consuming was about that a variable was not used
    Example :

    So we could not comment-out lines unless in this case the first line was commented out as well.
    And back to the old If ? indeed a crime (requires 1st line to uncomment and the 2nd to comment out).

    But this is not related to what’s odd today (in V11).

    #203197

    PeterST, no i did not get it to work anywhere close to what i wanted, it took positions up to 20 lots, I want a maxsize of total of 2-3 lots and add to every loss. So i scrapped it, hoping code-wizards like Roberto could make some magic and add to my original code 😀 my codingskillz are way worse than my english ^^,

    #203199

    Shall the X trades, either winning or losing ones, be consecutive?

     

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

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