请教老师资金仓位管理原理!!
其实仍是MT4自带的MA系统,我E文差,谁能告诉我这个资金管理的原理和计算方法???extern double Lots = 0.1;
extern double MaximumRisk = 0.02;
extern double DecreaseFactor = 3;
double LotsOptimized()
{
double lot=Lots;
int orders=HistoryTotal(); // history orders total
int losses=0; // number of losses orders without a break
//---- select lot size
lot=NormalizeDouble(AccountFreeMargin()*MaximumRisk/1000.0,1);
//---- calcuulate number of losses orders without a break
if(DecreaseFactor>0)
{
for(int i=orders-1;i>=0;i--)
{
if(OrderSelect(i,SELECT_BY_POS,MODE_HISTORY)==false) { Print(\"Error in history!\"); break; }
if(OrderSymbol()!=Symbol() || OrderType()>OP_SELL) continue;
//----
if(OrderProfit()>0) break;
if(OrderProfit()1) lot=NormalizeDouble(lot-lot*losses/DecreaseFactor,1);
}
//---- return lot size
if(lot 应该加分 EA要好! 顶的就是你 强人,佩服死了。呵呵,不错啊 回复一下 看看是什么东西啊 下了的确不错 感谢分享 谢谢分享!!!!!
页:
[1]
2