Lots Calculator and Risk

 

For the benefit of forum members I have attached a spread sheet that calculates how many lots you can trade for a given stop loss and a given %risk factor of your equity.

Use the green squares to make your entries in the spread sheet.

Here is an example: Let's say you want to trade the EUR/USD pair. Assume a 2 pip spread. After looking at the volatility of the market via ATR, you determine that a good stop loss would be 30 pips away from entry.

In the Dollars Per Pip per One Standard Lot square you have 10.00. In the Equity Balance you have 10,000.00. In the Stop Loss Pips you place 30. Pip Spread is 2 for the EUR/USD pair. Per Centage Risk of Equity Balance you have 1%. (Recommended).

The spread sheet spits out the dollar risk amount for the trade and the number of lots you can trade: .31 lots, rounded off.

You can use this lot calculator ahead of time to know how many lots to trade, or you can incorporate this into the code of your EA. The two critical extern inputs you put in would be the %risk and the stop loss.

Using this worksheet calculator, you can see if you vary the stop loss and keep the %risk factor the same, the absolute dollar risk remains constant but the lot size changes.

If you are afraid to be stopped out and put in 100 pips look at how many lots you can trade-- about .1 lots. You might think this is good because it gives you a big breathing space with the same amount of risk factor. But this could be bad because with at least a 2 to 1 reward/risk ratio (necessary to generate a good expectation value) your winning trade would have to move 200 pips!

Using this calculator you can experiment with the right combinaton to get the best expectation value depending on the volatility of the market and the reward/risk ratio you think is possible.

Files:
 

interestng!!!

loaded

i'll try.


thanks ^____^

 
forestmyopia:

For the benefit of forum members I have attached a spread sheet that calculates how many lots you can trade for a given stop loss and a given %risk factor of your equity.


It only works for xxxUSD pairs though . . .
 
RaptorUK:
It only works for xxxUSD pairs though . . .


Not sure that is true. Take the USD/JPY for example or any pair for that matter. The critical factor is Dollars per Pip per One Standard Lot. At this time the current USD/JPY rate is 80.25 rounded off. Now I go to my broker's website with that information and determine on their calculator that the dollars per pip is 12.46. I plug that value in, and the lots value is calculated as follows: Starting from Dollars per Pip per One Standard Lot I put in the following values: 12.46,10000,30,3, and 1%. This gives me a dollar risk of 100.00 and the lots to use is .243 lots.

Now if the trade moves against me 30 pips and the spread is 3 pips, that gives me 33 pips. The dollar per pip per 1 lot is 12.46. I have .243 lots. Now, I calculate 33 x 12.46 x .243 = 99.91 dollars. That's close enough for me to the dollar risk of 100.00.

 
forestmyopia:


Not sure that is true. Take the USD/JPY for example or any pair for that matter. The critical factor is Dollars per Pip per One Standard Lot.

Yep, sorry, thought that field was a constant.
 
forestmyopia:

You can use this lot calculator ahead of time to know how many lots to trade, or you can incorporate this into the code of your EA. The two critical extern inputs you put in would be the %risk and the stop loss.

One additional critical extern variable would be the dollars per pip per 1 lot. I'm not sure that MQL4 has the capability of calculating this info. I think it depends on your broker. Not sure.
 
forestmyopia:
One additional critical extern variable would be the dollars per pip per 1 lot. I'm not sure that MQL4 has the capability of calculating this info. I think it depends on your broker. Not sure.
Sure it does. See my code
 
tniazi:

For trading and volume you can use the Trader's Forex Calculator (https://alpari.com/en/trading/calculator). It will give you a complete idea of using lots and how much % of your capital you can risk and the return on investment.


Or if you want the easy option you can use my 3-click risk calc indicator. 

 
  1. In code: Risk depends on your initial stop loss, lot size, and the value of the pair.
    • You place the stop where it needs to be - where the reason for the trade is no longer valid. E.g. trading a support bounce the stop goes below the support.
    • Account Balance * percent/100 = RISK = OrderLots * (|OrderOpenPrice - OrderStopLoss| * DeltaPerLot + CommissionPerLot) (Note OOP-OSL includes the SPREAD, and DeltaPerLot is usually around $10/pip but it takes account of the exchange rates of the pair vs. your account currency.)
    • Do NOT use TickValue by itself - DeltaPerLot
    • You must normalize lots properly and check against min and max.
    • You must also check FreeMargin to avoid stop out
    Most pairs are worth about $10 per PIP. A $5 risk with a (very small) 5 PIP SL is $5/$10/5=0.1 Lots maximum.
  2. Use a EA GUI such as the one for MT4: Indicators: 'Money Manager Graphic Tool' indicator by 'takycard' Forum - Page 5
 
nicholi shen:

Or if you want the easy option you can use my 3-click risk calc indicator. 

Absolutely cool indicator, thanks!

However, I would fix two things, if I had the source:

1. Label to show decimal risk percent (now shows minimum 1%, though calculates properly).

2. On triple-click deletes levels but does not reset the GV's, so the subwindow still shows as if the levels were still there. To reset we must either switch Tf's or reopen the indicator.

3. Add MarginRequired for the calculated position size.

If you could fix those issues, please?

Reason: