View Single Post
  #340 (permalink)  
Old 04-22-2007, 04:14 AM
daraknor's Avatar
daraknor daraknor is offline
Senior Member
 
Join Date: Oct 2006
Location: Portland, OR USA
Posts: 996
daraknor is on a distinguished road
Real Dollars At Risk for Lot Size

I have an idea for lot management, and I haven't seen it elsewhere. If anyone knows of code that does this, I'd love to see it and possibly reuse it. I'm working on this because it is too easy to destroy an account using common methods for lot sizing by simply choosing too many currency pairs.

The "risk" of a trade has nothing to do at all with the margin or balance, but we give it that name and appearance in the EA.

The "risk" of a trade is the amount of money on the table, not the amount of margin on the table. Let's say I'm willing to loose $500 on a single trade. How do I calculate lot sizes for that? How do I determine the SL level? If we have SL, we assign lots based on $/pip*SL*lot=risk. If (user) risk is $500 and SL is 50 pips and the $/pip = $10 then we know lot=1. Now we have a bit of an issue, because the lotsize determines the $/pip. If $/pip=1, then we would have 10 lots which then makes each pip worth $10. It is a circular situation, and what we really need is dollars per pip per lot or $/pip/lot=10 or we phrase the entire thing in the basic unit, the pip.

Instead of saying how many $ we risk, we can choose how many pips we risk, in full lot sizes. This also removes the need to calculate how much each pip would be worth. If I'm willing to risk 100 "full lot pips" on a trade (or $1000 on EURUSD), and the SL is 50, then that would mean I'm willing to risk 2 lots. That becomes $20 per pip. With a SL of 50 and $20 per pip, that is $1000. Since pips are usually about $10 per trade, this isn't that strange. However, some currencies like USDMXN or USDNOK get a little strange on the math. GBPJPY is also strange on the math, and the conversion would need to be known.

So we have two options. #1 Recalculate the $ per pip per full lot, and then convert the math over to determine lotsize. #2 Determine the lot size purely from SL and max pips lost. Unfortunately, expressing things in pips might become confusing and for all currency pairs where the second currency is not USD the pip math gets confusing for the user.

Now, there is another issue. Margin. We need the FreeMargin to stay open. Using the current system (FreeMargin/ multiplier_for_sanity* some_number_which_pretends_to_be_risk) we have free margin open, but a long term trade could easily destroy the account even with small lotsize. (1000 pips SL) If we are doing $ at risk per trade, then the FreeMargin needs to stay open, but we *know* mathematically that the account won't go bust. If we have a minimum margin value preserved in dollars, then we would avoid the bottom line. Unfortunately, this isn't compatible with the way brokers do the math. They calculate margin by %. Many brokers will start closing trades at around 50% or 75%. I have never heard of a trader on here recommending risking more than a small % of the overall account per trade. I would think that the FreeMargin% should always stay above 100% (In other words, fully leveraged but I would only use this math if we're calculating the maximum risk in real dollars per trade.)

Unfortunately there isn't a direct simple calculation we can do to predict the total margin potential. We could have a fixed ($$) or dynamic (% of All $$) system that is protected from loss in trade.

Ultimately the system for risk allocation should be safe for multiple systems to trade with.
Reply With Quote