Position Sizing Logic - The rules for determining how large each trade should be (e.g. number of lots or volume). Position sizing logic is a subset of money management: it might use fixed lots, fixed fractional risk, martingale (doubling after a loss), or other algorithms. Correct position sizing is crucial – as Investopedia notes, “the single most important factor… is the size of the position you take” and position sizing “will account for the quickest and most magnified returns”.
-
Definition: Calculation of trade volume (lot size) based on strategy parameters, account equity, or risk per trade. For example, a bot might use “2% of equity per trade” or “fixed 0.1 lots.”
-
Context: Usually coded by reading account information (balance or equity) and dividing by required margin or risk. In MQL one might use
AccountBalance()orAccountFreeMargin(), in cAlgoAccount.Equity, and in NinjaScriptAccount.GetAccountValue(). The logic applies whichever money-management rule the EA specifies. -
Example Code:
These examples show different sizing approaches. Note that CFI’s tutorial mentions position size “determined according to risk appetite”, underscoring that sizing logic should match the trader’s risk tolerance.