Adjustable MA

doublebass

Active Trader
Jan 27, 2011
16
2
39
oopsie!

i just typed-out a super-explanatory monster message with a ton of
details 4 U but i inadvertently hit the close button at the top right
of the .gif image and it closed EvEryThinG on me. i'll never learn!
DOH!!! i had copied in-order to paste most of it---I'm saved!:
**********************************************
ahem:
i should have mentioned(!)
ummm, the settings for the test were at the top of the attached
.gif image, (here again), and also:

.01 lots
SL=0
TP=0
TrailingStop=15
Slippage=0
Period_1= 3
Period_2= 33
MA_Method=2
MinDiff=0

i hope these settings point-out the problem for you.
EU/US 1-hour timeframe
tested from 1-01-11 through 10-17-11.
MinDiff is at 0 to facilitate easy testing, but might also
be a valid setting once this alleged bug is fixed.
The chart is an example of short-only, because THAT is
where i am having trouble and my brain is only handling one chart
at a time today, lol! A longs chart will probably look fabulous.

***there are also instructions on the chart; it is short-only because
that is what i'm having the problem with. use the same settings but do
'only long' and that should work well; trades 7 and 10 should have bottomed-out and taken profit very early-on but were made to hang-in-there until the next cross of 0 occurred. better settings will cure the same problem for the other trades on that chart (like 13,14 and 15).

Since i had to do this over again, i added a long-only chart as well as a graph long-only. these are with almost randomly-thought-up settings. a good day!
please be sure to click on them once you see the + sign to enlarge the images.

FYI---the test results that work....have a modeling quality of 90%!!!
i haven't seen an EA yet that has that # reliably.
imagine that on short trades as well---OMG.
---anything else, will be watching-----THX!
 

Attachments

  • ef example.gif
    ef example.gif
    56.2 KB · Views: 40
  • ef example long-only .gif
    ef example long-only .gif
    63.8 KB · Views: 38
  • LONG-ONLY INCENTIVE.gif
    LONG-ONLY INCENTIVE.gif
    5.4 KB · Views: 34

Enivid

Administrator
Staff member
Nov 30, 2008
18,533
1,355
144
Odesa
www.earnforex.com
Found the bug :). Instead of re-downloading the EA, you can find the following line in the code:

MQL4:
               if (OrderStopLoss() > (Ask + TrailingStop * Poin)) //If the current stop-loss is below the desired trailing stop level

And replace it with this line:

MQL4:
               if ((OrderStopLoss() > (Ask + TrailingStop * Poin)) || (OrderStopLoss() == 0)) //If the current stop-loss is below the desired trailing stop level
 
Last edited:

doublebass

Active Trader
Jan 27, 2011
16
2
39
THANKS! 'too bad' work has been very busy today and late yesterday;
it cuts-into my Forex research time! it'll be worth it---i am presently working with
a version of the EA that never closes the trades, (I used to use a TP of about 10)
but now that TS is working, i set that for 5 and just get-along with the profits (and, super-low drawdown!) that come from it. i will undoubtedly be venturing further
with the new TS capability on the normal version and reporting results here---
Thanks Again! db
 

doublebass

Active Trader
Jan 27, 2011
16
2
39
works very well

hey!
...i just deleted my life story, so you can thank me for that!

..."okay, enough ranting---here is an attached .gif image of a new setting that utilizes the long and short of it on the Euro/USD
chart----

****the settings are at the top of the chart*****

if you are using the latest edition with MaxDiff as a setting, set that to Zero.

NOW, if you don't know how to modify an EA, simply set the tester for
Long-Only trades because this chart was generated AFTER i had made the Trailing Stop functional for sells per the recent bug-fix. The results are the same chart-wise, just only half as many trades.
unless you have all day and night to try to optimize it further (with THESE general settings, i mean), try not to do it, lol, as i have been at it myself the last few hours----the setting of MinDiff @ 120 is right in the ball park---
if you go to 140 you get drawdown big time, and the same down @ 110.
Set it too close to the longer MA and trades don't get a good-enough foothold.
I would, however, tinker with the Trailing Stop setting----i keep it at 5 just so i don't ever have to use an actual TakeProfit, as my broker doesn't allow TPs or SLs to be placed along-with an order.
i am eager to try this setting on many other pairs, including, get this,
Wheat, Sugar and Soybeans?" That'll be interesting!
PS---i could not get any reliable profit from the MaxDiff function, with or without the Trailing Stop enacted. i COULD, but not anything like the setting provided here, so, best leave that at zero.
i am sure there are dozens of other settings 2 B found----have a nice day-------
db
 

doublebass

Active Trader
Jan 27, 2011
16
2
39
here's that chart

i am sure i had it ready to go with the original message, but, well, who knows.
enjoy----db
 

Attachments

  • ef example h1 euus l+s .gif
    ef example h1 euus l+s .gif
    31.1 KB · Views: 33

forex560

Trader
May 23, 2012
5
0
12
Adjustable_MA - not working

I just can not seem to get the Adjustable_MA EA to open any trades...

I've done all the basic stuff - allow DLL imports etc, etc. I've got the smiley face...

But when the fast EMA crosses the slow EMA it just doesn't do anything!

I've put the slippage up to 10 and the MinDiff down to 1 - still nothing.

I have it on the AUD/USD M5
stop loss: 30
Take profit: 50
Trailing Stop: 20
P1: 50
P2: 10

Use MM: false
Lots Per 10000: 1.0

I've also tried it on other pairs, time periods and settings, but to no avail!

What am I doing wrong???! Pleeeeease help :confused:
 

forex560

Trader
May 23, 2012
5
0
12
I've figured out the problem... In order for this EA to work with my broker I have to put SL, TS and TP values to zero, because it will not process market execution order with a SL or TP.

Is it possible to have the EA manage SL, TP and Trailing stop internally? Rather then try and place them with the order?

(I'm having the same problem with a few other Ea's from this site as well)
 

forex560

Trader
May 23, 2012
5
0
12
I just worked out that I can use the trailing stop function. Sorry, I'm used to robots that you have to pay for, do everything for you and are completely useless hehe. I'm liking the adjustable MA - much better then any EA I've used before.
 

kullc

Trader
Nov 30, 2013
1
0
12
Im trying to edit the Adjustable MA.

In the Inputs tab what is Period_1, MA_Method, Min Diff, etc? There’s no explanation of what some of these variables do.
 

Enivid

Administrator
Staff member
Nov 30, 2008
18,533
1,355
144
Odesa
www.earnforex.com
Period_1 and Period_2 are the periods of the moving averages used by the EA.
MA_Method is the type of moving averages (simple, exponential, weighted, etc.)
Min_Diff is the minimum difference between two MAs before consider a crossing.

Most of the input parameters are explained inside the MQL code of the EA.
 

tgee

Active Trader
Nov 6, 2011
2
0
32
Hi Enivid, I really like this Adjustable MA, sometime when MA not cross yet(say it open position Buy), but MT4 already close the Buy position, then EA open Sell position then the trend changed to bullish. When I use stoploss, after SL reached, the EA can not open position until next cross.
So can you update the EA, after stoploss touched, then EA will open buy automatically. Thank you