Lot size calculation
Page 1 of 843 123 LastLast
Results 1 to 10 of 28

Thread: Lot size calculation

  1. #1
    Hello people,

    Hopefully someone can help me, I am coding an EA and I have some problems finding the correct algorithm to correct the lot size of a new trade to a predefined risk.

    What it is known:
    - Account equilibrium
    - Risk percent
    - Distance to prevent loss in pips

    What I need:
    - Resulting position size

    I'd like to mention that ea will also trade pairs that don't contain the account currency e.g. in my account is financed in Euros plus a trade is opened USDJPY.

    Thank you in advance!
    -

  2. #2
    Quote Originally Posted by ;
    search the forum for position sizing

    If you're so confident in loing the suitable code around here why didn't you place the link in the first place stating how you found it?

  3. #3
    Quote Originally Posted by ;
    If you are so confident in finding the proper code around here didn't you post the link in the first place stating how you discovered it?
    Smjones did it for you

    and you are so lazy and dont want to hurt your finger and search on it, we did so before several times

  4. #4
    Please do not take any crime.

    I have been looking for this forum and many others for days, searching for code for this to help me resolve a simular problem.

    I am quite thankful for the posting of this code.



    Thankyou for taking the time to place it.

  5. #5
    No difficulty at all, glad it can be of help.

  6. #6
    Inserted Code (AccountEquity()*(PercentAtRisk/100))/(MarketInfo(Symbol(),MODE_TICKVALUE)*StopLossPIPs) ;
    Same thing, just different way to write it

  7. #7
    Here is a URL to a post on fixed ratio ranking sizing that was developed by Ryan Jones. With this method, lot sizes are adjusted up/down predied on increases/decreases in your own equity.

    http://www.stator-afm.com/fixed-rati...on-sizing.html

  8. #8
    Yes Ryan Jones' egy is very good for futures trades, but IMO doesn't lend itself nicely to forex spot, because FOREX provides far more granularity than futures contracts. To me, this is a big incentive for spot trading. If a person appears in the formula above, it is clear , that the position size will grow or shrink in direct connection to the balance and also the equity, based on which can be used for the computation. The percentage of risk remains constant as the equity and balance grow and shrink.

    BTW. Ryan Jones has a very good book on Money management and risk called The Trading Game

    Chapter three deals with several kinds of currency management. If I recall Fixed ratio type is chapter 6 and I truly liked chapter nine on Market Weighting. Thanks for the reminder of Ryan jones' work. He's one of my favorite trading authors.

  9. #9
    Seems to me that the instrument traded is immaterial to this issue - lot size is adjusted up if your equity has gained sufficiently to pay the increase. What position sizing method do you believe is better than this?


    Quote Originally Posted by ;
    Yes Ryan Jones' approach is fantastic for futures contracts, but IMO does not lend itself well to Currency Market place, because FOREX offers far more granularity than futures contracts. To mepersonally, this is a big incentive for trading. If a person looks at the formula above, it is clear , that the position size will increase or shrink in direct connection to the balance or the equity, depending on which is used for the computation. The percent of risk stays constant as the equity and balance grow and shrink.

    BTW. Ryan Jones has a very good book on Money management and risk called The Trading Game

    Chapter three deals with several types of money management. If I recall Fixed ratio kind is chapter 6 and I really liked chapter eight on Market Weighting. Thank you for the reminder of Ryan jones' work. He's one of my favorite trading authors.

  10. #10
    Quote Originally Posted by ;
    here is the way I manage it.

    The algorithm is Lots = AccountBalance or Equity * Percentage To Risk / Stoploss in pips / Pipvalue
    Thanks a lot for the code snippet!

    -

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
This website uses cookies
We use cookies to store session information to facilitate remembering your login information, to allow you to save website preferences, to personalise content and ads, to provide social media features and to analyse our traffic. We also share information about your use of our site with our social media, advertising and analytics partners.