Adjustable MA

koookooo

Active Trader
May 24, 2010
3
1
32
Magic Number

Hi , I am using the EA on multiple currency pairs on the 5 minute chart; does the code generate a unique magic number for each pair? no trades so far so I am not sure - the backtests were very nice, now testing on my demo - thanks a lot for a great EA!!
 
  • 👍
Reactions: shralson22

Enivid

Administrator
Staff member
Nov 30, 2008
18,532
1,355
144
Odesa
www.earnforex.com
Hi , I am using the EA on multiple currency pairs on the 5 minute chart; does the code generate a unique magic number for each pair? no trades so far so I am not sure - the backtests were very nice, now testing on my demo - thanks a lot for a great EA!!
It doesn't even have to use different Magic numbers if you trade on different pairs. It normally detects the currency pair of the order/position, so it won't mess up if you attach it to several currency pairs. Magic number is only used if you attach several EAs to one currency pairs or this EA to several timeframes of the same currency pair.
 

alexm3388

Active Trader
Jul 13, 2010
1
0
32
MA method

Hi,

this advisor works well while trading live although I would like to tweak it a bit by changing the MA method.By default it's set to "1". I'm just curious what does "1" stand for- exponential,weighted or simple moving average?Thanks.
 

aaron_pm

Active Trader
Oct 15, 2010
4
0
32
Hello, I find it quite interesting, although so far not opened any operation, I can do to make my transactions automatically opening
 

Enivid

Administrator
Staff member
Nov 30, 2008
18,532
1,355
144
Odesa
www.earnforex.com
Hello, I find it quite interesting, although so far not opened any operation, I can do to make my transactions automatically opening
What version do you use - MT4 or MT5?
What timeframe and currency pair do you use?
Did you change input periods?
How many digits after dot does your broker's quote have?
Are there any errors in the Experts or Journal log?
 

aaron_pm

Active Trader
Oct 15, 2010
4
0
32
Good day, the asesor seems a wonderful tool setting the parameters, however in practice I notice mistakes at the time of crossing, in some occasions when activated crossing signal that goes up (buy) but not close which goes down (sell) or contrary, to reverse. ... I greatly appreciate the correct way if you change any parameter, or definitely is wrong from EA...

use MT4 Advisor within 5 minutes charts IN EUR/USD
 

aaron_pm

Active Trader
Oct 15, 2010
4
0
32
in conclusion, I want to do what you indicate in your description ."""This expert advisor always opens position on cross and closes it on the next cross""""".
.. to open the operation cierrre the other .... this happens to me more often when the crossing is faster in a short time line, I remember that I operate in charts 5 min.
 

Enivid

Administrator
Staff member
Nov 30, 2008
18,532
1,355
144
Odesa
www.earnforex.com
in conclusion, I want to do what you indicate in your description ."""This expert advisor always opens position on cross and closes it on the next cross""""".
.. to open the operation cierrre the other .... this happens to me more often when the crossing is faster in a short time line, I remember that I operate in charts 5 min.
There are two possibilities when it won't act on cross:
1. It trades only on new bar opening. So, if the cross appear only during the period but the bar closes without cross, it won't do anything.
2. It won't count a cross as a real cross if the difference between the MAs is less than MinDiff (input parameter), which 3 pips by default.
 

Enivid

Administrator
Staff member
Nov 30, 2008
18,532
1,355
144
Odesa
www.earnforex.com
This is the error or what experts say ... ADJUSTABLE_MA EURUSD, M5: 138
OrderSend Error 138 is a Requote error. Either you are using default 3 pips Slippage with 6-digit quote broker or you've set the Slippage parameter too low for orders to open without requotes.

Update: Actually, no - the first possibility isn't valid, as the EA adjusts input parameters to fit fractional pips if broker is using 6-digit quotes. So, just try increasing your Slippage parameter to 5 or 10.
 

Olmeri

Trader
Dec 15, 2010
4
0
12
The EA is not making any trades at all when backtesting (M5, EURUSD, default EA settings). Has anyone else tried the MT5 version and had it work?

Here is a log file from another run. Does anyone know what seems to be the problem, or even better how to solve it? ;)

