Position Sizing

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #16263 quote
    volpiemanuelevolpiemanuele
    Participant
    Veteran

    EUR/USD mini

    Valore di un pip 1 eur

    Pipsize 0.0001

    Margine richiesto 50 euro (piattaforma IG)

    Vorrei creare un modo che mi calcoli la posizione (minimo sempre 1 e a crescere) ogni volta che la strategia guadagna un importo pari al margine richiesto. Ad esempio al tempo zero inizio con un capitale di 1000 euro. All’inizio compro 1 lotto. Se dopo x giorni guadagno 50 euro (capitale 1000+50) aggiungo un lotto e quindi passo a 2…se dopo x giorni il mio capitale si incrementa ancora e arrivo a 1100 compro 3 lotti…se dopo x giorni torno a 1050 compro 2 lotti…etc. etc. Se capitale risultasse inferiore a 1000 compro sempre un lotto fino a che c’e’ il capitale ovviamente.

    Ho trovato questa nel forum ma non funziona secondo me. E’ corretta ? Come devo modificarla ? Grazie

    REM Money Management
    Capital = 1000 
    Risk = 0.01 
    StopLoss = 10 // Could be our variable X
    
    REM Calculate contracts
    equity = Capital + StrategyProfit
    maxrisk = round(equity*Risk)
    PositionSize = abs(round((maxrisk/StopLoss)/PointValue)*pipsize)
    #16264 quote
    ALEALE
    Moderator
    Master

    Ciao

    io ho trovato questa, ma non ho una strategia adeguata per testarla. Prova a vedere se riesci ad adattarla alle tue esigenze:

    PositionSize = max(1,1+ROUND((strategyprofit-1000)/50))
    #16272 quote
    volpiemanuelevolpiemanuele
    Participant
    Veteran

    Grazie,

    dovrebbe funzionare cosi’ inserendo anche uno stop ai lotti max:

    Margin = 50

    PositionSize = max(1,1+ROUND(strategyprofit/Margin))
    if positionsize >=10 then
    Positionsize=10
    endif

    #16274 quote
    ALEALE
    Moderator
    Master

    Ottimo!

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.
ProRealAI ProRealAI New

Stuck on this ProBuilder code?

Describe what this topic is trying to build, in plain English, and ProRealAI writes the ProRealTime™ indicator, screener or system for you.

Available in 7 languages
Try ProRealAI

Position Sizing


ProOrder: Trading Automatico & Backtesting

New Reply
Author
Summary

This topic contains 3 replies,
has 2 voices, and was last updated by ALEALE
9 years, 10 months ago.

Topic Details
Forum: ProOrder: Trading Automatico & Backtesting
Language: Italian
Started: 11/09/2016
Status: Active
Attachments: No files
ProRealCode ProRealCode
Loading...