Forex
Google

Go Back   Forex Trading > Downloads > Expert Advisors - Metatrader 4


Register in Forex TSD!
Trading Systems Leaders in this forum (automated trading systems) are winning more than 3000 pips in a month (30000$ investing one lot every time).
Click here to register and get more information

Reply
 
LinkBack (12) Thread Tools Display Modes
  12 links from elsewhere to this Post. Click to view. #1 (permalink)  
Old 01-29-2007, 01:59 AM
C.E.O.'s Avatar
Member
 
Join Date: Nov 2006
Posts: 90
C.E.O. is on a distinguished road
MultixpMA V 1.0.0

Multi-xpMA EA Version 1.0

Multi-xpMA is a creation based on the xpMA indicator designed by Codersguru. I had some initial ideas on how to use this indicator but needed to be able to use more than one. I approached a very generous and gifted coder that goes by the name of Ralph Ronquist. I wanted to design an EA that was the mother of all moving average EA’s. Ralph decided to take on the project and wouldn’t take any money for it and did it for his love of coding. Without him this would still be a concept and can’t thank him enough. He has moved on to other endeavors and left the community with more than a solid foundation to work with. With that said, on to the EA.

Basic abilities

The EA was designed to allow just about any moving average logic to be plugged in. It can be as simple as two moving averages crossing or as complex as six different types and periods of moving averages agreeing with the original xpMA “signal” and another six moving averages “crossing” and they can be from any separate timeframe you desire. The limit is not six by the way, that is just an example. The possibilities are almost infinite.

Settings
I will go through most of the EA settings and then discuss the moving averages xpma.csv file.

TrailingStopType =1,2,3
1 (default) to start trailing at 1*TrailingStop profit,
2 To start trail immediately
3 To limit by high/low of n:th prior candle

TrailingStop
For type 1 and 2, this would be your standard trail behind price by X
For type 3 this will be the number of candles back to use as your stoploss

BreakEvenAfterPips
Self explanatory

CloseMA
NOTE – Defining 0 for CloseMA will equal line one of xpma.csv, 1 would equal line 2 and so on.
This has a few different meanings based on what style of moving average system you are using; signals or crosses. Signals will be used as the first example. In your xpma.csv (more on this later) you have defined three moving averages at periods 10, 20, 30. To place an order, all signals must agree. One exit strategy is to exit on signal change defined by CloseMa. If you were to define CloseMa=0, then at the first opposite signal of the 10 period MA the order would be closed. If you were to define CloseMa=2 the order would be closed on the first opposite signal of the 30 period MA. This would be best used for allowing the MA’s to get you in but let the money management functions get you out.

In the case of a crossing setup the CloseMa would define which cross would close the trade. In this case the value will be which MA must be crossed to close the trade. CloseMa in this case can not =0 as the first MA can not cross itself. A setting of CloseMa=1 would close the trade when the 10 period crosses the 20, and CloseMa=2 would be the 10 period MA crossing the 30.

UseRSIfilter True/False
RSIPeriod Self explanatory
RSIPrice Self explanatory
RSIBUYthreshold A buy only allowed greater than this value
RSISELLthreshold A sell only allowed less than this value

UseCCIfilter True/False
CCIPeriod Self explanatory
CCIPrice Self explanatory
CCIBUYthreshold A buy only allowed greater than this value
CCISELLtreshold A sell only allowed less than this value

UseVolumeFilter True/False
VolumeRange A cumulative value of number of bars back to include
VolumeThreshold A trade only allowed when volume exceeds this parameter

OneEntryPerBar True/False Self explanatory
ReverseTradesOnly True/False When true the trade sequence will be buy-sell-buy-sell-buy-sell, when false consecutive trades in the same direction are allowed

StopLoss Self explanatory
TakeProfit Self explanatory
Slippage Self explanatory


MaxOpenTrade Self explanatory
MinPriceDistance Self explanatory

UseHourTrade True/False;
StartHour Hour to allow trading to begin
End Hour Hour to shut down the EA

Lots Number of lots
MM True/False, use money management or not
AccountIsMicro True/False
DecreaseFactor Decrease lots after loss by this amount
Risk % of capital to use

EnableAlert True/False
EmailAlert True/False



XPMA.CSV
This is the heart of multixpMAEA. It resides in your metatrader installdirectory \tester\files. It consists of a series of 10 numbers with the meanings as follows.
The first 8 numbers are straight from the xpMA indicator as defined by Codersguru.
These are taken directly from XP Works written by Codersguru and all credit goes to him.


