Re: BEST MT4 non-repainting indicators
Posted: Mon Feb 27, 2017 2:43 am
We are on same benchAnyway wrote:
Hi
I'm just one of mladen's apprentices
We are on same benchAnyway wrote:
Hi
I'm just one of mladen's apprentices
wishwish wrote:already download your template but still no show the indi on the chart still need that indi sir
Well, I'm going to review Japanese Candlestick Charting Techniques of Steve Nison. See ya.mntiwana wrote: We are on same bench
Honey man if and when you find some thing nice,hope i will be have benefits of that too.Anyway wrote:
Well, I'm going to review Japanese Candlestick Charting Techniques of Steve Nison. See ya.
It is working nowmntiwana wrote:
wait a moment plz,try now.
Code: Select all
//+------------------------------------------------------------------+
//| dmx.mq4 |
//| mladen |
//+------------------------------------------------------------------+
#property copyright "mladen"
#property link "mladenfx@gmail.com"
#property indicator_separate_window
#property indicator_buffers 3
#property indicator_color1 clrDeepSkyBlue
#property indicator_color2 clrRed
#property indicator_color3 clrDimGray
#property strict
//
//
//
//
//
enum enMaTypes
{
ma_sma, // Simple moving average
ma_ema, // Exponential moving average
ma_smma, // Smoothed MA
ma_lwma // Linear weighted MA
};
extern int Length = 32; // DMX period
extern int Smooth = 5; // DMX smoothing
extern enMaTypes SmoothMode = ma_sma; // DMX smoothing mode
extern bool ShowHistogram = true; // Display histogram?
double dmx[],dmxU[],dmxD[];
//------------------------------------------------------------------
//
//------------------------------------------------------------------
//
//
//
//
//
int init()
{
int hstyle = (ShowHistogram) ? DRAW_HISTOGRAM : DRAW_NONE;
SetIndexBuffer(0,dmxU); SetIndexStyle(0,hstyle); SetIndexLabel(0,"Dmx");
SetIndexBuffer(1,dmxD); SetIndexStyle(1,hstyle); SetIndexLabel(1,"DmX");
SetIndexBuffer(2,dmx); SetIndexLabel(2,"Dmx");
IndicatorShortName("Dmx ("+(string)Length+")");
return(0);
}
int deinit() { return(0); }
//------------------------------------------------------------------
//
//------------------------------------------------------------------
//
//
//
//
//
int start()
{
int counted_bars = IndicatorCounted();
if(counted_bars<0) return(-1);
if(counted_bars>0) counted_bars--;
int limit = MathMin(Bars-counted_bars,Bars-1);
//
//
//
//
//
for(int i=limit; i>=0; i--)
{
double currTR = (i<Bars-1) ? MathMax(High[i],Close[i+1])-MathMin(Low[i],Close[i+1]) : High[i]-Low[i];
double DeltaHi = (i<Bars-1) ? High[i] - High[i+1] : 0;
double DeltaLo = (i<Bars-1) ? Low[i+1] - Low[i] : 0;
double plusDM = 0.00;
double minusDM = 0.00;
if ((DeltaHi>DeltaLo) && (DeltaHi>0)) plusDM = DeltaHi;
if ((DeltaLo>DeltaHi) && (DeltaLo>0)) minusDM = DeltaLo;
double DIp = (currTR>0) ? 100.0*iCustomMa(SmoothMode,plusDM ,Length,i,0)/currTR : iCustomMa(SmoothMode,0,Length,i,0);
double DIm = (currTR>0) ? 100.0*iCustomMa(SmoothMode,minusDM,Length,i,1)/currTR : iCustomMa(SmoothMode,0,Length,i,1);
dmx[i] = ((DIp+DIm) != 0) ? 100.0*iCustomMa(SmoothMode,(DIp-DIm)/(DIp+DIm),Smooth,i,2) : iCustomMa(SmoothMode,0,Smooth,i,2);
//
//
//
//
//
if (ShowHistogram)
{
dmxU[i] = (i<Bars-1) ? (dmx[i]>dmx[i+1]) ? dmx[i] : EMPTY_VALUE : EMPTY_VALUE;
dmxD[i] = (i<Bars-1) ? (dmx[i]<dmx[i+1]) ? dmx[i] : EMPTY_VALUE : EMPTY_VALUE;
}
}
return(0);
}
//------------------------------------------------------------------
//
//------------------------------------------------------------------
//
//
//
//
//
#define _maInstances 3
#define _maWorkBufferx1 1*_maInstances
#define _maWorkBufferx2 2*_maInstances
string averageName(int mode)
{
switch (mode)
{
case ma_sma : return("SMA");
case ma_ema : return("EMA");
case ma_smma : return("SMMA");
case ma_lwma : return("LWMA");
}
return("");
}
double iCustomMa(int mode, double price, double length, int r, int instanceNo=0)
{
r = Bars-r-1;
switch (mode)
{
case ma_sma : return(iSma(price,(int)length,r,instanceNo));
case ma_ema : return(iEma(price,length,r,instanceNo));
case ma_smma : return(iSmma(price,length,r,instanceNo));
case ma_lwma : return(iLwma(price,(int)length,r,instanceNo));
default : return(price);
}
}
//
//
//
//
//
double workSma[][_maWorkBufferx2];
double iSma(double price, int period, int r, int instanceNo=0)
{
if (period<=1) return(price);
if (ArrayRange(workSma,0)!= Bars) ArrayResize(workSma,Bars); instanceNo *= 2; int k;
//
//
//
//
//
workSma[r][instanceNo+0] = price;
workSma[r][instanceNo+1] = price; for(k=1; k<period && (r-k)>=0; k++) workSma[r][instanceNo+1] += workSma[r-k][instanceNo+0];
workSma[r][instanceNo+1] /= 1.0*k;
return(workSma[r][instanceNo+1]);
}
//
//
//
//
//
double workEma[][_maWorkBufferx1];
double iEma(double price, double period, int r, int instanceNo=0)
{
if (ArrayRange(workEma,0)!= Bars) ArrayResize(workEma,Bars);
//
//
//
//
//
workEma[r][instanceNo] = price;
if (r>0 && period>1)
workEma[r][instanceNo] = workEma[r-1][instanceNo]+(2.0 / (1.0+period))*(price-workEma[r-1][instanceNo]);
return(workEma[r][instanceNo]);
}
//
//
//
//
//
double workSmma[][_maWorkBufferx1];
double iSmma(double price, double period, int r, int instanceNo=0)
{
if (period<=1) return(price);
if (ArrayRange(workSmma,0)!= Bars) ArrayResize(workSmma,Bars);
//
//
//
//
//
workSmma[r][instanceNo] = price;
if (r>0 && period>1)
workSmma[r][instanceNo] = workSmma[r-1][instanceNo]+(price-workSmma[r-1][instanceNo])/period;
return(workSmma[r][instanceNo]);
}
//
//
//
//
//
double workLwma[][_maWorkBufferx1];
double iLwma(double price, double period, int r, int instanceNo=0)
{
if (ArrayRange(workLwma,0)!= Bars) ArrayResize(workLwma,Bars);
//
//
//
//
//
period = MathMax(period,1);
workLwma[r][instanceNo] = price;
double sumw = period;
double sum = period*price;
for(int k=1; k<period && (r-k)>=0; k++)
{
double weight = period-k;
sumw += weight;
sum += weight*workLwma[r-k][instanceNo];
}
return(sum/sumw);
}
can you plz refer thread and post number,round questions always take time,many posts and confusionsamuelkanu wrote:Hello Mntiwana which indicator do you have on your chart that has the yellow and green lines and also yellow and green dots? Is that a gann indicator? Please could you upload it? Thanks in advance