| stevehopwoodforex.com https://www.stevehopwoodforex.com/phpBB3/ Print view |
|
| Account Balance and Account Equity https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?t=3903 |
Page 1 of 1 |
| Author: | renexxxx [ Fri Oct 31, 2014 2:43 am ] |
| Post subject: | Account Balance and Account Equity |
This topic is a result of a request by Pedigree, posted on the TradeReport thread. The request was to work out the account equity at a given date/time. As you know, the equity is defined as "The value of an account, if all positions were closed". So, the equity at a certain (historical) date, equals to the balance + the floating (unrealised) profit/loss of the open trades, at that date. I have written some code (attached) to work out these figures. The accountBalance() function seems to be pretty accurate, but I get some weird results for the accountEquity() function. I don't know, if these weird results are due to a bug or incomplete/inaccurate price feed data. So, may be someone else can have a look. For the code to work, the account history has to include "All History". This is set automatically by the code. |
|
| Author: | Pedigree [ Tue Nov 04, 2014 8:26 am ] |
| Post subject: | Account Balance and Account Equity |
Attached is a modification of iProfitTracker indi I made. It logs the equity (and balance) at the start of each day in a csv file and will calculate and display a commentary at the bottom that shows the %change for standard periods when enough data has accumulated. It does not base %change calculations directly on accrued profits, so it fulfils the purpose of giving a more accurate picture in hedge situations. It also has the option to use Equity instead of Balance for its other calculations and will give alerts when DD falls below a set level. It must be borne in mind that the dashboard equity does not include swaps and commissions that may have accrued for open trades and so it may not be deadly accurate if this is the case. But it is the only stat that will ALWAYS reflect equity correctly, particularly on hedge release. It needs to be attached to an M1 chart that must remain open at 00 Hrs (broker time) each trading day for it to do its thing. You will need one such chart for each different account. It cannot look-back in time but will accumulate data going forwards. The added options are straightforward enough, so you can just run it OOTB. The key option is the eiPercent for switching periods. 1 is for daily 2 for weekly 3 for monthly 4 for quarterly 5 for yearly. Cheers |
|
| Author: | Pedigree [ Sun Nov 16, 2014 7:23 pm ] |
| Post subject: | Account Balance and Account Equity |
Attached is iEquityTracker, an update to iProfitTracker_EquityLogger. It corrects one or two bloops in the latter and now in addition, will close all trades if equity falls below a set amount. Needless to say it is now an EA. All original functions of iProfitTracker are preserved. Much appreciation to its writer and to Kwanann for sections of the code. As before, remember to set Time Frame to M1. Options are intuitive enough. PulsePeriod (in seconds) is how far apart to set the ticks received. 1 means 1 tick only per second, 2 means 1 tick only every 2 seconds and so on. Default is 0 because setting it to anything other than 0 may interfere with equity logging. If logging is not required however, you may set it as required to conserve CPU use. MinuteAllowance is the period (in seconds) allotted for logging to take place at the start of the day. Default is 60. Usually logging will occur within the first 15 to 20 seconds. RecentDaysLastLog is the number of days back to check for a recent log. Remember, it goes in your MQL/Experts folder. Have a great week! |
|
| Author: | Pedigree [ Wed Nov 19, 2014 6:36 pm ] |
| Post subject: | Account Balance and Account Equity |
For the few who downloaded the last update, please note that a re-download will be well worth it for a few adjustments that have taken place. This then is the final version of the EA…….promise!!!! |
|
| All times are UTC | Page 1 of 1 |
|
Powered by phpBB® Forum Software © phpBB Limited |
|