TimeFrame: (default 0)
Set it to the time frame you want to work with. The default value is 0 which means it will works with the current time frame of the chart
MA_Period:
The period of the moving average
MA_Type:
The moving average type (Review table 1).
MA_Applied:
The Moving Average Applied price (Review table 2).
T3MA_VolumeFactor:
This setting is for the T3MA indicator only, The Volume Factor
JMA_Phase:
This setting is for the JMA indicator only, The Phase
Step_Period:
How many bars in the history the xpMA indicator will look back to determine the direction of the moving average
Shift:
0 is current bar, 1 previous bar, 2 previous bar to 1, etc.
Moving Average Type Constant name Integer value
Simple moving average MODE_SMA 0
Exponential moving average MODE_EMA 1
Smoothed moving average MODE_SMMA 2
Linear weighted moving average MODE_LWMA 3
Double Exponential Moving Average MODE_DEMA 4
Triple Exponential Moving Average MODE_TEMA 5
T3 Moving Average MODE_T3MA 6
Jurik Moving Average MODE_JMA 7
Hull Moving Average MODE_HMA 8
DECEMA Moving Average MODE_DECEMA 9
SALT indicator MODE_SALT 10


Applied Price type Constant name Integer value
Close price. PRICE_CLOSE 0
Open price. PRICE_OPEN 1
High price. PRICE_HIGH 2
Low price. PRICE_LOW 3
Median price, (high+low)/2. PRICE_MEDIAN 4
Typical price, (high+low+close)/3. PRICE_TYPICAL 5
Weighted close price, (high+low+close+close) PRICE_WEIGHTED 6

The last 2 values are as follows.

SignalType
type = 1 tells that this MA provides its agreement signal by means of
line direction being upwards or downwards, as indicated by the red and blue
line colors; This is what defines the system as a signal system
* type = 2 tells that this MA provides its agreement signal by means of its
value being above or below the value of the preceding type 2 MA; This is what defines the system as a cross system
* type = 0 (or anything else) tells that this MA always agrees.

Span
"span" is used for type 1 MA to make it stop agreeing after that many bars of the
same direction. span = 0 means "no span limit".

So what you end up with is an xpma.csv file that will look like so..


Timeframe Period MA Type MA Applied T3 Volume Jma Phase StepPeriod Shift Signaltype Span
0 50 8 0 0.8 0 1 0 1 0


Examples of xpma.csv

The following would be the signal setup in the beginning of this document. A 10, 20, 30 “signal” for buy or sell.
0 10 8 0 0.8 0 1 0 1 0
0 20 8 0 0.8 0 1 0 1 0
0 30 8 0 0.8 0 1 0 1 0

Set your CloseMa to close the order on the 10 period =0, the 20 period =1, or the 30 period =2.
If you would like a confirm on entry, simply change one or all of your shift values to 1

We will use the same example except use a “cross” system.

0 10 8 0 0.8 0 1 0 2 0
0 20 8 0 0.8 0 1 0 2 0
0 30 8 0 0.8 0 1 0 2 0


Simply change the 1 of signaltype to 2 and the values of the moving average are taken rather than the line directions.

It is possible to use both a cross and signal by combining both the above .csv settings. Use your imagination, make a rainbow.

At this point I believe that is enough documentation to get started. As questions arise I will update.
Attached Files
File Type: ex4 MultixpMAEAV1.0.0.ex4 (25.9 KB, 601 views)
File Type: mq4 xpMA.mq4 (16.3 KB, 624 views)
File Type: rar xpmacsv.rar (115 Bytes, 642 views)
File Type: doc Multi.doc (54.0 KB, 788 views)
File Type: mq4 MultixpMAEAV1.0.0.mq4 (27.7 KB, 267 views)

Last edited by C.E.O.; 08-19-2007 at 02:13 PM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 01-29-2007, 01:59 AM
C.E.O.'s Avatar
Member
 
Join Date: Nov 2006
Posts: 90
C.E.O. is on a distinguished road
Goals for version 1.0
1) Get rid of the bugs!
At this point I believe most of the bugs have been stomped out, but I am sure I haven’t tested every feature thoroughly.

2) Find a new lead coder. Ralph has moved on to other things. Please at this point only a senior or trusted member. PM me if interested.

3)Begin taking suggestions for future filter additions, confirming indicators, etc. With a moving average system, it is all about minimizing the whipsaw. Possible indicators would be based on volumes, chopzone, CCIfilter, absolutestrength, and so on. This is a well thought out system and adding filters is quite easy.

4) Add additional money management features such as scaling in/out, more trail types, etc.

If done correctly, there will not be a need for anyone to ever develop another MA EA. That was the goal starting out, and it is still the goal.

Now, let me get this out there. Yes it is an .ex4 file. AT THIS TIME, this is all I want to release. Here is my reasoning. I don’t want this to turn into 30 different variations and get chewed up into unrecognizable code. THE SOURCE WILL BE RELEASED once all bugs haven been removed, a standard set of filters are in place, and it is agreed upon that no more major changes will be required. That is it. I don’t or won’t ever try to sell or profit off this thing as it is not my coding in the first place. It is simply to control versions until final.

