所有我们编程一般采用三种类型的资金管理的中介公司的. 我真的不喜欢这个词, 虽然. 我相信 位置上浆配方 一般比较准确的.
选项有:
- 固定的土地面积
- 使用可用保证金的百分比
- 失去了账户余额的一定比例,只要止损被打.
MetaTrader的大多数用户都习惯使用固定的地段在其 外汇理财. 这是遥遥领先于商业智能交易中最常见的方法. 如果你看过的任何影片在本网站或口头与我, 你知道,我一般有大多数商业的EA低意见. 正因为每个人都并不意味着它是一个好主意!
每当客户订单提到使用风险输入到控制批量为他们理财的想法, 它通常意味着使用的可用余裕的选定百分比. 说, 例如, 你一交易 $10,000 账户上 1% 余量 (100:1 杠杆作用) 并希望使用 2% 在任何给定的交易可用保证金. 如果你没有仓位, 然后使用该余量是 $10,000 * 2% = $200.
批量大小是下式的结果:
很多=保证金使用 / 保证金要求每标准手
回到我们的例子, 您只需插上数字:
$200 / $1000 每标准手 (100:1 余量) = 0.2 很多, 这是 2 迷你手.
这样做的MQL4代码是
double lots = (AccountFreeMargin() * Risk) / MarketInfo( Symbol(), MODE_MARGINREQUIRED);
这种方法的优点是很多的大小保持一致,禁止在可用保证金戏剧性的变化. 我真的不认为这是一个优势, 但很多交易员就像看到大多数行业一样不少大小.
缺点是很多. 如果你喜欢高杠杆和交易很多不同的乐器交易, 您可以轻松地让自己成为一个补仓. 如果你的战略要求将停止基于价格行为, 丢失的量将取决于其中的停止被放置而变化. 有些行业可能会失去 $20 而另一些人丢 $100.
double lots = Risk * AccountEquity() / MarketInfo(Symbol(), MODE_TICKVALUE) / Stop;
我最喜欢的 外汇资金管理方式 是选择我的基于股权损失很多的大小,如果我停止打. 如果我冒险 0.5% 在 $10,000 占我的止损 20 PIPS走, 那么所需的很多大小
很多= 0.5% * $10,000 / $10 每标准手滴答 / 20 点子= 0.25 很多, 或 2.5 迷你 很多
该地块面积减小每当止损距离增加, 反之亦然. 一 60 点子止损将需要大量的大小
很多= 0.5% * $10,000 / $10 每标准手滴答 / 60 点子= 0.083 很多, 或 0.8 微 地段占四舍五入后.
在许多不同大小的驱动器多数贸易商疯狂. 我相信这样的理由忽略的交易逻辑. 交易是一个统计的结果, 事件的分布,即理论上返回大于零的净结果更大. 我们称这个利润在日常生活中.
如果你的交易系统为x%的准确率,你知道利润因子大于 1, 为什么地球上一个交易者随意将赌注押在每个行业不同的美元金额是超越我. 效果比随机选择赌没有什么不同 $10 在此交易,并 $100 上的下一个. 随机, 选择位置的系统,较少的钱管理大小为你的交易系统会压倒不错, 均匀分布,你从预期的信号.
mperk 说
你好,
我的问题是,我需要计算很多大小基于使用保证金设置百分比. 原因是,我贸易 12 货币对回收系统. 我有困难的时候向后, 由于某种原因。与以下输入如何是很多的大小基于设置百分比计算的使用保证金:
标准很多 = 100,000
杠杆率 = 50
考虑股本 = $10,000
使用保证金风险每笔交易最大 = 5% = $500
澳元兑美元 = $10.00
停止损失 = 20 点子= $200
很多大小 = ???
谢谢
肖恩·奥弗顿 说
谢谢你的问题. 很多大小是
可用的保证金 * 杠杆作用
$500 * 50 = 25,000 单位, 或 2.5 迷你手 (0.25 很多在 MetaTrader 的标准表示法).
swiz 说
你好,
你可以像这样写毫米吗:
风险 = 5 手段停止损失 = 5% 账户余额
谢谢
肖恩·奥弗顿 说
嗨 swiz,
是的, 这是可能做到. 你问我具体的东西吗? 我有种感觉,也许我没有听懂你的意思.
弥尔顿彭 说
do you recall John Burch from forex-tools-cafe.com? 他创造了买主 v4,翻看高高、 低和设置那些作为 sl 和贸易贸易给很多大量的头寸规模. 我认为他可能的传递,但他的网站仍然存在,该软件售价为酷 $18 美元.
顺便说一句你的激情,你宁愿做传染性.
米尔特
肖恩·奥弗顿 说
谢谢, 弥尔顿!
Thomas 吴 说
谈论这条线: “我最喜欢的外汇资金管理方法是选择基于股权损失,如果我停止被命中我很多大小。” 你如何形容它在 MQL4 虽然?
感谢肖恩….希望你不要介意共享代码
PS 你有好的 EA 但这是很不幸,你只能打开一个 MAM 或 PAMM 帐户
肖恩·奥弗顿 说
谢谢, Thomas. 代码已经处于不同的字体的文章. 请再检查一下.
David 说
嗨肖恩,
I’m trying to figure out how to calculate below figures with a ratio of $500:0.01micro lot
Account Balance = $500
杠杆率 = 200
风险 % = 10
can you please give me a formula with every $500 增加, lot size increase by 0.01 micro lot?
肖恩·奥弗顿 说
嗨 David,
Thanks for asking. You’re making it more complicated than it needs to be. Leverage and risk are extraneous variables for the equation that you’ve proposed.
The formula is:
$500 (账户权益) * 0.01 很多 / $500 = 0.01 很多.
If your account equity grew to $1,200, the formula gives you:
$1,200 * 0.01 很多 / $500 = 0.02 很多 (I rounded down).
I hope that helps.
MOHAMMED 说
Well is educative
肖恩·奥弗顿 说
I’m glad you learned something.
Sam Trinston 说
Your formula (and weakness in MT4) is that one alwats needs to calculate LOTS – which doesn’t help when trading a multi-instrument portfolio. 例如 1 lot of EURUSD isn’t the same as 1 lot of GBPJPY – 就是说, they expose different quantities of USD$ to the market. So if you are looking to create a system that ensures you expose USD$x then the formula becomes a lot more complex
肖恩·奥弗顿 说
其实, that’s not the true. The formulae provided use MarketInfo, which returns the values in terms of the account currency. It already compensates for multiple instruments and currencies.
regani 说
thankq .. more use ful infomormation.. use full to me thankqs
肖恩·奥弗顿 说
I appreciate you letting me know. It’s feedback like that that keeps me going.
Andrea 说
i try your formula
很多= 0.5% * $10,000 / $10 每标准手滴答 / 20 点子= 0.25 很多, 或 2.5 迷你手
but if i calculate it
0.5*10.000/10/20 = 25 不 0.25
it’s wrong, how i can correct?
肖恩·奥弗顿 说
0.5% needs to be 0.005.
Philipp 说
Hallo Herr Shaun Overton,
ich habe auch ein Problem. Vielleicht könnten sie mir beim Code helfen:
Gehandelt wird auf der Dax.
Long Trade: 3% Risiko pro Trade – Position sollte auf 0,10lot auf / abgerundet werden. SL ist -15Pips
Short Trade: 4% Risiko pro Trade – Position sollte auf 0,10lot auf / abgerundet werden. SL ist -20 点子.
Danke für Ihre Hilfe!
肖恩·奥弗顿 说
Make sure that your stop loss is a positive number. You wrote a negative number in your post.
The formulas should work on the DAX or any instrument. It’s not FX specific.
Andrew Coles 说
It is often easier to specify Stop Loss as a Rate difference, 即. from the current Ask or Bid Rate to a Support or Resistance Level respectively, rather than in Pips. This is typically how an EA would form the Stop Loss Value, or alternatively as some (sub one) 多重的平均真实范围.
Here is a minimal EA, to demonstrate Lot size Calculation. It includes normalization of the raw Lot size formed into Lot Step sizes the Server will accept, within minimum and maximum Lot sizes also.
Example Balance Risk and Stop Loss are provided as input Statements, for ease:
#property strict
input double StopLossRate = 0.00500; // Stop Loss with 50 点子 (Non JPY)
input double Balance_Risk = 0.012; // 1.2% of Account Balance risked
//+——————————————————————+
//| Expert initialization function |
//+——————————————————————+
void OnInit()
{
double tickVal;
double powTerm;
double rawLots;
double stpLots;
double lotSize;
double maxLots;
tickVal = MarketInfo (NULL, MODE_TICKVALUE);
Print (“TICKVALUE = “, tickVal);
rawLots = (Balance_Risk * AccountEquity() * 点) / (tickVal * StopLossRate);
Print (“rawLots = “, rawLots);
stpLots = MarketInfo (NULL, MODE_LOTSTEP);
lotSize = stpLots * NormalizeDouble (rawLots / stpLots, 0);
Print (“Normalized lotSize = “, lotSize);
如果 (lotSize maxLots)
{
lotSize = maxLots;
}
}
Print (“Trade lotSize = “, lotSize);
}
//+——————————————————————+
//| Expert deinitialization function |
//+——————————————————————+
void OnDeinit(const int reason)
{
//—
}
//+——————————————————————+
//| Expert tick function |
//+——————————————————————+
void OnTick()
{
//—
肖恩·奥弗顿 说
Thanks for adding this!
Andrew Coles 说
[Private Note]
It seems as though the .LT. sign on the minimum Lot Size stripped out some of the submitted code.
It might be easier to send you the MQ4 File, if you think it might be helpful to post, or expand your already very helpful Page.
该 “powTerm” Variable can be removed. This was just a Test-bed for an EA written, that runs on M15 Time Frame. Very challenging to get into profit. I wanted a lot of Trades, for rapid Equity growth.
I had considerable problems getting the MT4 Back-tester to work. Eventually achieved a Profit Factor of 1.29 过 7 Month Back-test with a few combinations of Parameters.
I could not get a Break Even Stop Loss to work in the Back-test EA Version. The operational EA is radically differently coded (written for real-time, with fault tolerance).
Expect to go Live shortly, if forward Demo Test is consistent with the Back-test Results. Currently migrating the Entry Filters proven in the Back-test EA, into the Operational EA. The latter has already run (with minor Bugs), at a small loss on Demo.
Calvin 说
Please do share your code snippet. 谢谢!
Ilan Tree 说
I added a post in my recent blog discussing some useful MQl4 functions when verifying and calculating lot size based on currency and risk parameters – http://www.ilantree.com/useful-mql4-lot-size-functions/, happy to exchange ideas with you.