Dynamic Position size
Forums › ProRealTime English forum › ProOrder support › Dynamic Position size
- This topic has 8 replies, 3 voices, and was last updated 7 years ago by AutoStrategist.
Tagged: money management, position size
-
-
11/25/2017 at 2:59 AM #53880
Having built many systems that use a flat contract size ive now started to look at building systems that remain fully invested and have hit a stumbling block . So far i have come up with what i think is the correct code to acheive this but i need some help identifying the right terms that PRT will identify
My code thus far would look like this//automated contract number
n = INITIALCAPITAL/close
w = STRATEGYPROFIT
c = Close x = n + w/c‘x’ will be the number of shares/contracts traded . Strategyprofit is recognized fine but i am yet to find the correct term for initial capital thats identified correctly by PRT
Appreciate any help Regards and thanks Pete
11/25/2017 at 3:03 AM #538811x = TOTALEQUITY/close1The other alternative is to make x = TOTALEQUITY/close but once again im struggling to find the term that PRT uses . I’d prefer to use the first code sample if possible but either way id love to know the terms for both initialcapital and totalequity
1 user thanked author for this post.
11/25/2017 at 3:10 AM #53882Sorry how messy this all looks , please forgive me as im new to posting code in here .. ThanksHaving built many systems that use a flat contract size ive now started to look at building systems that remain fully invested and have hit a stumbling block . So far i have come up with what i think is the correct code to acheive this but i need some help identifying the right terms that PRT will identify My code thus far would look like this //automated contract number n = INITIALCAPITAL/close w = STRATEGYPROFIT c = Close x = n + w/c ‘x’ will be the number of shares/contracts traded . Strategyprofit is recognized fine but i am yet to find the correct term for initial capital thats identified correctly by PRT Appreciate any help Regards and thanks Pete
auto contract number123456789//automated contract numbern = INITIALCAPITAL/closew = STRATEGYPROFITc = Closex = n + w/c11/25/2017 at 1:01 PM #53918I must be missing something. If your variable INITIALCAPITAL is what it seems to be i.e. your initial starting capital then you know that number so you can just assign it to the variable e.g. INITIALCAPITAL = 5000?
11/25/2017 at 1:07 PM #53919I must be missing something. If your variable INITIALCAPITAL is what it seems to be i.e. your initial starting capital then you know that number so you can just assign it to the variable e.g. INITIALCAPITAL = 5000?
I realise that and thats what i have been doing but due to the fact i do a lot of testing and use a lot of different testing on varying %ages of capital Id like something that does the job ‘ automatically ‘ if possible . Thanks for pointing out what i already knew …
11/25/2017 at 6:32 PM #53949Hi
Please find a code for position sizing for 1% risk of initial and 3% of risk of market money (=strategyprofit)
123456equity=10000+3*STRATEGYPROFITrisk=0.01TF=4DailyRange=max(abs(Dhigh(1)-Dlow(1)),max(abs(Dhigh(1)-Dclose(2)),abs(Dlow(1)-Dclose(2))))DailyATR=wilderaverage[20*TF](DailyRange)PositionSize = round((equity*risk)/(DailyATR*pointvalue))There is an interesting book on position sizing
Van Tharp’s : Defenitive guide to position sizing
4 users thanked author for this post.
11/25/2017 at 8:29 PM #53960If you want to manage % stop loss of position with 1% of your equity risk
123456equity=10000+3*STRATEGYPROFITrisk=0.01strategyrisk= 2 //percentPositionSize = round((equity*risk)/(close*pointvalue*strategyrisk/100))set stop %loss strategyrisk11/26/2017 at 4:08 AM #5397511/26/2017 at 11:04 AM #53991Hi Yannick, the first example from Van Tharp looks great, the second one doesn’t look right to me for setting the stop loss. If the intention is to place the stop loss to allow no more than 2% of your equity to be at risk then it should be based on 2% of the equity in a similar way to the way the position size is calculated. The attachments show 2 very different outcomes for 2 ways of setting the stop loss and you can see that %ploss is related to the size of the total position size, the HS is at about 29000 currently so 29000/50 = 580 is about the level of stop loss being set.
-
AuthorPosts
Find exclusive trading pro-tools on