Coding help - page 10

 

RSI email alert

Hi programmers,

really grateful if anyone could add in an email alert to complement the existing alert. It should only send one email during the current price bar when the RSI level is hit the first time (so I don't get swamped with emails if it jumps up and down during the price bar). I have zilch mql programming knowledge, so any help would be fantastic.

all the best,

malcolm

Files:
rsi_alert.mq4  3 kb
 
m1nich:
Hi programmers,

really grateful if anyone could add in an email alert to complement the existing alert. It should only send one email during the current price bar when the RSI level is hit the first time (so I don't get swamped with emails if it jumps up and down during the price bar). I have zilch mql programming knowledge, so any help would be fantastic.

all the best,

malcolm

Hi Malcolm,

Try here https://www.mql5.com/en/forum/180648

post# 2928

 

RSI email alert

Hi MrTools,

Wunderbar!

all the best

 

Indicator with errors

Hi coders,

i found this indicator. It is good for manual trading. The indicator shows the break-even point of several orders. Unfortunately, he has several errors. Can someone correct this?

Add new feature?

If I change the tp or sl with an order, which is sl and tp of the other orders are automatically changed (like e-MoveSLTPbyMouse.mq4).

Thanks !

Sorry for my bad english !

 
rajivzzz:
Hi

Is any one know how to create Indicator in to a EA i have this indicator, but i can miss many times better position for Exit, Entry and Take profit because i did not sit front of PC every time, but it works very well ,on every time frame on any pair in natural market. is their any one help me on it or any place where i can set it for EA for robo trading.

See

RED LINE is nice sell position

GREEN LINE is nice buy position

TAKE PROFIT center line

I can show some of my trades on Eur/Usd in 1H chart with pink lines, all closed in profits.

I want EA work like this sell on red line ,TP hit at center line ,buy at green line TP hit at center line

Hi

I think its possible and I can help. Coding an EA with has to meet certain conditions. PM me for further discussions.

Thanks.

 
rvvidhul:
Experts kindly code a MT4 indicator for the attached chart.Thanks in advance.This is based on Heikin Ashi pivot and NMA swing system.

Here is the Afl code for this chart,can anyone convert this Formula into an Metatrader indicator.

_SECTION_BEGIN("NMA Swing Explorer");

SetBarsRequired(200,0);

GraphXSpace = 5;

SetChartOptions(0,chartShowArrows|chartShowDates);

k = Optimize("K",Param("K",2,0.25,5,0.25),0.25,5,0.25);

Per= Optimize("atr",Param("atr",20,3,20,1),3,20,1);

HACLOSE=(O+H+L+C)/4;

HaOpen = AMA( Ref( HaClose, -1 ), 0.5 );

HaHigh = Max( H, Max( HaClose, HaOpen ) );

HaLow = Min( L, Min( HaClose, HaOpen ) );

if( ParamToggle("Plot Heikin-Ashi", "No,Yes", 1 ) )

PlotOHLC( HaOpen, HaHigh, HaLow, HaClose, "Heikin Ashi " + Name(), colorBlack, styleCandle );

else

Plot( C, "Regular candles " + Name(), colorBlack, styleCandle );

j=Haclose;

//================================================================================================================

//=========================Indicator=================================================================================

f=ATR(15);

rfsctor = WMA(H-L, Per);

revers = k * rfsctor;

Trend = 1;

NW[0] = 0;

for(i = 1; i < BarCount; i++)

{

if(Trend == 1)

{

if(j < NW)

{

Trend = -1;

NW = j + Revers;

}

else

{

Trend = 1;

if((j - Revers) > NW)

{

NW = j - Revers;

}

else

{

NW = NW;

}

}

}

if(Trend == -1)

{

if(j > NW)

{

Trend = 1;

NW = j - Revers;

}

else

{

Trend = -1;

if((j + Revers) < NW)

{

NW = j + Revers;

}

else

{

NW = NW;

}

}

}

}

//===============system================

Plot(NW, "", IIf(Trend == 1, 27, 4), 4);

Buy=Cover=Cross(j,nw);

Sell=Short=Cross(nw,j);

SellPrice=ValueWhen(Sell,C,1);

BuyPrice=ValueWhen(Buy,C,1);

Long=Flip(Buy,Sell);

Shrt=Flip(Sell,Buy );

NMAB= NW<HACLOSE;

NMAS= NW>HACLOSE;

NMA_status= WriteIf(NMAB, "BUY MODE", WriteIf(NMAS, "SELL MODE", "NEUTRAL"));

NMAS_Col=IIf(NMAB, colorGreen, IIf(NMAS, colorRed, colorLightGrey));

Filter=1;

AddColumn( NW, "SAR", 1.2 );

AddColumn( HACLOSE, "HA Close", 1.2 );

AddColumn( C, "Close", 1.2 );

AddTextColumn(NMA_status, "MODE", 1, colorWhite, NMAS_Col);

_SECTION_END();

//=================TITLE===========================================================================================

_SECTION_BEGIN("Title");

if( Status("action") == actionIndicator )

(

Title = EncodeColor(colorWhite)+ "NICK MA Swing System" + " - " + Name() + " - " + EncodeColor(colorRed)+ Interval(2) + EncodeColor(colorWhite) +

" - " + Date() +" - "+"\n" +EncodeColor(colorRed) +"Op-"+O+" "+"Hi-"+H+" "+"Lo-"+L+" "+

"Cl-"+C+" "+ "Vol= "+ WriteVal(V)+"\n"+

EncodeColor(colorLime)+

WriteIf (Buy , " GO LONG / Reverse Signal at "+C+" ","")+

WriteIf (Sell , " EXIT LONG / Reverse Signal at "+C+" ","")+"\n"+EncodeColor(colorWhite)+

WriteIf(Sell , "Total Profit/Loss for the Last Trade Rs."+(C-BuyPrice)+"","")+

WriteIf(Buy , "Total Profit/Loss for the Last trade Rs."+(SellPrice-C)+"","")+

WriteIf(Long AND NOT Buy, "Trade : Long - Entry price Rs."+(BuyPrice),"")+

WriteIf(shrt AND NOT Sell, "Trade : Short - Entry price Rs."+(SellPrice),"")+"\n"+

WriteIf(Long AND NOT Buy, "Current Profit/Loss Rs."+(C-BuyPrice)+"","")+

WriteIf(shrt AND NOT Sell, "Current Profit/Loss Rs."+(SellPrice-C)+"",""));

PlotShapes(IIf(Buy, shapeSquare, shapeNone),colorGreen, 0, L, Offset=-40);

PlotShapes(IIf(Buy, shapeSquare, shapeNone),colorLime, 0,L, Offset=-50);

PlotShapes(IIf(Buy, shapeUpArrow, shapeNone),colorWhite, 0,L, Offset=-45);

PlotShapes(IIf(Sell, shapeSquare, shapeNone),colorRed, 0, H, Offset=40);

PlotShapes(IIf(Sell, shapeSquare, shapeNone),colorOrange, 0,H, Offset=50);

PlotShapes(IIf(Sell, shapeDownArrow, shapeNone),colorWhite, 0,H, Offset=-45);

_SECTION_END();

 
rajivzzz:
i did not share it any more

repaint ,LOL

It works like HolyGrial

if u did not know how it make, you can not do any thing for me

What a nice and inteligent guy!!!!!!!!!!!!!!!!!!!!!!!!

 

Hi, Laurus, You just need to switch the order of the buffers. Mt4 display buffer 3 one top of buffer 2 on top of buffer 1 etc.

 

Object layer order of indicators

I have this classical MACD with histogram where the histogram gets drawn in front of the MACD and Signal lines. Could someone please show me how to set the Histogram in the back? I have tried to figure it out, but without success.

Thanks,

Laurus

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

//| _MACD.mq4 |

//| |

//| The Classical MACD with Histogram |

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

//---- indicator settings

#property indicator_separate_window

#property indicator_buffers 3

#property indicator_color1 Black

#property indicator_color2 Red

#property indicator_color3 SteelBlue

#property indicator_width1 1

#property indicator_width2 1

#property indicator_width3 2

//---- indicator parameters

extern int FastEMA=12;

extern int SlowEMA=26;

extern int SignalEMA=9;

//---- indicator buffers

double MACD_Buffer[];

double SIGNAL_Buffer[];

double HISTOGRAM_Buffer[];

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

//| Custom indicator initialization function |

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

int init() {

//---- drawing settings

SetIndexStyle(0,DRAW_LINE);

SetIndexStyle(1,DRAW_LINE);

SetIndexStyle(2,DRAW_HISTOGRAM);

SetIndexDrawBegin(1,SignalEMA);

IndicatorDigits(Digits+1);

//---- indicator buffers mapping

SetIndexBuffer(0,MACD_Buffer);

SetIndexBuffer(1,SIGNAL_Buffer);

SetIndexBuffer(2,HISTOGRAM_Buffer);

//---- name for DataWindow and indicator subwindow label

IndicatorShortName("_MACD ("+FastEMA+","+SlowEMA+","+SignalEMA+")");

SetIndexLabel(0,"MACD");

SetIndexLabel(1,"Signal");

SetIndexLabel(2,"Histogram");

//---- initialization done

return(0);

}

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

//| Moving Averages Convergence/Divergence |

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

int start() {

int i;

int limit;

int counted_bars = IndicatorCounted();

if(counted_bars < 0) return(-1); //---- check for possible errors

if(counted_bars > 0) counted_bars--; //---- the last counted bar will be recounted

limit = Bars - counted_bars;

//---- Draw MACD line

for(i=0; i<limit; i++) { //-- loop from the current bar to the first bar

MACD_Buffer = iMA(NULL,0,FastEMA,0,MODE_EMA,PRICE_CLOSE,i) - iMA(NULL,0,SlowEMA,0,MODE_EMA,PRICE_CLOSE,i);

}

//---- Draw Signal line and Histogram

for(i=0; i<limit; i++) { //-- same loop above

SIGNAL_Buffer = iMAOnArray(MACD_Buffer,Bars,SignalEMA,0,MODE_EMA,i);

HISTOGRAM_Buffer = MACD_Buffer - SIGNAL_Buffer;

}

//---- Done

return(0);

}

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

 
christinaLi:
Hi, Laurus, You just need to switch the order of the buffers. Mt4 display buffer 3 one top of buffer 2 on top of buffer 1 etc.

Great christinaLi! Thank you very much for your reply and help. That did it. Works perfectly now

In case someone would like to have it with the histogram in the back I have attached the file.

- Laurus

Files:
_macd.mq4  3 kb