MM % 颠簸率脚本
发布时间:2021-08-18 作者:admin 来源:网络整理 浏览:
MM % 颠簸率脚本使用说明:
参考资产的颠簸率计算手数比并开仓。止损自动设置, 止盈 - 依据需求, 作为乘数 R。
LotSize:=RiskAmount/(PointPrice*StopLossPoints);
RiskAmount:=FreeMargin*RiskPercent/100;
StopLossPoints:=kATR*ATR(TimeFrame,RiskAtrPeriod)/PointSize;
TakeProfitPoints:=StopLossPoints*ProfitToLossRatio.
操纵函数是 Trade, 在 Trade.mq4 库文件里。声明:
int Trade(string smb, int TimeFrame, int cmd, bool ShowQ, int Slippage, bool SetProfit, double MaxRiskPercent, int RiskAtrPeriod, double RiskMulATR, double ProfitToLossRatio), where:
smb - 资产名称;
TimeFrame - 用于检测 StopLossPoints;
cmd - OP_BUY 或 OP_SELL;
ShowQ - 显示确认对话框 (False - 无对话框);
Slippage - 滑点点数;
SetProfit - 若为 True - 将在订单里指定止盈;
MaxRiskPercent - 可用担保金的 %, 允许的风险 (2% - 典型, 5% - 激进, 更高 - 看运气了);
RiskAtrPeriod - 计算真实范围的最后柱线号码 (21 足够了);
RiskMulATR - 用于确定 StopLossPoints;
ProfitToLossRatio - R 的乘数 (例如, 5)。
附带脚本:
Buy.mq4/Sell.mq4 - 买/卖当前资产, 工夫帧, 带确认对话框, 滑点 1 个点, 2% 风险, RiskAtrPeriod=21, RiskMulATR=1, ProfitToLossRatio=10;
Buy_nonQuery.mq4/Sell_nonQuery.mq4 - 设置雷同, 但没有对话框, 且滑点=0。
如何装置:
Trade.mqh - 拷贝到 MetaTrader 根目录下的 'experts' 目录下的 'include' 子目录;
Trade.mq4 - 拷贝到 MetaTrader 根目录下的 'experts' 目录下的 'libraries' 子目录, 并编译;
Buy.mq4, Buy_nonQuery.mq4, Sell.mq4, Sell_nonQuery.mq4 - 拷贝到 MetaTrader 根目录下的 'experts' 目录下的 'scripts' 子目录, 并编译。
MM % 颠簸率脚本作者、使用说明信息为小编网络收集不确保完全精确,配资网,望知
关键字
MM| |%| |颠簸|率|脚本
,股票配资,51配资- 热门文章排行