Adjustable MA

fcbrants

Trader
Jul 19, 2011
6
0
12
EURJPY Settings:

Same date & data format as above.

62182 37097.31 159 1.88 233.32 6729.72 23.65% Period_1=30 Period_2=35 MA_Method=0 MinDiff=4 Lots=1 StopLoss=0 TakeProfit=0 TrailingStop=0 Slippage=3 LotsPer10000=1


62127 37097.31 159 1.88 233.32 6729.72 23.65% Period_1=35 Period_2=30 MA_Method=0 MinDiff=4 Lots=1 StopLoss=0 TakeProfit=0 TrailingStop=0 Slippage=3 LotsPer10000=1


85678 36749.79 154 1.90 238.63 6625.81 37.49% Period_1=32 Period_2=39 MA_Method=0 MinDiff=5 Lots=1 StopLoss=0 TakeProfit=0 TrailingStop=0 Slippage=3 LotsPer10000=1


85560 36749.79 154 1.90 238.63 6625.81 37.49% Period_1=39 Period_2=32 MA_Method=0 MinDiff=5 Lots=1 StopLoss=0 TakeProfit=0 TrailingStop=0 Slippage=3 LotsPer10000=1
 

Enivid

Administrator
Staff member
Nov 30, 2008
19,297
1,529
144
Odesa
www.earnforex.com
Enivid,

Would it be possible to write all trade information to the log file?

I'm running it on an OANDA MT4 account w/ 50:1 Leverage & $470.00 balance.

My settings are:

2011.07.21 03:53:10 Adjustable_MA EURUSD,M5 inputs: Lots=1; StopLoss=52; TakeProfit=0; TrailingStop=0; Slippage=3; Period_1=46; Period_2=57; MA_Method=0; MinDiff=6; UseMM=true; LotsPer10000=1;


Adjustable_MA tried to place a trade this morning (while the EURUSD was slowly but steadily climbing) with a 52 PIP stop loss.

The only error in the Experts log is:

2011.07.21 08:35:01 Adjustable_MA EURUSD,M5: 130

Error 130 is "Invalid Stops", but I don't have any of the other trade parameters, so I don't have much to troubleshoot with.

Also, do you send a market order (ie, fill at the current market price), or do you specify a price when you send an order (ie, fill at this price...).

Thanks!!

Franko
If your broker is using 5 digits after the dot in EUR/USD quote, then 52 pips would probably always trigger OrderSend Error 130.
 

fcbrants

Trader
Jul 19, 2011
6
0
12
Back on Go :)

Thanks, didn't even think of that.

If your broker is using 5 digits after the dot in EUR/USD quote, then 52 pips would probably always trigger OrderSend Error 130.

Another question if I may:

Any suggestions / guidelines on optimizing the Adjustable_MA without falling into the trap of curve fitting?

I've tried optimizing over 2009, then testing over 2010 with less than stellar results.

I've thought of finding a period when the pair is range-bound & optimizing over that period.

The logic is, if your EA can do well during in a ranging market, then it should do very well when the pair is trending.

Thoughts?

Thanks for all of your help.

Franko
 

fcbrants

Trader
Jul 19, 2011
6
0
12
Just tested this...

If your broker is using 5 digits after the dot in EUR/USD quote, then 52 pips would probably always trigger OrderSend Error 130.

It looks like the EA is handling the 5 digit broker stop loss correctly:

7 2011.01.12 08:20 sell 4 0.10 1.29759 1.30259 0.00000 0.00 877.20
8 2011.01.12 08:55 s/l 4 0.10 1.30259 1.30259 0.00000 -50.00 827.20

This is with a 50 PIP stop loss.

Franko
 

Enivid

Administrator
Staff member
Nov 30, 2008
19,297
1,529
144
Odesa
www.earnforex.com
It looks like the EA is handling the 5 digit broker stop loss correctly:

7 2011.01.12 08:20 sell 4 0.10 1.29759 1.30259 0.00000 0.00 877.20
8 2011.01.12 08:55 s/l 4 0.10 1.30259 1.30259 0.00000 -50.00 827.20

This is with a 50 PIP stop loss.

Franko
Right. Then I don't know whot could have caused the error 130 for you...
 

doublebass

Active Trader
Jan 27, 2011
16
2
39
try these settings for adjustable MA ea:

