Tâche terminée
![](https://c.mql5.com/i/avatar/avatar_na2.png)
Spécifications
General Trading Rules:
1) We will only BUY LONG or SELL SHORT and not both simultaneously
2) Once a position is open, whether long or short, it must first be closed before changing directions. NO Exceptions.
3) No less than 0.5% and no more than 5% of current account balance shall ever be invested in any single trade.
4) Subsequent Leg-in trades are permitted as long as the trade is in the same direction.
5) No trade shall ever be entered without first knowing the TP and SL levels.
6) Any trade that is currently open should be able to be switched from a TP to Trailing Stop values .25 ATR, .50 ATR or 1 ATR
7) all SL, TP and Trailing Stop transactions should happen locally, with the exception of when MT4 is brought down gracefully. In this situation, all open trades should be modified on the server for current TP, SL and / or Trailing Stop values.
Need a Trade manager to do the following for me:
1) Calculate ATR.
2) calculate SL in terms of an ATR Multiplier
3) Calculate TP in terms of an ATR multiplier
4) Calculate the USD value of ATR from the current currency pair
5) Calculate "n-percent" of available funds in the account
6) Calculate the number of lots x.xx that n-percent account value represents
7) Calculate BUY LONG SL & BUY LONG TP
8) Calculate SELL SHORT SL & SELL SHORT TP
I will need a Buy Long button a Sell Short button and a Close Trade Button for each instance or currency pair. If the buttons are associated with the Charts, each chart should have buttons for the on-chart currency pair. Buttons can be put in an indicator window below the chart or on a separate interface.
Currencies to be supported with the Trade manager follow:
AUDCAD CADCHF EURAUD GBPAUD NZDJPY USDCAD
AUDCHF CADJPY EURCAD GBPCAD NZDUSD USDCHF
AUDJPY EURCHF GBPCHF USDJPY
AUDNZD CHFJPY EURGBP GBPJPY
AUDUSD EURJPY GBPNZD
EURNZD GBPUSD
EURUSD
Essentially, calculations from the 7 base currencies back to the USD should be done in order to calculate the per pip USD value. Then extrapolation of the basis point value multiplied by the number of basis points in the ATR in order to calculate how many lots can be purchased for n-percent of the account balance.
I have code that can be used for these calculations. The selected programmer will receive these routines, although they are from MT5. I need them to work in MT4, or there will be some conversion needed, however the algorithm will be the same.
Parameters:
int ATR_Periods
double Percent_Risk_Per_Trade
int slippage
double sl_multiplier e.g. 1.0 is ATR*1
double tp_multiplier e.g. 3.0 is ATR*3
bool Use_Trailing_Stop
int Trailing_Stop_Points
bool Push_SL_And TP_On_Deinit
The following values should be reflected on the right side of the respective chart: BuyTP, Buy SL, Trade $ Value, ATR Points Sell SL, and Sell TP from top to bottom on the right border of the chart because I use "Shift right border" as an option. If a Windows popup with DLL interface is chosen, then these values should also be reflected on this part of the interface by the respective BUY, SELL and CLOSE buttons.
Please ask any relevant questions before quoting price and date.
If the programmer chooses to make a Windows DLL that offers the Trade manager functionality, buttons to Buy, Sell, Close trades for the above-mentioned currency pairs can be in rows and columns as long as values are also on the interface.
source code will be a required deliverable upon completion of the project
CipherPips