ok, I created my own ea using the ExpertAdvisorBuilder site, and it's working pretty well. However, there are no options to add a BreakEven stop, and I don't know how to do it. I tried a few things (copying code from other ea's that have a breakeven stop) but have not been able to get it to work. I really don't know that much about the coding.
Does anyone have any idea how to add a breakeven stop to the existing ea?
thanks
Corrected ea....
if anyone can figure out how to add a break even stop that would be great! I find that in the beginning of the trade, if it get to +30 pips and then turns around, it will probably go back over the line and into a reverse trade. So with a break even stop you can save some pips. But after it gets past that, it's better to let it run and see what happens, so I don't like to use the trailing stops.
celticheart
I cannot write EA's...but I am impressed how you went to that builder site on your own and did it...
Can you post the smoothed indicators below...the ones in mt4 are not smoothed.
ES
breakeven
hey celtiheart...... below is your ea with breakeven......
you'll notice the new inputs,
//-------
extern int addbreak = 0;
extern int MagicNumber = 120000;
extern int fastperiods = 3;
extern int slowperiods = 100;//------
you mentioned 30 so the adjustable breakeven threshold by default is 30.....
the addbreak variable, default 0, is for instances when you might want to protect a small amount rather than a flat breakeven..... as example, a setting of 20 would roughly protect 20 pips of profit..... again, roughly.....
the fastperiods , default 3, and slowperiods, default 100, inputs allow you to vary your ma periods....
the magicnumber has been changed to 120000..... this is to avoid conflicts with all orders not placed your ea.....h
celticheart
I cannot write EA's...but I am impressed how you went to that builder site on your own and did it...
Can you post the smoothed indicators below...the ones in mt4 are not smoothed.
ESHi... yes, is it built in to MT4. Just add a moving average, then from the dropdown box you can select MA Method, with choices of simple, exponential, smoothed and linear weighted.
Attached a template for you with the MA's, just copy it to your templates folder. The two smoothed ma's make a "ribbon" that crosses back and forth over the 100 LWMA. When you use the two smoothed MA's with the high and low, it eliminates a lot of false signals you would get if you only use one smoothed MA applied to the close.
Yeah your right-duh!.... smoothed is there...
How come the entries you make with the EA set the little marker-arrows on the charts so far off from the price? I know the spread is big in the AUD/JPY....but do you enter long using the ask and short using the bid?
ES
Hi... yes, is it built in to MT4. Just add a moving average, then from the dropdown box you can select MA Method, with choices of simple, exponential, smoothed and linear weighted. Attached a template for you with the MA's, just copy it to your templates folder. The two smoothed ma's make a "ribbon" that crosses back and forth over the 100 LWMA. When you use the two smoothed MA's with the high and low, it eliminates a lot of false signals you would get if you only use one smoothed MA applied to the close.
hey celtiheart...... below is your ea with breakeven......
Wow, thanks!!! I will try that out. I am still tweaking the ea.... I've never made one before and it's a lot different when it's automatic than when I do it manually. When I'm doing it manually, I wait for the close, then run a "close and reverse" script, but the ea made with the Expert Builder has quite a delay if you wait for the close. It won't open a new order until the close of the following candle, which is a bit late. So I used "every tick" mode, which has pros and cons... sometimes it will open an order which I probably wouldn't have if doing it by sight.
And I've never traded in the middle of the night (I live in Florida) so had no idea how the system would work during the Asian session. I let the ea run last night on demo and if last night is any indication, don't use it at night! LOL As with pretty much any system, it's not going to work if the market is really choppy and it seems to be more so during the Asian session (although it usually works pretty well til 10pm or 11pm EST, which is into the first few hours of the Asian session).
And I guess the system would work on other pairs and other timeframes, but I have the best luck with AUD/JPY on one 1-minute chart. It moves a lot but is a bit less volatile than GBP/JPY so it seems to work better. And even though I use this on the 1-minute chart, it is not by any means a scalping system... sometimes the trades last for hours, up to 8 hours. Although it is definitely an intraday system.
Still undecided if it's better in the long run not to use "tick mode." Or just use common sense and don't run it if the market is really choppy and the MA's keep going back and forth across the 100 LWMA
Generally speaking, this system works really well for me, averaging 200-300 pips a day net on the AUD/JPY, 1-min chart. But that's doing it manually, it's different when it's automated, as the ea might take some trades that I wouldn't when just looking at it. The problem with doing it manually is that I always have to watch and can't ever go anywhere!
Yeah your right-duh!.... smoothed is there...
How come the entries you make with the EA set the little marker-arrows on the charts so far off from the price? I know the spread is big in the AUD/JPY....but do you enter long using the ask and short using the bid?
ESYes, it's because of the spread.... I use FXDD broker and the spread for AUD/JPY is 6 pips. Which isn't bad considering how much the pair moves compared to others.
hey celtiheart...... below is your ea with breakeven......
Wow, thanks!!! I will try that out. I am still tweaking the ea.... I've never made one before and it's a lot different when it's automatic than when I do it manually. When I'm doing it manually, I wait for the close, then run a "close and reverse" script, but the ea made with the Expert Builder has quite a delay if you wait for the close. It won't open a new order until the close of the following candle, which is a bit late. So I used "every tick" mode, which has pros and cons... sometimes it will open an order which I probably wouldn't have if doing it by sight.
And I've never traded in the middle of the night (I live in Florida) so had no idea how the system would work during the Asian session. I let the ea run last night on demo and if last night is any indication, don't use it at night! LOL As with pretty much any system, it's not going to work if the market is really choppy and it seems to be more so during the Asian session (although it usually works pretty well til 10pm or 11pm EST, which is into the first few hours of the Asian session).
And I guess the system would work on other pairs and other timeframes, but I have the best luck with AUD/JPY on one 1-minute chart. It moves a lot but is a bit less volatile than GBP/JPY so it seems to work better. And even though I use this on the 1-minute chart, it is not by any means a scalping system... sometimes the trades last for hours, up to 8 hours. Although it is definitely an intraday system.
Still undecided if it's better in the long run not to use "tick mode." Or just use common sense and don't run it if the market is really choppy and the MA's keep going back and forth across the 100 LWMA
Generally speaking, this system works really well for me, averaging 200-300 pips a day net on the AUD/JPY, 1-min chart. But that's doing it manually, it's different when it's automated, as the ea might take some trades that I wouldn't when just looking at it. The problem with doing it manually is that I always have to watch and can't ever go anywhere!
I've compared the code in the two files, so if I make any more adjustments to the original ea I will be able to add the breakeven stop.
Thanks so much!
Thanks celticheart for the template and thanks hayseed for the improved EA...I am watching this on the AUD/JPY M1 in a Demo IBFX mini account with lotsize set at a miniscule 0.01...hehe
ES
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hi, everyone...
this is my first post and I'm not sure if this is the right place or not, so if not, please let me know!
I have a system that works pretty well for me on the AUD/JPY on the 1-minute chart (nets 200-300 pips a day). Would love to find an ea for it! I can't always watch the screen so I miss signals sometimes.
Very simple system...
Indicators:
100 LWMA (linear weighted) applied to close
3 SMA (smoothed) applied to high
3 SMA (smoothed) applied to low
When the 3 SMA applied to the high crosses down thru the 100 LWMA, Sell
When the 3 SMA applied to the low crosses up thru the 100 LWMA, Buy
You are always in a trade with this, I would like an ea that closes and reverses the position at every signal. Also manual lot size, and it would be great if I could stipulate the time of day that it runs. Since I trade manually I only trade from 8am EST to maybe 11pm EST, and not sure if it would be better to run it 24/7 or just during the day (in other words, not sure how it does with Asian session, etc). Also options for stop loss and break even. I don't actually set an initial stop loss but do usually set a stop to break even after a gain of 30 pips or so.
I actually have been using a different MA than the 100 LWMA but have found the 100 LWMA to be extremely close to the one I use. I use the xpma indicator, with a 28 period DEMA (MA_Type 4 on the indicator, attached). Really not sure which MA is better, they seem to be very close, so I figure it would be easier to make an EA with the more "normal" MA, which is the 100 LWMA.
thanks!