OO 0 Core 1 13:36:59 EURUSD,M5: testing of Experts\Advisors\Adjustable_MA.ex5 from 2010.12.01 00:00 to 2010.12.14 00:00 started with inputs:
MP 0 Core 1 13:36:59 Lots=0.10
JM 0 Core 1 13:36:59 StopLoss=100
PJ 0 Core 1 13:36:59 TakeProfit=70
DD 0 Core 1 13:36:59 TrailingStop=0
RM 0 Core 1 13:36:59 Slippage=3
QD 0 Core 1 13:36:59 Period_1=20
DH 0 Core 1 13:36:59 Period_2=17
MN 0 Core 1 13:36:59 MA_Method=1
NR 0 Core 1 13:36:59 MinDiff=3
DD 2 Core 1 13:37:01 2010.12.02 14:55:00 failed instant sell 0.10 EURUSD at 1.30820 sl: 1.31820 tp: 1.30120 [Unsupported filling mode]
QJ 0 Core 1 13:37:01 2010.12.02 14:55:00 Incorrect Request/Result Structure when Buying.
MN 2 Core 1 13:37:01 2010.12.02 16:35:00 failed instant buy 0.10 EURUSD at 1.31951 sl: 1.30951 tp: 1.32651 [Unsupported filling mode]
OI 0 Core 1 13:37:01 2010.12.02 16:35:00 Incorrect Request/Result Structure when Selling.
GR 2 Core 1 13:37:03 2010.12.06 11:50:00 failed instant sell 0.10 EURUSD at 1.32644 sl: 1.33644 tp: 1.31944 [Unsupported filling mode]
CS 0 Core 1 13:37:03 2010.12.06 11:50:00 Incorrect Request/Result Structure when Buying.
GP 2 Core 1 13:37:10 2010.12.13 13:15:00 failed instant buy 0.10 EURUSD at 1.32773 sl: 1.31773 tp: 1.33473 [Unsupported filling mode]
FS 0 Core 1 13:37:10 2010.12.13 13:15:00 Incorrect Request/Result Structure when Selling.
FD 0 Core 1 13:37:10 OnTester result 0
LQ 0 Core 1 13:37:10 EURUSD,M5: 771935 ticks (2570 bars) generated within 11312 ms (total bars in history 143698, total time 11640 ms)
 
Last edited:

Enivid

Administrator
Staff member
Nov 30, 2008
18,532
1,355
144
Odesa
www.earnforex.com
The EA is not making any trades at all when backtesting (M5, EURUSD, default EA settings). Has anyone else tried the MT5 version and had it work?

Here is a log file from another run. Does anyone know what seems to be the problem, or even better how to solve it? ;)

Yes, there was such problem. It looks like they've changed the order processing in the latest builds of MT5. I've fixed the error. Please, re-download new version of the EA. It should be working properly now. Please, report if it's not.
 

Olmeri

Trader
Dec 15, 2010
4
0
12
Yes, there was such problem. It looks like they've changed the order processing in the latest builds of MT5. I've fixed the error. Please, re-download new version of the EA. It should be working properly now. Please, report if it's not.

Hi, and great thanks for looking into the problem! It seems that you fixed the problem with buying but there seems to be a similar problem with selling as I am getting these messages in the Strategy Testers Journal:

...
2010.12.16 10:05:26 Core 1 2009.04.23 06:48:33 failed modify sell 0.10 EURUSD sl: 1.34676, tp: 1.23476 -> sl: 1.30048, tp: 1.23476 [Invalid stops]
2010.12.16 10:05:26 Core 1 2009.04.23 06:48:29 Incorrect Request/Result Structure when Selling.
2010.12.16 10:05:26 Core 1 2009.04.23 06:48:29 failed modify sell 0.10 EURUSD sl: 1.34676, tp: 1.23476 -> sl: 1.30055, tp: 1.23476 [Invalid stops]
2010.12.16 10:05:26 Core 1 2009.04.22 21:20:16 failed modify sell 0.10 EURUSD sl: 1.34676, tp: 1.23476 -> sl: 1.30218, tp: 1.23476 [Invalid stops]
2010.12.16 10:05:26 Core 1 2009.04.22 21:20:14 Incorrect Request/Result Structure when Selling.
...

Do you think you know whats causing it?
 

Olmeri

Trader
Dec 15, 2010
4
0
12
Ok, this is probably the problem then. The setting is 1... It was derived from an optimization run (2 years USDEUR). However I stopped it half way. I will try to do another optimization run on only trailing stop and see what it comes up with.
 

Olmeri

Trader
Dec 15, 2010
4
0
12
Jep, my bad. Turning the trailing stop off produced the same result. Thank you again.

EDIT: What I ment by that was that it produced the same profit but without the errors...
 
Last edited:

doublebass

Active Trader
Jan 27, 2011
16
2
39
New Setting for Adjustable MA EA

On a $10,000 practice account, Metatrader 4,
5-Minute, Euro/USDollar,
--USD Long + Short in the testing/inputs windows--,
with no additional tweaking or changes to the below settings, the results were rather impressive from a testing standpoint and i looked at the journal for once and saw no errors or conflicts to be concerned about:

Lots=0.01
StopLoss=0 (set at 0, leave unchecked)
TakeProfit=0 (set at 0, leave unchecked)
TrailingStop=0 (set at 0, leave unchecked)
Slippage=0 (set at 0, checked)
Period_1=30
Period_2=28
MA_Method=3 (Linear Weighted Setting)
MinDiff=1

Bear in mind that the results will be different between a Practice Account tester and a Live Account tester because (on my Forex.com account, anyway) the data only goes back just so far on each because of the smaller
(5-minute) timeframe. Compare results and enjoy this setting, as it is the best one i have seen yet on an EA that opens and closes based on the MAs crossing--
(294 Trades/$67 Maximal Drawdown/$359.20 Profit, just since 04-23-'10 to present day 1-28-'10 on my live account's tester.) PS-Check 'Visual mode' on your tester, put the slider all the way to the right and click on 'start' for a wild ride seeing the trades 'as they happen'. Play with the settings.
I myself have not yet run it live, as my self-traded account is about done-for, hence the NEED for an effective EA. Nor was i able to make any practice $$ with the default settings, but that could just be me;
If this works for anyone i'll post my 1-minute setting another time,
and keep adjusting in the meantime--- doublebass