Работа завершена
Техническое задание
I'd like an MT4 EA created using a 2 time frame heiken ashi smoothed chart as baseline. In the simplest terms, I want to take one trade at the close of a bar, that is contrary/inverse to the two-time-frame heiken ashi candles. So if the trend of TF1 and TF2 HA candles are both up, and the actual close price < open price then it would place a buy order, and visa versa for down TF1/TF2 HA bars.
I'd like it to open multiple total orders, in the same trade direction, but only one trade per new bar close.
As far as SL/TP, I'd really like to have a trailing stop activated, based on the price movement during that bar. I'm trying to catch a price surge. So if the lastprice(bid/ask) is x# of pips from the bar open, a trailing stop would be activated. The standard trailing stop movement of MT4 is fine. I'm with a US broker, so I think putting the trailing stop on one open order, puts it on all, which is what I want. So for a long position, it'd have this general logic. "If positionprofit>0 and lastpbid>open+.0015, then activate trailingstop at bid - .0002". The input variables for that would be like:::: Bar_Move : .00150, and TS_Start: .00020
I did have someone do a job for me on here and while using an EA builder is fine, please just do the code to accomplish these things. The job that person did had over 10,000 lines of code, most of it not needed. And I do like to play with the code, so just try and keep it simple and clean to get the job done. thanks.
I think that is pretty straightforward, but please message me if anything unclear. I am on a 5 digit broker if that matters, and assume both mql and ex4 file will be included.
Here is a summary:
- EA for MT4, based on 2 time frame SMOOTHED Heiken Ashi, TF1(M15),TF2(H4) is ok to start
- TF1 & TF2 agree, to set trend, Place 1 order when the bar close is inverse of trend. .
- Multiple open entries in the same direction
- SL/TP - I don't normally do automatic SL/TP, so this is mostly for testing/optimizing)
- Trailing Stop Trigger - If the price moves x# of pips during the current bar, and the total position profit is positive, activate a trailing SL for all open orders on that chart.
Inputs: This is my best guess of inputs, use whatever names you want and just add any others you think necessary.
- Ma Method1: 2
- Ma Period1: 3
- MA Method2: 2
- MA Period2: 6
- TF1: M15
- TF2: H1
- Lot: .01
- Maximum_Spread: 3 (Want to filter out wide spread events, so if the spread is move then this, do not take the trade)
- SL: 0 (don't use much, but good to have for testing)
- TP: 0 (same)
- Trailing_Stop_Move: 10 (if the last bid/ask is more than this number of pips away from the current bar open price, and the open account profit>0, activate a trailing stop for all open orders on the chart. Maybe a 0 will make the TS not active)
- Trailing_Stop: 3 (this will be the starting point for the trailing stop, Pips away from the current price) The trailing stop can move at the minimum increments after activation.