This has been on my TO DO list for a while, but I gave it high priority after this faux pas. I spent a day working out how to autocalculate my trade risk based on recent trade history, and from that the position size based on my account balance and risk for the trade. Here’s a screenshot of my New Trade screen in Moo DB with the new position sizer integrated.
This is what Moo DB is doing in the background:
- Goes to the market and gets latest bid/ask prices from FXCM (when the markets are open). These prices get stored in the database.
- Fills in the Entry Price field from the latest price in the database.
- Reads the currency pair (symbol) and account selected from the screen.
- Retrieves the default Risk Profile. I am using a 3% descending risk profile from the MAX account nanny formula. I have configured 10 different risk profiles, but am using just the 3% one at the moment.
- Fills in the % Acct. Risk field from the account nanny formula depending on whether the last completed trade was a winner or loser. If it was a loser, then it works out how many losers have happened in a row and populates the field accordingly.
- Goes to the database and gets the latest account balance for the account selected, then works out the position size based on the currency pair, account balance, % account to risk and stop loss size in pips. Stop loss size is calculated from the Entry Price and Stop Price fields.
Hopefully this will keep me out of any sticky situations in future.