Now, go find some good settings 
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 01-29-2007, 04:57 PM
Junior Member
 
Join Date: Sep 2006
Posts: 1
caster60 is on a distinguished road
2007.01.29 18:47:23 2006.01.05 19:00 Cannot open file 'C:\Programmi\Metatrader 4 Velocity Trader\experts\indicators\HMA.ex4' on the EURUSD,M30

Hi to everybody,
during the tests, the program asks for the file HMA in the indicator folder.
Where can I find it?

Thanks.

Caster60
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 01-29-2007, 10:11 PM
Senior Member
 
Join Date: Jun 2006
Posts: 326
fxnewbie is on a distinguished road
Quote:
Originally Posted by caster60
2007.01.29 18:47:23 2006.01.05 19:00 Cannot open file 'C:\Programmi\Metatrader 4 Velocity Trader\experts\indicators\HMA.ex4' on the EURUSD,M30

Hi to everybody,
during the tests, the program asks for the file HMA in the indicator folder.
Where can I find it?

Thanks.

Caster60
Here it is
Attached Files
File Type: mq4 HMA.mq4 (2.6 KB, 324 views)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 01-30-2007, 10:28 AM
Junior Member
 
Join Date: Sep 2005
Posts: 20
GKBBRIA is on a distinguished road
.......... deleted ..............

Last edited by GKBBRIA; 01-31-2007 at 10:07 AM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 01-31-2007, 05:26 AM
Junior Member
 
Join Date: Dec 2006
Posts: 3
nito2721 is on a distinguished road
Great EA, but...

Sounds like a great EA, but I couldnt get it started to test it. I like the jma being in there.

"2007.01.30 22:22:40 2006.10.01 21:00 xpMA USDJPY,H4: SetIndexBuffer function must be called from custom indicator only"

Any ideas?

NVM. Got it now. Was using wrong file. Thanks alot. Let you know when Im done checking it out.

Last edited by nito2721; 01-31-2007 at 05:34 AM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7 (permalink)  
Old 04-18-2007, 12:34 PM
Senior Member
 
Join Date: Dec 2005
Posts: 294
mikejody is on a distinguished road
What Settings?

Wow, Nice work on this!

It would be nice if someone could post the exact settings they would use on this, and I would be glad to test it; I just can't figure out what settings to use to develop any meaningful system.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #8 (permalink)  
Old 04-18-2007, 01:01 PM
Member
 
Join Date: Jan 2007
Posts: 36
RandyG67 is on a distinguished road
Speaking of settings....HOW/WHERE do you make the changes?

Do you attach the Indicator to the chart with your desired settings and THEN start the EA? Or do you access the EA (and how do you do this?), make the changes within the EA and then start the EA?

When right-clicking the EA in the Navigator I see options to Attach To A Chart and to Modify.

Randy
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #9 (permalink)  
Old 04-18-2007, 02:46 PM
Member
 
Join Date: Jan 2007
Posts: 36
RandyG67 is on a distinguished road
Disregard above post

Ahh, found where to adjust settings.

Away we go........
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #10 (permalink)  
Old 04-18-2007, 10:26 PM
Senior Member
 
Join Date: Dec 2005
Posts: 294
mikejody is on a distinguished road
Let's get some testers sharing their settings so we can join in and test this wonderful EA. Any testers here?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Bookmarks


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump

LinkBacks (?)
LinkBack to this Thread: http://www.forex-tsd.com/expert-advisors-metatrader-4/5712-multixpma-v-1-0-0-a.html
Posted By For Type Date
2 EMA EA, ale nie Cross!! This thread Refback 12-22-2007 09:25 PM
2 EMA EA, ale nie Cross!! This thread Refback 12-22-2007 03:38 PM
2 EMA EA, ale nie Cross!! This thread Refback 12-11-2007 12:43 PM
2 EMA EA, ale nie Cross!! This thread Refback 12-10-2007 02:35 PM
2 EMA EA, ale nie Cross!! This thread Refback 12-10-2007 02:19 PM
2 EMA EA, ale nie Cross!! This thread Refback 12-09-2007 09:45 AM
2 EMA EA, ale nie Cross!! This thread Refback 12-09-2007 09:04 AM
2 EMA EA, ale nie Cross!! This thread Refback 12-09-2007 06:25 AM
2 EMA EA, ale nie Cross!! This thread Refback 12-09-2007 02:15 AM
informacje nowosci » Blog Archive » Forex - systemy i strategie :: RE: 2 EMA EA, ale nie Cross!! This thread Pingback 12-08-2007 08:03 PM
2 EMA EA, ale nie Cross!! This thread Refback 12-08-2007 07:12 PM
2 EMA EA, ale nie Cross!! This thread Refback 12-08-2007 06:41 PM


All times are GMT. The time now is 07:13 AM.



Search Engine Friendly URLs by vBSEO 3.2.0 ©2008, Crawlability, Inc.