Hi,
Having fun demoing all the latest EA developments (Grid Dancer, RnR, etc). But given my time zone, I'm sleeping during early hours of London session when things really heat up and I'd like to be able to see what was happening with my margin levels during those times.
Is anyone aware of an indicator that graphs historical margin levels in a way similar to the way the great Trade Chart indicator plots out equity and balance levels? Could allow a good way to gauge how far we can push lot sizes.
I've searched this forum and internet and only found margin level alert indicators, but nothing that plots a history.
Thanks,
FF
Margin Level Plot indicator
- SteveHopwood
- Owner
- Posts: 9904
- Joined: Tue Nov 15, 2011 8:43 am
- Location: Misterton - an insignificant village in England. Very pleasant to live in.
Margin Level Plot indicator
You would think there would be something, wouldn't you?Foreverforex » Mon May 16, 2016 6:53 pm wrote:Hi,
Having fun demoing all the latest EA developments (Grid Dancer, RnR, etc). But given my time zone, I'm sleeping during early hours of London session when things really heat up and I'd like to be able to see what was happening with my margin levels during those times.
Is anyone aware of an indicator that graphs historical margin levels in a way similar to the way the great Trade Chart indicator plots out equity and balance levels? Could allow a good way to gauge how far we can push lot sizes.
I've searched this forum and internet and only found margin level alert indicators, but nothing that plots a history.
Thanks,
FF
Just adding my bit here in the hope that others might take notice because I have posted, and perhaps be able to help.
Read the effing manual, ok?
Afterprime is the official SHF broker. Read about them at https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?p=175790#p175790.
I still suffer from OCCD. Good thing, really.
Anyone here feeling generous? My paypal account is always in the market for a tiny donation. pianodoodler@hotmail.com is the account.
To see The Weekly Roundup of stuff you guys might have missed Click here
My special thanks to Thomas (tomele) for all the incredible work he does here.
Afterprime is the official SHF broker. Read about them at https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?p=175790#p175790.
I still suffer from OCCD. Good thing, really.
Anyone here feeling generous? My paypal account is always in the market for a tiny donation. pianodoodler@hotmail.com is the account.
To see The Weekly Roundup of stuff you guys might have missed Click here
My special thanks to Thomas (tomele) for all the incredible work he does here.
- renexxxx
- Trader
- Posts: 860
- Joined: Sat Dec 31, 2011 3:48 am
Margin Level Plot indicator
There are two ways to do this:Foreverforex » Tue May 17, 2016 4:53 am wrote:Is anyone aware of an indicator that graphs historical margin levels in a way similar to the way the great Trade Chart indicator plots out equity and balance levels? Could allow a good way to gauge how far we can push lot sizes.
1. The easy way is similar to how EquityBalancePlot now works: It stores a value for AccountBalance() and AccountEquity() in a binary file for every minute going forward, together with a datetime, and reads that file back to plot these values in a sub window. You can create a MarginLevelPlot the same way, by storing the AccountInfoDouble( ACCOUNT_MARGIN_LEVEL ) in the file. Problem is that you have to create your own history file, i.e. you can not see the historical data points from before you first started the indicator.
2. The hard way is of course how TradeChart works: it looks at the historical candles, works out which trades were open at those candles and uses the average price of that candle to see how much these trades were in a floating profit or loss. The smaller the time frame, the more accurate the figures. Similarly, it could work out the total (net) lot size that is open for a given candle and use that information together with the account leverage and the draw down for that candle to calculate an approximate margin level.
Hope this helps.
-
Foreverforex
- Trader
- Posts: 164
- Joined: Wed Nov 28, 2012 6:48 am
Margin Level Plot indicator
That all makes sense. I'd be happy with either version, however I'm not a coder. I've had some luck copying and pasting Steve's fixes into things, but this is beyond my scope.renexxxx » Mon May 16, 2016 6:14 pm wrote:
There are two ways to do this:
1. The easy way is similar to how EquityBalancePlot now works: It stores a value for AccountBalance() and AccountEquity() in a binary file for every minute going forward, together with a datetime, and reads that file back to plot these values in a sub window. You can create a MarginLevelPlot the same way, by storing the AccountInfoDouble( ACCOUNT_MARGIN_LEVEL ) in the file. Problem is that you have to create your own history file, i.e. you can not see the historical data points from before you first started the indicator.
2. The hard way is of course how TradeChart works: it looks at the historical candles, works out which trades were open at those candles and uses the average price of that candle to see how much these trades were in a floating profit or loss. The smaller the time frame, the more accurate the figures. Similarly, it could work out the total (net) lot size that is open for a given candle and use that information together with the account leverage and the draw down for that candle to calculate an approximate margin level.
Hope this helps.
If someone with the skills sees value in it, perhaps they'll take a stab at it. Thanks for laying out the logic of it!
- renexxxx
- Trader
- Posts: 860
- Joined: Sat Dec 31, 2011 3:48 am
Margin Level Plot indicator
The attached indicator is a literal translation of the EquityBalancePlot indicator, but it only plots your margin level. Note that if you have no trades open, your margin level is considered to be 0.0. Also, be aware that your margin level can fluctuate immensely depending on the number of open trades.
Similar to EquityBalancePlot it starts with an empty (history) file, so the best it can do is display a horizontal line at the current margin level. It is best put it on the M1 timeframe initially, in order to see some action. The file it creates (\MQL4\MarginLevel_<accntno>.bin) will continue to grow, for as long as you run the indicator. Therefore, on (re) initialization, it will purge the file and only keep the last DaysToKeep days worth of data.
Have fun.
Similar to EquityBalancePlot it starts with an empty (history) file, so the best it can do is display a horizontal line at the current margin level. It is best put it on the M1 timeframe initially, in order to see some action. The file it creates (\MQL4\MarginLevel_<accntno>.bin) will continue to grow, for as long as you run the indicator. Therefore, on (re) initialization, it will purge the file and only keep the last DaysToKeep days worth of data.
Have fun.
You do not have the required permissions to view the files attached to this post.
-
slimakterium
- Posts: 4
- Joined: Tue Apr 09, 2013 7:24 pm
Margin Level Plot indicator
René - merci beaucoup!
this is probably the one place in the whole World Wide Web where you can find this kind a useful tool : )
I will not say anything revealing: monitoring equity and margin levels for EA's it's like guarding pulse and blood pressure marathon runner (or in a patient, etc.)
thank You
(not sure for my english, lots of reading, less writing)
this is probably the one place in the whole World Wide Web where you can find this kind a useful tool : )
I will not say anything revealing: monitoring equity and margin levels for EA's it's like guarding pulse and blood pressure marathon runner (or in a patient, etc.)
thank You
(not sure for my english, lots of reading, less writing)
-
Foreverforex
- Trader
- Posts: 164
- Joined: Wed Nov 28, 2012 6:48 am
Margin Level Plot indicator
thanks, Rene!! will give it a go!
