autofx
Private, 1st Class
- Messages
- 28
Egros,
The lot size management is a little different. If the default method is not suitable for you, you can change it to use a fixed lot size of your choosing. You would do that by going to the bottom of the MQ4 file in the CalcLotSize function. Find the following two lines
lots = StrToDouble(DoubleToStr(lots, LotDigits));
LotsTooSmall = false;
and insert a new line between the two lines that looks like this
lots = 1.0;
or whatever value you wish.
Your end result would look something like this:
lots = StrToDouble(DoubleToStr(lots, LotDigits));
lots = 1.0;
LotsTooSmall = false;
Don't to forget to save and hit F5 to compile the EA into a new EX4.
You can also NOT do the above and fool around with the MaxMarginToUse setting, which has a default value of 0.10. And of course you could use the EA as-is.
Another important setting is MinMarginLevel. The default is 500, which represents the margin level percent below which more orders will not be opened.
Some people may know this, but margin level as seen on the trade tab of the MetaTrader platform is calculated as follows:
100.0 * (AccountEquity() / AccountMargin())
It is the margin you are using in proportion to your equity. This is 101 stuff for many but I thought I'd mention it.
Note that I claim no intellectual property rights on this EA. I simply modified the one presented already on this thread.
This one looks very compelling, so I'll go into the "share with the fx community" mode and collaborate with others who want to have the best version of this trading approach in an EA.
The lot size management is a little different. If the default method is not suitable for you, you can change it to use a fixed lot size of your choosing. You would do that by going to the bottom of the MQ4 file in the CalcLotSize function. Find the following two lines
lots = StrToDouble(DoubleToStr(lots, LotDigits));
LotsTooSmall = false;
and insert a new line between the two lines that looks like this
lots = 1.0;
or whatever value you wish.
Your end result would look something like this:
lots = StrToDouble(DoubleToStr(lots, LotDigits));
lots = 1.0;
LotsTooSmall = false;
Don't to forget to save and hit F5 to compile the EA into a new EX4.
You can also NOT do the above and fool around with the MaxMarginToUse setting, which has a default value of 0.10. And of course you could use the EA as-is.
Another important setting is MinMarginLevel. The default is 500, which represents the margin level percent below which more orders will not be opened.
Some people may know this, but margin level as seen on the trade tab of the MetaTrader platform is calculated as follows:
100.0 * (AccountEquity() / AccountMargin())
It is the margin you are using in proportion to your equity. This is 101 stuff for many but I thought I'd mention it.
Note that I claim no intellectual property rights on this EA. I simply modified the one presented already on this thread.
This one looks very compelling, so I'll go into the "share with the fx community" mode and collaborate with others who want to have the best version of this trading approach in an EA.
Attachments
Last edited: