Increase position size x % after winning trade

Forums ProRealTime English forum ProOrder support Increase position size x % after winning trade

Viewing 13 posts - 1 through 13 (of 13 total)
  • #132718

    Hi all newbie looking for some help as am learning the ProOrder ropes.

    I have read the manual and have some very simple code tested and working  –

    I am trying to work out how to increase the position size but only after a winning trade – I want to increase it by 20% i.e x 1.2

    So if trade at 1 pp hits profit target and closes, the next position is at 1.2 pp, then 1.44, then 1.73 and so on. Position size to stay the same after a losing trade has closed.

    I had a look at martingales etc and tried to reverse that, but cannot work it out. Any ideas?!

    Thanks

    #132724

    I have been thinking about this a bit more and think I can explain it better, by removing IF NOT LongOnMarket – i.e I want the position to open whether I am long or not.

    I want to open the position size 1 when RSI < 30. If next candle is still <33 another position opens sized 1, and again sized 1 etc until either RSI > 30 or target profit hit (+30), or stop hit (-100).

    So if three candles are RSI < 30 I will have a total position size of for example 3 @ 98, but entry point might be 1 @ 99, 1 @ 98, 1 @ 97.

    What I am trying to achieve is

    • have the target and stop + 30 & – 100 from 98, rather than 99, 98 and 97.
    • If RSI rises above 30, and positions are open and then RSI reaches < 30 I want the new positions to open at the same size the sequence started – i.e in this case 1
    • If positions are closed in winning trade, next open position I want to be 20% higher = i.e 1.2, and that sequence to continue.
    • If positions are closed in losing trade, next open position I want to be the same size as the the start of the sequence that was the losing trade.

    Does that make sense, and if so is it possible?

    Thanks!

    #132733

    Code from your first post:

     

    1 user thanked author for this post.
    #132743

    Hi thanks, but could not get that to work. Noticed the ‘perecent’ typo, and corrected it. Code is accepted but when I test it, it seems like it opens a position but never shuts it. Results re trades are N/A

    Strategy profit pointer is helpful thanks, I will have a closer look at the manual re that.

    #132745

    I think Strategy Profit only the profit of the system overall? I am trying to increase position size if previous trade was profitable.

    #132746

    I am trying to increase position size if previous trade was profitable.

    You need to use PositionPerf(n) where n = 0 if no current open positions or n = 1 if there is a position open and you want the performance of the previous trade.

    1 user thanked author for this post.
    #132768

    It never exits until you tell it to properly. This would be fine on Dax, Sp500 or the like, where pips are 1:1 with price, it’ll not work on fx pairs where that ratio is 10000:1.

    Aleays use PipSize to multiply values at lines 3-4.

    STRATEGYPROFIT is what you need, it returns the whole strategy report, when a trade is closed, comparing the current value against the previous one will tell you if any trade has been closed and if it was profitable or not.

    POSITIONPERF only returns, in percentage, not money, the status of a current position, which can be profitable at times but could be losing in the end.

    #132773

    Apologies, should have specified I am testing with Spot Gold.

    #155178

    I was trying to limit trading for the day once 5 consequetive losses are hit. Also trying to reduce position size if previous trade lost and increase it when previous trade won. This code does not seem to be doing anything. My cumulative order is true. Any help would be great

    #155179

    I am not able to test it now, but code seems logically correct.

    What does “This code does not seem to be doing anything” mean? Doesn’t it open any trade? Doesn’t it increase/decrease position size?  Doesn’t it stop trading after 5 consecutive losses?

     

     

    #155180

    You don’t declare the starting value of positionsize so it is buying zero contracts.

    #155183

    The above code is calculating the positionsize.

    Its not doing anything means, with or without code the result is same. Its neither increasing or decreasing size . The TradeOn part to not trade after few losses does not do anything as well

    #155215

    The issue is at line 9, as you halve PositionSize, it will become less than the minimum size required, change it to:

     

Viewing 13 posts - 1 through 13 (of 13 total)

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