this EA in-general has tremendous possibilities with the absolute best settings.
we, as a group, need to just.....find them, lol.
i've found myself back here again with a couple of new settings for this EA, (for MT4!!! if there are new settings other than i am providing, leave them unchecked and @ zero) each of which are on the EUR/USD pair, two are for the 5-minute TF (Time Frame) and the other is for the 1-minute TF.
testing is done using the dates of 1-1-09 through today, 9-6-11,
always using the 'every tick' mode of testing.
whenever i do testing on ANY EA, my preference would be that it NOT have the 'close upon cross' feature because i feel it to be not in the interest of
the user's flexibility, like, it closes trades when you least expect it, sometimes regardless of the SL and TP settings. However, although i myself have done extensive testing and manipulation of this EA on my own, the TESTER results
always amaze me in that they DO indicate that this EA will make money in the long run, as will be evident in the results with my settings i am providing.
[i have found that the best way to test is to change ONE parameter and ONE ONLY at a time and keep a mental, if not written-down, record of the BEST result for that parameter, and then go-on to the next one]
so, the EA exhibits strong possibilities and here are my settings for you to try.
i have NOT used this EA in a practice OR live account, although i intend to immediately practice-forward-test it using these new settings, today.
even as i have been compiling this message i have hit-on settings using a
SL and TP, now included here for you! at the time of this typing, EUR/USD's spread was a mere 2-3 pips on Forex.com; your results may vary depending on ALL circumstances. i'll probably look at any responses to this post and
respond if i CAN answer anything effectively. i do not give any regards to
modeling quality or slippage, even though i've been informed of their value!
the test result for the 1-minute setting is limited by the history available for
such a short timeframe, only going back to 2-12-2010, but it works!

i generally cannot:
1. offer any advice on how to make it better---this is DONE! i assure you;
2. answer any questions as to why it does or doesn't work the way you want;
3. offer any other pairs or settings---simply put the EA on the tester on EUR/USD---1M or 5M depending on the setting you use,
ONE EA @ A TIME for live testing---
****dates are from 1-1-09 through today's date
(9-6-11 or your date upon reading this)******
ANYTHING LISTED AS ZERO IS UNCHECKED, EXCEPT SLIPPAGE WHICH IS
ALWAYS ZERO AND CHECKED.
and here they are:
********************************************************
#1:
EURUSDFXF
Period 5 Minutes (M5)
Lots=0.01; StopLoss=0; TakeProfit=50; TrailingStop=0 UNCH; Slippage=0;
Period_1=30; Period_2=23; MA_Method=3; MinDiff=11;
Initial deposit 10000.00
Total net profit 219.48 Gross profit 258.38 Gross loss -38.90
Absolute drawdown 5.88 Maximal drawdown 80.86 (0.79%)
Relative drawdown 0.79% (80.86)
Total trades 55 Short positions (won %) 27 (92.59%)
Long positions (won %) 28 (100.00%)
********************************************************
#2: Forget what i said, this is a new one on me;
this setting has a SL, with much-lower drawdown:

EURUSD
Period 5 Minutes (M5)
Lots=0.01; StopLoss=100; TakeProfit=50;
TrailingStop=0 UNCH; Slippage=0;
Period_1=30; Period_2=23; MA_Method=3; MinDiff=11;
Initial deposit 10000.00
Total net profit 182.36 Gross profit 243.30 Gross loss -60.94
Absolute drawdown 5.98 Maximal drawdown 26.10 (0.26%)
Relative drawdown 0.26% (26.10)
Total trades 55 Short positions (won %) 27 (85.19%)
Long positions (won %) 28 (92.86%)
********************************************************
#3

OMG--
this one enables the EA to use the 'CLOSE' function exclusively, and i am
very pleased with the results---this would be my DREAM JOB, optimizing EAs for people!

EURUSD
!!!1 Minute(M1)!!!
Lots=0.01; StopLoss=0 UNCH; TakeProfit=0 UNCH; TrailingStop=0 UNCH; Slippage=0 CH;
Period_1=47; Period_2=61; MA_Method=2; MinDiff=3;
Initial deposit 10000.00
Total net profit 451.16 Gross profit 1355.88 Gross loss -904.72
Profit factor 1.50 Expected payoff 1.36
Absolute drawdown 3.00 Maximal drawdown 71.96 (0.68%) Relative drawdown 0.68% (71.96)
Total trades 332 Short positions (won %) 166 (38.55%)
Long positions (won %) 166 (50.00%)
Profit trades (% of total) 147 (44.28%)
Loss trades (% of total) 185 (55.72%)
********************************************************
if they come through, see the attached .gif images---doublebass
********************************************************
 

Attachments

  • #1.gif
    #1.gif
    5.3 KB · Views: 28
  • #2.gif
    #2.gif
    5.4 KB · Views: 31
  • #3 PHENOMENAL.gif
    #3 PHENOMENAL.gif
    5.8 KB · Views: 38

zaratrau

