I mentioned previously that I'd made some minor modifications but I never told you what, so here's the change I made so that my trade size is linked to my account equity by the lots setting instead of being a fixed proportion.
/* KB double lot = MathMax(NormalizeDouble(0.00001*AccountEquity(),2),MarketInfo(Symbol(),MODE_MINLOT));*/ double lot = MathMax(NormalizeDouble(lots/100*AccountEquity(),1),MarketInfo(Symbol(),MODE_MINLOT));
I've noticed that usually (but not always) trades are opened at 16:00 UK time (18:00 Server time) and close when the markets open for the following day having generated overnight SWAP. I'm not much of a programmer but if the trade is long and going to close at the next day's open, I would like it to close at the end of the current day. Is there a setting or a section of the code I can change to achieve this?
I will work it out to make it close at 30 seconds before the close of the day.
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
I mentioned previously that I'd made some minor modifications but I never told you what, so here's the change I made so that my trade size is linked to my account equity by the lots setting instead of being a fixed proportion.
/* KB double lot = MathMax(NormalizeDouble(0.00001*AccountEquity(),2),MarketInfo(Symbol(),MODE_MINLOT));*/
double lot = MathMax(NormalizeDouble(lots/100*AccountEquity(),1),MarketInfo(Symbol(),MODE_MINLOT));
I've noticed that usually (but not always) trades are opened at 16:00 UK time (18:00 Server time) and close when the markets open for the following day having generated overnight SWAP. I'm not much of a programmer but if the trade is long and going to close at the next day's open, I would like it to close at the end of the current day. Is there a setting or a section of the code I can change to achieve this?
I will work it out to make it close at 30 seconds before the close of the day.
You can use
I will work it out to make it close at 30 seconds before the close of the day.
You can use
Also i will send the updated version that addresses all issues and bugs here when i am through with it.
When testing it on my real account , i discovered some new improvement needed to be made to the code to enhance it profitability.