EMA with alert? - page 2

sticks
3
sticks  

MA Touch and reverse EA

Has anyone noticed how price repels offthe 200ma on the first touchof it after price had previously moved a good distance from it and returned.

I have found this to be a very good signal on all time frames and especially on the 5m 15m and 1hr charts.

Even if price intends to move through the 200ma it will always come back to find support on it and then move on. This makes for 2 out of 3 successful trades generally if profit targets are set resonably small. Let's say twice the risk. 10 pips risk and 20 pips profit on a 5 min chart. Larger time frames afford better profit targets with about 10 or 15 pip risk as well.

Traders respect these barriers and typically take profits on countertrend bounces and pullbacks.

The conditions would include no recent touch of a falling 200ma for at least 20 bars to set up a first touch senario triggering a market sell order on a rising price cross. Use a stop loss above the 200ma and a trailing stop to lock in profit along with a profit target. The opposite conditions would be the case with a rising 200ma and falling price.

Unfortunately I don't know how to code this but my hunch is it would be pretty simple compared to many other EAs created here. I do understand that coding any program is not a simple task. I code PLC logic but that is very different.

If there is anyone that sees the value in this simple methodology maybe, they could take a shot at coding it for us all.

Multiple MA cross methods are so often whipsawed because of the late entry.

Or maybe some one is aware of an EA here that is already capable doing what I have described. If so please respond. I'll promise to test and share the results here.

Sticks

pointernet
6
pointernet  

Hi!

Does anyone know of an indicator that alerts when price is out, or cross a specified level line of (variable) period EMA?

I would like an alert, when the price cross the EMA level(s) (EMA "+" or "-" Xpips).Look at the picture!

I have searched but can't find exactly, what I would

Many THNX

Files:
picture_1.jpg 102 kb
[Deleted]  

Simple/EMA/WMA MA indicator

Hi

I need an indicator that will give alert / arrow..

WHEN PRICE CLOSE ABOVE EMA/SMA AND NEXT BAR OPEN ABOVE EMA/SMA

Its not a two MA cross over

Anyone has it?

Thanks

Al Mo
35
Al Mo  

Try this

I just threw it together - no promises on future updates, but I will do the best I can (I am not a pro coder by any means)

I have to warn you, the Alert On bool , if turned on, will currently alert on every tick....I don't think this is what you intended...I'm still working on figuring out how to alert for the most recent one.

I still cannot post attachements, so here is the current code

//+------------------------------------------------------------------+

//| Simple Alert.mq4 |

//| Al Mo |

//| Forex Trading Software: Forex Trading Platform MetaTrader 4 |

//+------------------------------------------------------------------+

#property copyright "Al Mo"

#property link "http://www.metaquotes.net"

#property indicator_chart_window

#property indicator_buffers 4

#property indicator_color1 Yellow

#property indicator_color2 Red

#property indicator_color3 Green

#property indicator_color4 Red

//---- buffers

double SMABuffer[];

double EMABuffer[];

double CrossUp[];

double CrossDown[];

extern int SMA = 20;

extern int EMA = 20;

extern bool AlertOn = 0;

//+------------------------------------------------------------------+

//| Custom indicator initialization function |

//+------------------------------------------------------------------+

int init()

{

//---- indicators

SetIndexStyle(0,DRAW_LINE);

SetIndexBuffer(0,SMABuffer);

SetIndexStyle(1,DRAW_LINE);

SetIndexBuffer(1,EMABuffer);

SetIndexStyle(2,DRAW_ARROW);

SetIndexArrow(2, 233);

SetIndexBuffer(2,CrossUp);

SetIndexStyle(3,DRAW_ARROW);

SetIndexArrow(3, 234);

SetIndexBuffer(3,CrossDown);

//----

return(0);

}

//+------------------------------------------------------------------+

//| Custom indicator deinitialization function |

//+------------------------------------------------------------------+

int deinit()

{

//----

//----

return(0);

}

//+------------------------------------------------------------------+

//| Custom indicator iteration function |

//+------------------------------------------------------------------+

int start()

{

int counted_bars=IndicatorCounted();

for (int i = Bars-counted_bars-1; i>=0; i--)

{

SMABuffer = iMA(NULL,0,SMA,0,MODE_SMA,PRICE_CLOSE,i);

EMABuffer = iMA(NULL,0,EMA,0,MODE_EMA,PRICE_CLOSE,i);

if((Close > SMABuffer) && (Close > EMABuffer) &&

(Open > SMABuffer) && (Open > EMABuffer))

{

CrossUp = High +5*Point;

if (AlertOn)

Alert("Close & Open are above SMA/EMA");

}

if((Close < SMABuffer) && (Close < EMABuffer) &&

(Open < SMABuffer) && (Open < EMABuffer))

{

CrossDown = Low - 5*Point;

if (AlertOn)

Alert("Close & Open are below SMA/EMA");

}

}

//----

//----

return(0);

}

//+------------------------------------------------------------------+

Al Mo
35
Al Mo  

Yo

I still can't paste attachments , as I am too new apparently. I did submit the code within my last post, I think one of the admin's just need to approve that post

Al Mo
35
Al Mo  

The Code for Simple Alert

//+------------------------------------------------------------------+

//| Simple Alert.mq4 |

//| Al Mo |

//| Forex Trading Software: Forex Trading Platform MetaTrader 4 |

//+------------------------------------------------------------------+

#property copyright "Al Mo"

#property link "http://www.metaquotes.net"

#property indicator_chart_window

#property indicator_buffers 4

#property indicator_color1 Yellow

#property indicator_color2 Red

#property indicator_color3 Green

#property indicator_color4 Red

//---- buffers

double SMABuffer[];

double EMABuffer[];

double CrossUp[];

double CrossDown[];

extern int SMA = 20;

extern int EMA = 20;

extern bool AlertOn = 0;

//+------------------------------------------------------------------+

//| Custom indicator initialization function |

//+------------------------------------------------------------------+

int init()

{

//---- indicators

SetIndexStyle(0,DRAW_LINE);

SetIndexBuffer(0,SMABuffer);

SetIndexStyle(1,DRAW_LINE);

SetIndexBuffer(1,EMABuffer);

SetIndexStyle(2,DRAW_ARROW);

SetIndexArrow(2, 233);

SetIndexBuffer(2,CrossUp);

SetIndexStyle(3,DRAW_ARROW);

SetIndexArrow(3, 234);

SetIndexBuffer(3,CrossDown);

//----

return(0);

}

//+------------------------------------------------------------------+

//| Custom indicator deinitialization function |

//+------------------------------------------------------------------+

int deinit()

{

//----

//----

return(0);

}

//+------------------------------------------------------------------+

//| Custom indicator iteration function |

//+------------------------------------------------------------------+

int start()

{

int counted_bars=IndicatorCounted();

for (int i = Bars-counted_bars-1; i>=0; i--)

{

SMABuffer = iMA(NULL,0,SMA,0,MODE_SMA,PRICE_CLOSE,i);

EMABuffer = iMA(NULL,0,EMA,0,MODE_EMA,PRICE_CLOSE,i);

if((Close > SMABuffer) && (Close > EMABuffer) &&

(Open > SMABuffer) && (Open > EMABuffer))

{

CrossUp = High +5*Point;

if (AlertOn)

Alert("Close & Open are above SMA/EMA");

}

if((Close < SMABuffer) && (Close < EMABuffer) &&

(Open < SMABuffer) && (Open < EMABuffer))

{

CrossDown = Low - 5*Point;

if (AlertOn)

Alert("Close & Open are below SMA/EMA");

}

}

//----

//----

return(0);

}

//+------------------------------------------------------------------+

[Deleted]  

EA that helps enter trade when the price near/touch Moving average

Hi,

Im looking for EA that helps enter trade when the price near/touch Moving average.

It should be simple, not sure if anyone used one. I've done some searches, but no luck.

Thanks.

[Deleted]  

Not much people interested with MA EAs these days, so it might hard to find.

I can only offer you my service as programmer to make such EA, for a cheap price

HonestBill
120
HonestBill  

MA-Price-Alert indicator

cja:
I have altered this indicator as requested to now be an MA Alert, the user can now use any MA Mode/ MA Price or Shift, the Popup message & email now includes the Symbol & Timeframe plus you can also change the Sound File for the Sound Alert so for that reason I have renamed it MA-Price_Alert

List of MODE & PRICE Settings

MODE_SMA 0 Simple moving average,

MODE_EMA 1 Exponential moving average,

MODE_SMMA 2 Smoothed moving average,

MODE_LWMA 3 Linear weighted moving average.

PRICE_CLOSE 0 Close price.

PRICE_OPEN 1 Open price.

PRICE_HIGH 2 High price.

PRICE_LOW 3 Low price.

PRICE_MEDIAN 4 Median price, (high+low)/2.

PRICE_TYPICAL 5 Typical price, (high+low+close)/3.

PRICE_WEIGHTED 6 Weighted close price, (high+low+close+close)/4.

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

The default settings for this indicator are EMA 34

ma_period = 34;

ma_mode = 1;

ma_price = 0;

ma_shift = 0;

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

To set it as an SMA 50 PRICE CLOSED would look like this

ma_period = 50;

ma_mode = 0;

ma_price = 0;

ma_shift = 0;

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

To set it as an SMA 50 PRICE OPEN would look like this

ma_period = 50;

ma_mode = 0;

ma_price = 1;

ma_shift = 0;

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

ma-price-alert.mq4

Hi, there,

This indicator works fine for me. Perfect for what I want.

Only one problem is that it keeps alerting with each candle if still within the x amount of pips. Do you know how to code it so that it only alerts once, then just change timeframe to reset?

If it helps, I have also attached an indi that does the same for a trendline. It only alerts once. Changing timeframe resets it.

Thanks in advance for the help.

HonestBill
120
HonestBill  

Here it is with errors corrected.

Files: