Ralph Vince’s Optimal F Positioning Sizing
Forums › ProRealTime English forum › ProBuilder support › Ralph Vince’s Optimal F Positioning Sizing
- This topic has 23 replies, 1 voice, and was last updated 1 year ago by Gianluca.
Tagged: money management, position size
-
-
09/27/2017 at 8:46 AM #4746309/27/2017 at 10:39 AM #47481
Well you won’t be able to use index notation and without the possibility to use indices there is no array. It is just a lot of variables.
For a small array this can be done (see the code of the meander bands) but it is impractical for larger arrays.
09/27/2017 at 10:48 AM #47482The If statements in the loop would kind of function as an index as there would be an If statement for each of the preset ‘array’ variables.
It is obviously going to be one heck of a long piece of code if you have for instance 50+ array variables 🙂
09/27/2017 at 11:34 AM #4749009/28/2017 at 9:47 AM #47616Long and slow.
and a long list of IF/THEN statements ..
09/28/2017 at 9:55 AM #4762004/15/2018 at 10:19 AM #6838606/14/2019 at 6:23 PM #100689Hi All,
I tried this code and it seems to be working (slowly but surely). Please double check it and make sure there are no errors:
1234567891011121314151617181920212223242526src=close-close[1]i=0f=0delta=0.1mem=0maxdd=lowest[period](src)while i<=1 dow=1for j=1 to period doppp=1for r=1 to j doppp=ppp*(1+(i*src[period-j]/maxdd))nextw=w*pppnextmem=wif mem>mem[1] thenf=iendifi=i+deltawendreturn f,01 user thanked author for this post.
09/02/2023 at 6:02 PM #220227123456789101112131415161718192021222324252627# Definire le variabiliCapital = 10000 # Il capitale inizialeRiskPerTrade = 0.01 # Il rischio massimo per operazioneStopLoss = 50 # Lo stop loss in puntiTakeProfit = 100 # Il take profit in puntiWinRate = 0.6 # La probabilità di successo# Calcolare il criterio di KellyKellyFraction = WinRate - (1 - WinRate) / (TakeProfit / StopLoss)KellyFraction = max(0, KellyFraction) # Assicurarsi che sia positivo# Calcolare la dimensione della posizionePositionSize = Capital * RiskPerTrade / StopLoss * KellyFraction# Aprire una posizione long se si verifica una condizioneif c1 thenbuy PositionSize contract at marketendif# Aprire una posizione short se si verifica una altra condizioneif c2 thensellshort PositionSize contract at marketendif# Chiudere la posizione con lo stop loss o il take profitset stop ploss StopLossset target pprofit TakeProfit -
AuthorPosts
Find exclusive trading pro-tools on