Trabajo finalizado
Tarea técnica
I need an Expert Advisor for MetaTrader 4.
It needs to be able to work on different time periods, currency pairs, no indicators are required.
Simple EA that buys or sales following the previous candle trend.
This simple strategy looks for opportunities in each opening of a candle, the price is defined by the previous candle and if no parameter is set, the trade will close at the closing price of the actual candle, and it will work forever. It opens a trade with the closing price of the previous candle, direction of the trade depending on the trend of the previous candle, trade close when candle close, and this forever, if previous candle close at the same price it opens no trade is place, if trade was place it will be close at same price.
Paraments will manage and limit this simple strategy.
As an example, imagine:
· EURUSD chart
· Time frame 1 hour
· time on 08:00
· time off 19:00
At 8:00 Sell if previous candle is bearish, buy if previous candle is bullish, the execution price is the closing price of the 7:00 candle and the direction of the trade (sell or buy) will depend on how the previous candle finish, if previous candle finish bullish it will place a buy trade if previous candle finish bearish it will place a sell trade, if candle finish at same price it will not place any trade. If Take profit and stop loss are set at 0 (zero), the trade will close at the price that close the candle, making a loss or a profit. Last trade will be place at 18:00 and close when it meets take profit, stop loss or when the candle close.
See below parameters and explanation.
Parameters
· Multiple: YES, or NOT, yes it will place trades in each candle, NOT it will place a unic trade per day (as if time on and time off parameters are set, if not it will do a simple trade).
· Lot Size
· Take profit: if 0, it will close the trade when candle close.
· Take profit trailing: if 0, take profit leads. It will be by pips, let me know how it must be defined on MT4.
· Stop loss: if 0, it will close the trade when candle close.
· Time on: When robot starts to work, it must us the time the machine is set, it cannot mess with time zones.
· Time off: When robot stops to work, it must us the time the machine is set, it cannot mess with time zones.
· Inverse signal: It will do the inverse, so buy when is bearish and sell when is bullish.
· Candles away: If 1, it follows the main strategy, if 2 or more it will execute the closing of the trade when it meets take profit or stop loss or when the candle finish, in this case if parameter is set at 2 it will close at candle number 2, if parameter is set at 3 it will close at candle number 3. If parameter is set at 0 it will not close until take profit or stop loss (even if it runs over time off).
· Balance: Start balance.
· Commissions: to make it more real, it is the price for lot, so if set 10$, means 1 lot 10$, so 0.50 lot size it means 5$ commission.
· Increment lot: if 0, lot doesn’t increment, it will run as set on parameter lot size, but if set at 1, Lot size will increment or decrement as the account balance increment o decrement. Say you place a trade and you win 500$, and your balance was 20,000$, lot size was 2, next trade your lotsize will be (500$/20,000$+1)*2= 2.05 is the lot size for the next trade.
· Volatility cap: It is a percentage, if 0 nothing changes, if above 0 it will trade or not depending on what is the volatility of the previous candle, volatility defined as the different between the opening price and the closing price (not on high and low price). If set below 0, so minus, it will trade in case a minimum volatility is meet, volatility defined as the price different between open and close price of the candle.
· Breakthrough: 0 or 1, if set 0 nothing happens, if set 1, it will place trade when the price of the candle breaks the high or low of the precious candle, if it doesn’t break high or low will not place a trade and wait to the next candle.
Time on and off must be the one MT4 chart is running on, please let me know how it will work.