Trader
Sep 6, 2011
1
0
12
about this EA

Hi to all

I´ve just start using this EA and what i can say is that it works, the only thing is ( i dint change any settings but the lots) only makes profit when the EUR goes long, when goes short is a lost , some thing wrong ? i just don t know , maybe you can give me some lights abou this cause im not getting there.

thanks for your help
 

doublebass

Active Trader
Jan 27, 2011
16
2
39
minor correction, as usual....

hmmm, sorry to have to interject between my last post and your replies you seek,
but i must let-on that>>>I should know better than to make a bunch of waves about the new settings i have found without trying them out on the live AND the practice account.
THEREFORE, the FIRST TWO settings i have listed above STILL DO WORK and haven't changed since mid-afternoon on my practice as well as my live account TESTER, whereas the spread in EUR/USD was 2-3 pips and my results were almost staggering in my opinion! once i tested my settings on my LIVE account, however, the 1-MINUTE (#3) setting didn't do nearly as well as it had earlier on the practice acc't., but the two 5-minute settings still did rather well----
I APOLOGIZE FOR MY OVERLY-ENTHUSIASTIC PRESENTATION of the settings.

here, this will make up for it to you on the 5-minute EUR/USD-we'll call it #4:

Lots=0.01 checked
StopLoss=0 unchecked
TakeProfit=50 checked
TrailingStop=0 unchecked
Slippage=0 checked
Period_1=30 checked
Period_2=29 checked
MA_Method=3 checked
MinDiff=1 checked

i JUST checked this on both accounts and the setting works very well.
you can try it without the TakeProfit as well (make TP Zero and uncheck it)


At least i am pointed in the right direction and here's a bit of how i think this thing really works---your MA settings (30, 29) determine when the MAs cross, of course; once the cross has occurred, the MinDistance setting determines if the MAs are far-enough apart to validate that there has been a genuine cross and places a trade therein.
no kidding, DB!
now, the trade appears to CLOSE ALSO and opens another in the other direction once the MAs have again moved-apart the same distance as was required to OPEN the trade in the first place. That may help you as you look-over your resulting charts and can then SEE where the MAs' lines are in relation to the actual trade arrows. i hope this helps and i wish i had MORE time to spend on it today.
i will be more careful in the future!---doublebass

ZARATRAU, it appears, in my observation, that on the way UP, the pullbacks are almost always going to be less in magnitude compared to the advances in the direction of the trend. so, you may have a trade that goes with the trend of 100 pips, with smaller pullbacks on the order of 20-30 pips, that do not always eat-up the profits going in that direction...conversely, on the way downward the rallies will most-likely be lesser in magnitude than the major trend itself--this is why there is a trend in the first place.
SEE THE ATTACHED .GIF IMAGE---
THIS APPLIES ONLY IF THERE IS NOT A TP OR SL IN-PLACE, AND THE EA IS ALLOWED TO OPEN AND CLOSE TRADES ACCORDINGLY.
i hope i am right and i hope this makes sense, or else i have really wasted the day, lol-----DB
 

Attachments

  • trend-pullbacks.gif
    trend-pullbacks.gif
    19.7 KB · Views: 36

doublebass

Active Trader
Jan 27, 2011
16
2
39
my thought is that......if we were to cause this ea, through a USER-SETTABLE setting (MinDiff2) to close the trades BEFORE the MAs have to cross and reach the MinDiff setting the other way in-order to close, like, the trade is opened after a cross occurs and hits the MinDiff setting (like normal) and if we want, the trade gets closed once the MAs get far-enough apart to indicate that the trade has indeed gone in a profitable direction (MinDiff2), thereby, seemingly, more-often closing the trades in-profit rather than once they have seen most of the profit go away by waiting for the MAs to cross again @MinDiff. (i read in the forum that the EA doesn't distinguish between a long or short trade based on the crossing of the MAs (although some effort and logic has gone-into it, it seems, in the main signal portion(!));
i have had it set it for something like 25/50 and other SWAPPED test settings and the trades placed at exact points in time have been exactly the same also on the resulting charts, whereas i think that if a short or a long trade is placed based on
the direction of the cross even more effectively, results could be phenomenal, along with the other idea/suggestion about trades closing before they go out-of-profit
(MinDiff2, which could be, OMG, even a negative number!) if we set the ea to work with a MinDiff of 3, for example, no SL or TP, 5-minute TF, everywhere there is a trade ending and a new one beginning is exactly where i feel that these opportunities will lie for us; a definite means by which the trade is determined to be long or short will be essential.
i suppose a longer timeframe of H1 or longer would be especially effective concerning this idea.
if anyone has the expertise here and can make the necessary additions, that would be a big step in what i feel is the right direction---and, generally, there is always the present edition of the EA to fall back on if this idea doesn't work as well as i've imagined---doublebass
 

Enivid

Administrator
Staff member
Nov 30, 2008
19,297
1,529
144
Odesa
www.earnforex.com
Although I'm not very confident in the positive effect of such addition, here's your update Adjustable MA EA.

The new parameter is called MaxDiff and by default it's set to 0, which means that it will do nothing. Set to the amount in pips you want. I've tried setting it to 10 and it resulted in some improvement over the results with the default settings.
 

Attachments

  • Adjustable_MA.mq4
    7 KB · Views: 77

doublebass

Active Trader
Jan 27, 2011
16
2
39
FABULOUS!
i am getting to work on it right now.

so far, longer TF of 4 hrs is showing promise.
i wish i could always distill it down to shorter and shorter timeframes,
but it doesn't always work---we'll see---thank you----doublebass
 

doublebass

Active Trader
Jan 27, 2011
16
2
39
setting(s) for the meantime:

please see the settings at the top of the attached .gif image
for testing purposes.
not visible on the .gif:
****UseMM=False
****LotsPer1000=0---unchecked

use EUR/USD 1-1-'09 through 9-30-'11 1-minuteTimeFrame;
(the RESULTS may only go back to starting-with about
mid-2010 because of all the data involved with testing
10s of thousands of bars on such a short time frame of 1M.)

>>>if that .gif doesn't open on your computer, use:

lots=.01
TakeProfit=10
StopLoss=0-----unchecked
Trailing Stop=0--unchecked
Slippage=0
Period_1=1
Period_2=1000
MA_Method=2
MinDiff=150
MaxDiff=160
UseMM=False
LotsPer1000=0---unchecked

this setting is something to chew-on whilst i take a little break from
trying to come-up with the ultimate, short-time-frame setting.

still seems to close trades unexpectedly, occasionally, mainly when the
opening MinDIff is like 2 and the MaxDiff is like 3 (only apart by 1)
but seems to differentiate buys and sells better than before---
may be my imagination, but either way, a good thing!
also try with MinDiff 150 MaxDiff 200 for another nice setting.
this time i tested them on the practice as well as the live accounts' tester(s).
takeprofit works with the close function in each case, so sometimes there is a loss because of the closing, a gain because of the closing and takeprofit at least somewhat assures that the EA makes its money. TP of 10 (probably up to a max of 20) assures us of getting in and getting out before getting into
trouble (drawdown). hope this works for you all-----doublebass
 
  • 👍
Reactions: Enivid

doublebass

Active Trader
Jan 27, 2011
16
2
39
here's the .gif

i always do better on make-up exams anyway. later-----
 

Attachments

  • adjustable ma ea 1-1000 1m 1-1-09thru9-30-11.gif
    adjustable ma ea 1-1000 1m 1-1-09thru9-30-11.gif
    17.7 KB · Views: 28

doublebass

Active Trader
Jan 27, 2011
16
2
39
More settings for Adjustable MA Max DIff EA:

Here are a few more nice settings:

eur/usd 1-minute, test dates 1-1-'09
through present:

#1:

Lots=.01
StopLoss=0 UNCHECKED
TakeProfit=10 TO 30
TrailingStop=0 UNCHECKED
Slippage=0
Period_1=800
Period_2=900
MA_Method=2
MinDiff=2
MaxDiff=4
UseMM= False
LotsPer10000=0 UNCHECKED

#2:

Lots=.01
StopLoss=0 UNCHECKED
TakeProfit=10 TO 20
TrailingStop=0 UNCHECKED
Slippage=0
Period_1=450
Period_2=500
MA_Method=2
MinDiff=5
MaxDiff=0
UseMM= False
LotsPer10000=0 UNCHECKED

#3:


Lots=0.01
StopLoss=0 UNCHECKED
TakeProfit=10 TO 30
TrailingStop=0 UNCHECKED
Slippage=0
Period_1=1
Period_2=1000
MA_Method=2
MinDiff=150
MaxDiff=170
UseMM= False
LotsPer10000=0 UNCHECKED

#3 is a slight improvement over the setting i provided in my previous post
on October 2nd; just change 160 to 170.

it doesn't SEEM to matter if an item is checked or unchecked
for testing, but i have not taken the time to, ha ha, check that.

i mean, why would there be a check-box if it did not matter?

anyway, these settings have been (checked) on my MT4 tester
on my live account and my practice account but not yet on
any actual forward test----this is only because my live account is
dead at the moment and my broker doesn't allow EAs to generate
TPs or SLs automatically so i cannot even do it (for 'real') to begin with.

BUT, if the tests are any indication, once put in-place and given the
ol' smiley face on the chart, we should eventually see some profits,
whether on live or on a practice account. i'll be getting a new broker
come Monday and the test can begin for me also.

these settings (#2, #3) yield a very low drawdown with very few trades;
they each work best at the highest given profit setting;
they are ALL optimized to work immediately---the best of my best!
i believe it's #1 that has the most trades & most drawdown but also the highest profit of all. i hope they work for you and if you come-up-with any
that are better than these, i check this page from time to time!

doublebass
 

Attachments

  • #1TesterGraph.gif
    #1TesterGraph.gif
    5.4 KB · Views: 26
  • #2 TesterGraph.gif
    #2 TesterGraph.gif
    5.1 KB · Views: 23
  • #3 TesterGraph.gif
    #3 TesterGraph.gif
    5.1 KB · Views: 22
  • 👍
Reactions: Enivid

Enivid

Administrator
Staff member
Nov 30, 2008
19,297
1,529
144
Odesa
www.earnforex.com
it doesn't SEEM to matter if an item is checked or unchecked
for testing, but i have not taken the time to, ha ha, check that.

i mean, why would there be a check-box if it did not matter?

The checkboxes are for Optimization mode in Strategy Tester. If you check an input parameter and turn optimization on, then the strategy tester will test the EA will the possible values of this input parameter (set by Start, End, Step).

Anyway, thanks for sharing such nice results!
 

doublebass

Active Trader
Jan 27, 2011
16
2
39
well, that'll save me a lot of typing and wonder in the future!
and, thank YOU for answering questions, making adjustments,etc.
there are more settings to come, as recently my broker has instilled the
new rule that SLs and TPs cannot be set by the EA at the same time as it
places its orders automatically. so, i have been using the Trailing Stop function
on this EA because that places an SL only after the desired TS setting has been reached. There, got-around THAT one. OOPS, the secret is out.
Concerning the Adjustable MA EA, though, the TS on short-only orders doesn't
seem to work effectively, regardless of the TS setting of 4, 10, 50, etc.
it works on BUY orders, but not on SELL; it does the Sell/Close, Sell, Close/...
and on BUY it does the appropriate 'Modify' function about 40-50 times before
doing an SL and collecting profit. SO, if you could look-over the logic of the
Trailing Stop function in the EA and find that annoying little + or () or - that
may be out of place, i think Adjustable MA EA will continue to become more and more
profitable for me and others. I took-on another broker this past week and found out that
even they have the same policy of 'no sl or tp at the time that the order itself is placed....'
oyyyy, it's always something! i hope the TS section of the MT4 ADJ. MA EA is still the same as it has been for over a year or more, cause that's the version i've made a life out of, lol----Thank you for it all-----doublebass
 

Enivid

Administrator
Staff member
Nov 30, 2008
19,297
1,529
144
Odesa
www.earnforex.com
I don't exactly understand what happens with TS on Buy orders? Does it produce any errors in the Journal?

BTW, are you sure that the broker's rule is about setting TP/SL with the order? Perhaps, the problem is that TP/SL you are trying to set are too close to the open price?
 

doublebass

Active Trader
Jan 27, 2011
16
2
39
even with these settings i just made-up for an example of what i think is wrong,
the problem should be evident. i have tried other settings and distances for the
trailing stop as well as the minimum distance setting (note that this is generated with the Adjustable MA EA that dosen't yet have the 'MaxDiff' setting, but the trailing stop
function appears to be exactly the same in each of my editions.)

ummm, trades 7 & 10 are perfect examples----i think the way it works is that as soon as
the trade would go 15 pips in the right direction (sell) TS (Trailing Stop) is activated;
if it goes further in the sell direction, TS advances also as far as it can, whereas if the trade comes back UP by 15 pips, its StopLoss is enacted and the trade is closed,
hopefully in-profit. This EA ALSO closes the trade if the MAs cross whilst the trade is
still going-on in some cases. (Perhaps Trades 13, 14 and 15 in the chart) This is Okayyyyyyyy, as long as we can utilize settings that enable the EA to make profit BEFORE the closing, as closes are usually not in-profit.
So, there seems to be something that can be adjusted here to make buys AND sells
equals here as far as the EA's function is concerned. Longs get a 'BUY/modify/modify/modify' result in the tester, with perhaps a 'Order Send Error 4111'
probably because of the Buy-Only setting----'4110' when set for sell-only.
any additional input? i am Right Here! thank you for your help-------doublebass
 

Attachments

  • ef example.gif
    ef example.gif
    56.2 KB · Views: 21