Forex



Go Back   Forex Trading > Discussion Areas > Suggestions for Trading Systems
Forex Forum Register More recent Blogs Calendar Advertising Others Help






Register
Welcome to Forex-TSD!, one of the largest Forex forums worldwide, where you will be able to find the most complete and reliable Forex information imaginable.

From the list below, select the forum that you want to visit and register to post, as many times you want. It’s absolutely free. Click here for registering on Forex-TSD.

Exclusive Forum
The Exclusive Forum is the only paid section. Once you subscribe, you will get free access to real cutting-edge Trading Systems (automated and not), Indicators, Signals, Articles, etc., that will help and guide you, in ways that you could only imagine, with your Forex trading.
  • Elite Section
    Get access to private discussions, specialized support, indicators and trading systems reported every week.
  • Advanced Elite Section
    For professional traders, trading system developers and any other member who may need to use and/or convert, the most cutting-edge exclusive indicators and trading systems for MT4 and MT5.
See more

Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old 10-27-2009, 03:30 AM
fxrulez's Avatar
Member
 
Join Date: May 2009
Location: Melbourne, Australia
Posts: 32
fxrulez is on a distinguished road
Thumbs up MAAngle Indicator

Greetings everyone,

Ive been doing some research on the Moving Average Indicator a.k.a (MAAngle Indicator) and i came across this site that has the coding/programming for the indicator.

Ive heard from several other successful trading systems that the MAAngle indicator is 80% of the time precise in determining the trend of markets on different TF's and comparing them...Is anyone here able to program this into a working indicator ..

Thanks

Here is the code exactly as it is on the website:

--------------------------------------------------------------------------

//+------------------------------------------------------------------+
//| MAAngle.mq4 |
//| original jpkfox |
//| edited by dariuske |
//| You can use this indicator to measure when the MA angle is |
//| "near zero". AngleTreshold determines when the angle for the |
//| EMA is "about zero": This is when the value is between |
//| [-AngleTreshold, AngleTreshold] (or when the histogram is red). |
//| MAMode : 0 = SMA, 1 = EMA, 2 = Smoothed, 3 = Weighted |
//| MAPeriod: MA period |
//| AngleTreshold: The angle value is "about zero" when it is |
//| between the values [-AngleTreshold, AngleTreshold]. |
//| StartMAShift: The starting point to calculate the |
//| angle. This is a shift value to the left from the |
//| observation point. Should be StartEMAShift > EndEMAShift. |
//| StartMAShift: The ending point to calculate the |
//| angle. This is a shift value to the left from the |
//| observation point. Should be StartEMAShift > EndEMAShift. |
//| |
//| Modified by MrPip |
//| Red for down |
//| Yellow for near zero |
//| Green for up |
//| 10/15/05 MrPip |
//| Corrected problem with USDJPY and optimized code |
//| 10/23/05 Added other JPY crosses |
//| |
//| |
//| |
//| 12/01/07 Dariuske: Changed code for SMA50 (PhilNelSystem) |
//| 18/01/07 Dariuske: Changed code for multiple mode MA's |
//+------------------------------------------------------------------+

#property copyright "jpkfox"
#property link "http://www.strategybuilderfx.com/forums/showthread.php?t=15274&page=1&pp=8"
//---- indicator settings
#property indicator_separate_window
#property indicator_buffers 3
#property indicator_color1 LimeGreen
#property indicator_color2 FireBrick
#property indicator_color3 Yellow
//---- indicator parameters
extern int MAMode = 0;
extern int MAPeriod=50;
extern int Price=4;
extern double AngleTreshold=0.25;
extern int StartMAShift=2;
extern int EndMAShift=0;


//---- indicator buffers
double UpBuffer[];
double DownBuffer[];
double ZeroBuffer[];

//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init()
{
//---- 2 additional buffers are used for counting.
IndicatorBuffers(3);
//---- drawing settings
SetIndexStyle(0,DRAW_HISTOGRAM,STYLE_SOLID,4);
SetIndexStyle(1,DRAW_HISTOGRAM,STYLE_SOLID,4);
SetIndexStyle(2,DRAW_HISTOGRAM,STYLE_SOLID,4);

IndicatorDigits(MarketInfo(Symbol(),MODE_DIGITS)+2 );

//---- 3 indicator buffers mapping
if(!SetIndexBuffer(0,UpBuffer) &&
!SetIndexBuffer(1,DownBuffer) &&
!SetIndexBuffer(2,ZeroBuffer))
Print("cannot set indicator buffers!");
//---- name for DataWindow and indicator subwindow label
//IndicatorShortName("MAAngle("+MAPeriod+","+AngleTr eshold+","+StartMAShift+","+EndMAShift+")");
IndicatorShortName("MAAngle");
//---- initialization done
return(0);
}
//+------------------------------------------------------------------+
//| The angle for EMA |
//+------------------------------------------------------------------+
int start()
{
double fEndMA, fStartMA;
double fAngle, mFactor, dFactor;
int nLimit, i;
int nCountedBars;
double angle;
int ShiftDif;
string Sym;

if (MAMode >= 4) MAMode = 0;

if(EndMAShift >= StartMAShift)
{
Print("Error: EndMAShift >= StartMAShift");
StartMAShift = 6;
EndMAShift = 0;
}

nCountedBars = IndicatorCounted();
//---- check for possible errors
if(nCountedBars<0)
return(-1);
//---- last counted bar will be recounted
if(nCountedBars>0)
nCountedBars--;
nLimit = Bars-nCountedBars;
dFactor = 2*3.14159/180.0;
mFactor = 10000.0;
Sym = StringSubstr(Symbol(),3,3);
if (Sym == "JPY") mFactor = 100.0;
ShiftDif = StartMAShift-EndMAShift;
mFactor /= ShiftDif;
//---- main loop
for(i=0; i<nLimit; i++)
{
fEndMA=iMA(NULL,0,MAPeriod,0,MAMode,Price,i+EndMAS hift);
fStartMA=iMA(NULL,0,MAPeriod,0,MAMode,Price,i+Star tMAShift);
// 10000.0 : Multiply by 10000 so that the fAngle is not too small
// for the indicator Window.
fAngle = mFactor * (fEndMA - fStartMA)/2.0;
//fAngle = MathArctan(fAngle)/dFactor;

DownBuffer[i] = 0.0;
UpBuffer[i] = 0.0;
ZeroBuffer[i] = 0.0;

if(fAngle > AngleTreshold)
UpBuffer[i] = fAngle;
else if (fAngle < -AngleTreshold)
DownBuffer[i] = fAngle;
else ZeroBuffer[i] = fAngle;
}

return(0);
}
//+------------------------------------------------------------------+





Here is the link to the site directly if that helps...

http://www.abysse.co.jp/mt4/indicators/MAAngle.mq4

Thanks a lot
Fxrulez
__________________
"Happy Pip Collecting
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #2 (permalink)  
Old 10-27-2009, 03:51 AM
cja's Avatar
cja cja is offline
Senior Member
 
Join Date: Apr 2006
Posts: 676
cja is on a distinguished road
MA Angle

[quote=fxrulez;312601]Greetings everyone,

Ive been doing some research on the Moving Average Indicator a.k.a (MAAngle Indicator) and i came across this site that has the coding/programming for the indicator.

Ive heard from several other successful trading systems that the MAAngle indicator is 80% of the time precise in determining the trend of markets on different TF's and comparing them...Is anyone here able to program this into a working indicator ..

Thanks

All the code was there it just had a couple of gaps that should not have been in the code which prevented it compiling, i have altered the Bar width code so that it can be user adjusted without going into the source.

I just had another look at the MA Angle indicator and added a MTF code to it, i think it is working alright however get back to me if you have any problems.

MA Angle.mq4

MA Angle MTF.mq4

ma angle.gif
__________________
My Disadvantage is that I am not a Trained Programmer - My Advantage is that I am not a Trained Programmer.
http://cjatradingtools.com/

Last edited by cja; 10-27-2009 at 04:15 AM. Reason: added indicator
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #3 (permalink)  
Old 10-27-2009, 05:22 AM
fxrulez's Avatar
Member
 
Join Date: May 2009
Location: Melbourne, Australia
Posts: 32
fxrulez is on a distinguished road
cja

That was really fast. Thanks a lot for that...Will test it out now...

Cheers
__________________
"Happy Pip Collecting
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #4 (permalink)  
Old 11-07-2009, 03:55 PM
Senior Member
 
Join Date: May 2007
Posts: 294
ServerUang is on a distinguished road
Thank you very much cja, as always, you are the man


ServerUang
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #5 (permalink)  
Old 11-07-2009, 06:32 PM
Junior Member
 
Join Date: Oct 2009
Posts: 9
Tradesperson is on a distinguished road
Props to cja and fxrulez, this indicator is great! Does a great job of simplifying the measurement of the angle to filter bad signals, a jewel for MA cross strategies.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #7 (permalink)  
Old 11-08-2009, 01:30 AM
xx3xxx's Avatar
Senior Member
 
Join Date: Sep 2008
Posts: 411
xx3xxx is on a distinguished road
what are bad signals

the illustration does not make it easier for us to see
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #8 (permalink)  
Old 11-08-2009, 04:53 AM
cja's Avatar
cja cja is offline
Senior Member
 
Join Date: Apr 2006
Posts: 676
cja is on a distinguished road
??????

Quote:
Originally Posted by xx3xxx View Post
what are bad signals

the illustration does not make it easier for us to see
Don't you mean

the illustration does not make it easier for ME to see

Have you considered what the Yellow areas mean???
Have you tried adjusting the inputs to see how it works???
__________________
My Disadvantage is that I am not a Trained Programmer - My Advantage is that I am not a Trained Programmer.
http://cjatradingtools.com/
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #9 (permalink)  
Old 11-08-2009, 04:54 AM
matfx's Avatar
Senior Member
 
Join Date: Sep 2007
Posts: 510
Blog Entries: 3
matfx is on a distinguished road
Looks promising, thanks CJA.
Attached Images
File Type: gif ma angle.gif (79.4 KB, 28 views)
__________________
MY TRADING BLOG

Last edited by matfx; 11-08-2009 at 04:57 AM. Reason: Wrong pic.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #10 (permalink)  
Old 11-08-2009, 08:26 AM
Junior Member
 
Join Date: Oct 2009
Posts: 9
Tradesperson is on a distinguished road
Quote:
Originally Posted by xx3xxx View Post
what are bad signals

the illustration does not make it easier for us to see
Everything depends on the settings - the MA, the time period you're using and the threshold you have set, along with your own vision.

In MA cross strategies, bad signals are crosses when MAs have a very small angle, which indicates a non-trending market.

Here's a quick example...
Attached Images
File Type: jpg maangle.jpg (252.8 KB, 40 views)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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 Off
Forum Jump


All times are GMT. The time now is 02:45 PM.



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