Trabalho concluído
Termos de Referência
Hello all! I'm looking for a good MQL5 programmer to come up with a clear and straightforward code for this strategy. I can read code, and understand the flow of it. I just can't write it from scratch. Help! :P
The strategy of the EA is to check the direction of a bar at the end of each bar, on whatever time period it is set on. If X bars in a row are in the same direction, at trade is initiated at the beginning of the next bar. The trade is either in the same direction that the bars are going (good on short timeframes) or in the opposite direction (good on long timeframes). The trade exits on Y amount of consecutive bars in the same direction (high number on short timeframes, short number on long timeframes)
Here's an example of a position being opened in the opposite direction the bars are going. X=2, Y =1, meaning a trade is entered after 2 bars in a row close in the same direction. The trade is exited once a bar closes in the opposite direction.
I envisions bars in a row as being counted as a group. So if X (bras in a row) was 3, then 3 bars in a row would form a group, and the next bars would for a new group. A stop loss or take profit would reset these groups to 0. However, since a SL or TP would happen somewhere in a bar rather than at the absolute beginning or end, the rest of the bar would be counted as the first bar in a new series.
In shorter time frames, sometimes a streak of bars in the same direction will be broken by a lone bar in the opposite direction, making a potentially huge trade become a puny one. Hence the Y number of bars in the opposite direction to exit the trade.
Also, again mostly on smaller timeframes, many bars in a row will appear, more than usual, and could trigger a big trade if we were to enter multiple orders on it. All orders are closed once the exit signal is present though.
Finally, the EA needs to work on multiple timeframes and symbols at once. For example, EURUSD 1day opposite and GPBUSD 5 min same run at the same time, triggering different trades without cancelling one another
Inputs:
Direction of the entry (same, opposite)
Number of X for entry
Number of Y for exit
Stop loss
Take profit
Trailing stop
Lot: fixed amount or % of account balance (both options)
Multiple orders
Feel free to ask questions and clarifications!