Wanted: small code snippet for reinvestment

Forums ProRealTime English forum ProOrder support Wanted: small code snippet for reinvestment

Viewing 15 posts - 1 through 15 (of 69 total)
  • #56939

    Hello.

    Who can help out with a surely simple code?

    The following strategy is to be extended by a re-investment strategy in the sense, so that
    the size of the position changes based on the initial capital.

    capital = 10000

     

    for Trade 1

    Position = capital/capital

     

    for all following trades

    if capital (new) <= 10000 then

    position = 1

    if capital (new) >10000 then
    position = capital (new) / 10000

    How can integrate this in the maincode?

    Attached the maincode

    #56947

     

    #56948

    ty i try

    #56949

    result with Re-Invest  …

    #56953

    the same code without Re-Invest but with SaisonalPatternMultiplier from Pathfinder-Systems

     

    kind regards an thanks to vonasi

    #56955

    at 01.01.17 the programm will run in demo and live for 1 year, after that 1 will post results

    i will add

     

     

    for insurance against all damage, e. g. an exploding nuclear power plant or something the likes

    #56956

    No problem. your strategy kicks straight into profit and never dips into a loss so the re-investment snippet never gets the opportunity to reduce the position size to 1 in reality.

    Interesting strategy – thanks for sharing it. I find myself writing a lot of long only strategies on the DAX 4 hour at the moment and they all seem to be easy to make profitable and all back test and walk forward test OK which leaves me with a slight sense of ‘it all seems too good to be true’. I hope I am wrong.

    #56957

    I notice that your test results are on the 4 hour chart but you have entry/exit criteria set on times that cannot be achieved in a 4 hour chart.

    Did you use different times than the ones posted on here?

    #56961

    Just for interest I sometimes use this for position sizing.

    It starts with a position size of one and increases position size as equity increases and reduces it as equity decreases. It protects your capital better at the expense of overall profit. The last two lines are to ensure that decimal sizes work live on IG. The only downside to this if you start with a small capital as it sticks with the same % of equity so a starting stake of 1 with capital of 5000 is 2% per position as opposed to the 1% with starting capital of 10000.

    #56963

    Out of interest I just did a quick comparison of true returns comparing the strategy with seasonal adjustment to the one without.  I set position size to 1 and then in the seasonally adjusted strategy I totalled up the total amount staked and then divided it by the number of bets and then divided the amount won by this to be able to compare apples with apples. Interestingly the seasonally adjusted strategy added 15.7% to profits. For me the only downside of this is the increase in initial position size from 1 to an average of 2.75 meaning that the losses can be pretty big ones – on the bright side the winners are too but you need a good bank size and a strong heart to run it live starting with such big stake sizes.

    #56964

    Hello again.

    I wasn’t really so concerned with the strategy presented here. Rather, coding the re-investment caused me problems, somehow I didn’t quite get through it. Now, however, I have one of you here. With it I will now be able to examine my other strategies to see whether it is worthwhile to use the Re-Invest.
    The Dax DailyOpenLong strategy presented here is thus a benefit for the Re-Invest coder and, of course, for the PRT community.
    Thanks to all of you!

    Kind regards
    JohnScher

    Translated with http://www.DeepL.com/Translator

    #56971

    Hello again JohnScher. Your code has interested me and I have been trying a few things out. You might want to change your entry criteria to include a third one.

    This stops entries that can quickly be closed out if Repulse is too close. Improves win rate and profitability. Hope this helps.

    #56975

    Another possibility if running the seasonal adjustment on a small starting bank is to only allow the seasonal adjustment to be added if funds allow.

    #57145

    @vonasi

     

    I would never have made it without you.

    see it https://www.prorealcode.com/library/

    my first publication here in the library

    Thanks so lot !!

    #57152

    No problem JohnScher. You did all the hardwork and testing!

    I’m running this slightly adjusted version with a third entry condition (as suggested above) that gives some differential to the Repulse exit conditions so that an entry is not made if Repulse is too close to the exit criteria. It gave me a better win rate and higher profit over your version posted above.

     

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

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