Unique function to calculate Lots to be traded

MQL5 资料库

工作已完成

执行时间14 小时
员工反馈
Thanks for the job

指定

Here's an example of what I'm trying to do.

Some assumptions:

  1. I have USD 100k available margin.
  2. 2% or 2k of 100k is risk money for the transaction.
  3. I want to risk the full 2% on "n" lots (the challenge is to figure out how many lots I will break the $2k into!)
  4. calculate a per pip value in USD of the currency pair
  5. Averaage True Range or ATR calculates the average pips of range per candlestick over n candlesticks.
  6. ATR_Multiplier (as input parameter) is usually between 1.0 and 1.5
  7. multiply number of pips in ATR * ATR_Multiplier by pip value in USD, then divide total risk money by this value

This is relatively easy arithmetic with a EURUSD, USDJPY or GBPUSD transaction, however when trading the CADCHF or the EURGBP, we have to calculate the USD pip value backwards using either CHFUSD or GBPUSD to calculate the correct lot size for the USD value of ATR * ATRMultiplier of the non-USD currency pair.

This is the position size calculator that I will be comparing the EA results against for veracity:

http://www.babypips.com/tools/forex-calculators/positionsize.php

The reason this is important is because my SL number will be ATR * ATR_Multiplier and I want to spend all of my 2 % risk money on "n" lots.

CipherPips

Here is a link where you can download the two Excel files - one for standard size lots, the other for mini size lots.

http://www.forexfactory.com/showthread.php?t=61693

Both standard and mini lot sizes should work

Source code will be required after the final product is delivered.

反馈

1
开发者 1
等级
(320)
项目
521
66%
仲裁
52
21% / 38%
逾期
165
32%
工作中

项目信息

预算
10 USD
开发人员
9 - 9 USD
截止日期
1 天