Position size relative to account size

Forums ProRealTime English forum ProOrder support Position size relative to account size

Viewing 15 posts - 1 through 15 (of 16 total)
  • #232331

    Hi you all good programers.

    I want to buy n contracts that will require x % of my account in security.

    As every trade will change my account up/down then I still want next trade to require X % of that new account size as security.

    By doing this I hopefully get my account growing even faster😁

    #232335

    PS: I meant if anyone on this forum can help me to code that I described above  ;>)

    #232336

    That is not possible with PRT because the total account size (or gain in it) is not available to the program code. Sorry …

    #232337

    buy n contracts that will require x % of my account

    Could work if use  xamount allocated to any particular Algo then use strategyprofit (after each trade) to increase or decrease this xamount accordingly.

    #232338

    Hi

    I’ve got this far but I want to take it a step further but I need some help!!

     

    STARTINGCAPITAL = 1000 //1k €
    SIZE = 1 / STARTINGCAPITAL //divide your initial contract size by startingcapital
    CAPITAL = STARTINGCAPITAL + STRATEGYPROFIT //current capital
    K = CAPITAL * SIZE //calculate position size
    positionsize=K

    #232339

    Could work if use  xamount allocated to any particular Algo then use strategyprofit (after each trade) to increase or decrease this xamount accordingly.

    Plus a lot of coffee to restart each of those algos at the moment it finishes a trade, put the new total accumulated value in that xamount variable and …

    Can’t work.
    Better buy and sell coffee and have it too ? … that also can’t work. 🙂

     

    #232340

    There are codes on here that do what I suggest … no stopping of Algo required.

    A coding wizard may be along shortly as I’m off out to play tennis, but also low on coffee! 😀

    #232341

    Hi,

    Assuming you’re not trying to find a way around getting access to other codes gains/losses to include in contracts size calculation (can’t see any to this day), then when using only gains/losses of considered code, maybe Roberto’s lines 1-16 in following post might be what you’re after?

    https://www.prorealcode.com/topic/reinvestissement-des-gains/#post-199841

    #232342

    Anyway what Instrument are you trading OMXet?

    All my codes buy x Contracts not a cash amount so surely you need, for example, 0.2 £1 Contracts on DJI = £8K.

    Or do you want code working at required margin cost (not full contract price)?

    Few things to think about before a kind helpful coder spots this thread.

    #232346

    Hi

    I trade NASDAQ Tech100.

    My intention was to trade each trade at a level X contracts that will require 50% of my account for security. That will generate a nice leverage. I have done that manually this year and it has really worked nice ;>))) As some days I hit 0.5% movement then it generats 5 % to my account!

    All of your answers are of interest but somehow I feel you don’t quite understand what I mean. Or maybe I’m just not good enough for programming = I’ll have to stick to the manuel trading.

    #232347

    Is it corect to say that you autotrade using 1 System / Algo only and therefore your Acount balance does not to be split across > 1 Algo?

    #232348

    Hi GraHal

     

    Yep, my mistake. I obviously took that for granted. I have two accounts at IG, one for autotrading/only 1 algo, and the second for manual trading.

    BTW: This year algo going down and manuel +xxx%  ;>))….e.i. much work/time spent but rewarding

    #232349

    A few more thoughts …

     

    #232519

    Ther is no way to use you total account, but you can use the command stratergyprofit so incresee your positions. I made a code for just this some time ago 🙂

    IF STRATEGYPROFIT[1] < 100 THEN
    XX = 10
    ELSE
    XX = ROUND(STRATEGYPROFIT[1] / 100)
    ENDIF

    IF XX < 10 THEN
    XX = 10
    ENDIF

    XX is number off contract and 100 is the amount off profit needed before it adds to XX, and do so by devide the total profit and round it to closes even number.

    I trade on IG markets and in this case 100$ is just over the margin i need for 1 contract.

     

    #237734

    A while back I wanted a MM method that was more risk based, and if you ask me I ended up with this smart little script 😉

    The thesis was that I only wanted to risk 1% of portfolio per trade, (if account is not too small and minimum trading size makes the risk higher). So based on my StopLoss, the script decide position size…

    and when position size is bigger than 10 contract, I stick to full contracts.

    enjoy!

     

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

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