Lavoro terminato
Specifiche
Dear Developer,
I need a EA that will use 2 sets of Moving averages and RSI level to open trades. I need the trade to be managed by moving stoploss and apply some checks before opening the trade. The detailed requirements specification is below: Please get back to me if anything is not clear.
Input Variable : (i can input values to)
int MAslow (default 50 period)
int MAfast (default 20 period)
int RSIperiod (default 14 period)
int RSIbuyLevel (default is 70)
int RSIsellLevel (default is 30)
double FixedLotSize (default is 0.01)
int SLadjustPips (default is 5 pips)
int MaxOpenTrades (default 10)
int TPTarget : 0 ( no target) , 1 (1x the risk), 2,3,4,5 (default is 0)
int MoneyAtRisk - 0 (no risk management), 1 (1% of balance to risk) ,2,3,4,5 (default is 2)
boolean NewTrades : Yes / No (default No)
Definition:
SMMA - Smootherned moving average
EMA - Exponential moving average
1. Buy trade:
1.1. The program should open a BUY trade based on when SMMA(MAfast) crosses over above EMA(MAslow)AND current RSI(RSIperiod) value >= RSIbuyLevel.
2. Trade mgmt - Stop loss for buy trade:
2.1.When trade is opened, the stop loss must be the LOWER value of a or b:
(a) previous candle Low - SLadjustPips
(b) current value of EMA(MAslow) - SLadjustPips
2.2. For every new candle, the stop loss must move up to value of current EMA(MASlow) - SLadjustPips.
3. Sell trade:
3.1. The program should open a SELL trade based on when SMMA(MAfast) crosses below MA(MASlow) AND current RSI(RSIperiod) <= RSIsellLevel .
4. Trade Mgmt - Stop loss for Sell trade:
4.1. When trade is opened, the stop loss must be the HIGHER value of a or b:
(a) previous candle High + SLadjustPips.
(b) current value of EMA(MAslow) + SLadjustPips
4.2. For every new candle, the stop must move down to value of current EMA (MASlow) + SLadjustPips
5. Buy/Sell Lots Size:
5.1. If MoneyAtRisk is set as 0, take input for FixedLotSize as buy/sell lot size.
5.2. If MoneyAtRisk selection is between 1 to 5, lot size should be calculated by 1% to 5% of the account balance value as risk amount based on previous candle length + SLadjustPips OR 0.01 lot (which ever is bigger).
6. Trade close:
6.1. If TPTarget input value is 1 to 5, then take profit is set as 1 to 5 times the pips at risk. If TPTarget is 0, no target is set and the trade is closed by Stoploss calculation.
6.2. Trade is closed when the price hits the TPTarget OR stoploss level OR closed manually.
6.3. When a trade is closed manually, the variable NewTrades should be set to No.
7. Manual trade:
7.1. If a manual trade is opened, then BOT should be able to take over the stoploss management by applying the same rules for Buy or Sell trade. (see requirements 2, 4, 6).
8. Other rules checked before opening a trade:
8.1. Only 1 trade per currency pair can be open at any given time and time frame.
8.2. If NewTrades is set to No for a currency pair, then no trades can open for that pair. Any open trade must be managed until closure.
8.3. MaxOpenTrades value to be checked against number of all open trades across all currencies before placing a trade and should not allow new trade if its exceeded.
8.4. Values of Lot Size, SLadjustPips, MaxOpenTrades, TPTarget, MoneyAtRisk, NewTrades must be displayed in the chart where EA is running.
8.5. All the above should work on EUR, USD, AUD, GBP, JPY, CHF, NZD, SGD, XAU combination pairs. (especailly lot and SL calculation).