Multi Timeframe Indicators - page 110

spiritbreezer
259
spiritbreezer  

MACD on chart

Hi, is there a way we can have macd plotted in a chart in MTF?

I have two indocators called MACDTrad3 and MACD trad3!. I do now have the source code for them, but I'm sure it will make for interesting reading if we can plot a higher tf macd on the chart. These indicators don't plot the histogram but justthe lines.

Thank you and God bless.

T Jones
71
T Jones  

One More Good MTF Candidate

AMA SLOPE would also make another good MTF indi.

It is great on its own but again would be another tool to cut through noise on lower TFs.

Thank you!

Alpha

Files:
lodol2
207
lodol2  

mtf slope

look here alpha24seven

https://www.mql5.com/en/forum/173574

T Jones
71
T Jones  

Thanks Lodol2

Sorry that I missed those. Thank you for bringing them to my attention.

I had some problems compiling. I've never seen this error before. Any ideas?

See graphic

Thank You.

Files:
florinv75
232
florinv75  

i agree with everything you said, but i don't think i made myself clear enough.

keris formula doesn't look like that in real time (without refreshing the charts!), it looks more like that yellow line; if you refresh the charts, yes, everything looks fine - but then why won't we simply use a second chart with the higher timeframe... and confirm the indicator moves only on the higher timeframe?

from the moment you plot a mtf indicator on a lower timeframe, you have another way of averaging some data on that timeframe (and not on a higher tf). it's never gonna look like the original - but it can be approximated. so the question is, how to find the best formula for the closest approximation? and i think this answers your question... right?

mladen:
Red line is the aproximation of the MA you are proposing

Magenta is the Keris way of MTF MA

Golden line are the real values of a higher time frame MA on a lower time frame

As you can see, there is hardly a singe correct value of the aproximated one over a period of time, while Keris's formula gives at least one correct value per period. Anyway, formula for the aproximation in Metatrader would be :

MAperiod=MAperiod*TimeFrame/Period()

If you try to apply this aproximation to moving average derived indicators (MACD for example), you will end up with big, and I mean BIG differences (I have seen a 7-8% difference of a 4H MACD on an 1H time frame)

A counter question : what do you think how many people did try different aproaches to multi time frame indicators?
T Jones
71
T Jones  

Error in Code

I figured it out. This extra code was left in the file -- at the end. Just delete it, compile and voila'.

Excellent indicator BTW.

---

/*

void drawLine(double lvl,string name, color Col )

{

ObjectDelete(name);

ObjectCreate(name, OBJ_HLINE, WindowFind(name), Time[0], lvl,Time[0], lvl);

ObjectSet(name, OBJPROP_STYLE, STYLE_DOT);

ObjectSet(name, OBJPROP_COLOR, Col);

ObjectSet(name,OBJPROP_WIDTH,1);

}

---

Mladen Rakic
154061
Mladen Rakic  

...

The yellow line is the "real MTF" moving average

There is no need to "refresh" any of the indicators on the picture

As for the rest, please read that post again

regards

mladen

Scrat:
i agree with everything you said, but i don't think i made myself clear enough.

keris formula doesn't look like that in real time (without refreshing the charts!), it looks more like that yellow line; if you refresh the charts, yes, everything looks fine - but then why won't we simply use a second chart with the higher timeframe... and confirm the indicator moves only on the higher timeframe?

from the moment you plot a mtf indicator on a lower timeframe, you have another way of averaging some data on that timeframe (and not on a higher tf). it's never gonna look like the original - but it can be approximated. so the question is, how to find the best formula for the closest approximation? and i think this answers your question... right?
lio
10
lio  

Need Mtf For This Indi

Hi all,

I've been wanting to have the ability to plot indicators from different timeframes on my chart

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

//| Fisher_m11.mq4 |

//| Copyright ฉ forexjr

//| Index of /cam06/fisher |

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

#property copyright "Copyright ฉ 23.07.2006 MartinG "

#property link "http://home.arcor.de/cam06/fisher"

#property indicator_separate_window

//#property indicator_minimum -1

//#property indicator_maximum 1

#property indicator_buffers 3

#property indicator_color2 RoyalBlue

#property indicator_color3 Red

#property indicator_width2 0.5

#property indicator_width3 0.5

int LeftNum1=56;

int LeftNum2=56;

extern int RangePeriods=35;

extern double PriceSmoothing=0.3; // =0.67 bei Fisher_m10

extern double IndexSmoothing=0.3; // =0.50 bei Fisher_m10

string ThisName="Fisher_kuskus";

int DrawStart;

//---- buffers

double ExtMapBuffer1[];

double ExtMapBuffer2[];

double ExtMapBuffer3[];

double ExtMapBuffer4[];

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

//| Custom indicator initialization function |

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

int init()

{

//---- indicators

IndicatorBuffers(4);

SetIndexLabel(0,"Star");

SetIndexStyle(0,DRAW_NONE);

SetIndexBuffer(0,ExtMapBuffer1);

SetIndexStyle(1,DRAW_HISTOGRAM);

SetIndexBuffer(1,ExtMapBuffer2);

SetIndexStyle(2,DRAW_HISTOGRAM);

SetIndexBuffer(2,ExtMapBuffer3);

SetIndexStyle(3,DRAW_NONE);

SetIndexBuffer(3,ExtMapBuffer4);

string Text=ThisName;

Text=Text+" (rPeriods "+RangePeriods;

Text=Text+", pSmooth "+DoubleToStr(PriceSmoothing,2);

Text=Text+", iSmooth "+DoubleToStr(IndexSmoothing,2);

Text=Text+") ";

IndicatorShortName(Text);

SetIndexLabel(1,NULL);

SetIndexLabel(2,NULL);

DrawStart=2*RangePeriods+4; // DrawStart= BarNumber calculated from left to right

SetIndexDrawBegin(1,DrawStart);

SetIndexDrawBegin(2,DrawStart);

if (PriceSmoothing>=1.0)

{

PriceSmoothing=0.9999;

Alert("Fish61: PriceSmothing factor has to be smaller 1!");

}

if (PriceSmoothing<0)

{

PriceSmoothing=0;

Alert("Fish61: PriceSmothing factor mustn''t be negative!");

}

if (IndexSmoothing>=1.0)

{

IndexSmoothing=0.9999;

Alert("Fish61: PriceSmothing factor has to be smaller 1!");

}

if (IndexSmoothing<0)

{

IndexSmoothing=0;

Alert("Fish61: PriceSmothing factor mustn''t be negative!");

}

//----

return(0);

}

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

//| Custom indicator deinitialization function |

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

int deinit()

{

//----

//----

return(0);

}

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

//| Custom indicator iteration function |

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

int start()

{

if (Bars<DrawStart)

{

Alert("Fish84: Not enough Bars loaded to calculate FisherIndicator with RangePeriods=",RangePeriods);

return(-1);

}

//----

int counted_bars=IndicatorCounted();

if (counted_bars<0) return(-1);

if (counted_bars>0) counted_bars--;

//----

int Position=Bars-counted_bars; // Position = BarPosition calculated from right to left

int LeftNum1=Bars-Position; // when more bars are loaded the Position of a bar changes but not its LeftNum

if (LeftNum1<RangePeriods+1)Position=Bars-RangePeriods-1;

while(Position>=0)

{

CalculateCurrentBar(Position);

Position--;

}

//----

return(0);

}

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

//| Single Bar Calculation function |

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

int CalculateCurrentBar(int pos)

{

double LowestLow, HighestHigh, GreatestRange, MidPrice;

double PriceLocation, SmoothedLocation, FishIndex, SmoothedFish;

//----

LowestLow = Low[Lowest(NULL,0,MODE_LOW,RangePeriods,pos)];

HighestHigh = High;

if (HighestHigh-LowestLow<0.1*Point)HighestHigh=LowestLow+0.1*Point;

GreatestRange=HighestHigh-LowestLow;

MidPrice = (High[pos]+Low[pos])/2;

// PriceLocation in current Range

if (GreatestRange!=0)

{

PriceLocation=(MidPrice-LowestLow)/GreatestRange;

PriceLocation= 2.0*PriceLocation - 1.0; // -> -1 < PriceLocation < +1

}

// Smoothing of PriceLocation

ExtMapBuffer4[pos]=PriceSmoothing*ExtMapBuffer4[pos+1]+(1.0-PriceSmoothing)*PriceLocation;

SmoothedLocation=ExtMapBuffer4[pos];

if (SmoothedLocation> 0.99) SmoothedLocation= 0.99; // verhindert, dass MathLog unendlich wird

if (SmoothedLocation<-0.99) SmoothedLocation=-0.99; // verhindert, dass MathLog minuns unendlich wird

// FisherIndex

if(1-SmoothedLocation!=0) FishIndex=MathLog((1+SmoothedLocation)/(1-SmoothedLocation));

else Alert("Fisher129: Unerlaubter Zustand bei Bar Nummer ",Bars-pos);

// Smoothing of FisherIndex

ExtMapBuffer1[pos]=IndexSmoothing*ExtMapBuffer1[pos+1]+(1.0-IndexSmoothing)*FishIndex;

if (Bars-pos<DrawStart)ExtMapBuffer1[pos]=0;

SmoothedFish=ExtMapBuffer1[pos];

if (SmoothedFish>0) // up trend

{

ExtMapBuffer2[pos]=SmoothedFish;

ExtMapBuffer3[pos]=0;

}

else // else down trend

{

ExtMapBuffer2[pos]=0;

ExtMapBuffer3[pos]=SmoothedFish;

}

//----

return(0);

}

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

thank

iinzall
202
iinzall  
mladen:
People, let's get serious

I am serious mladen...

I am a newbie and not a programmer, may be scrat's way is not perfect, but maybe i can use it. I will try it. If it useful, i'll use it. If it's not, i will look for again another great way or other indicator.

I have ever ask Codersguru about the similar thing.

My question to him was if i use 1 EMA in 30M TF, then in 1M TF it's must be 30 EMA.

And he said it was not like that. But i was not satisfied, maybe there is another way, so i find it in here. But if it is not useful, It's all right to me... . At least i know the result is.

BTW, thanks for the latest RSIOMA mladen, i like it very much, and thanks to fxbs and Kalenzo too, for this great indicator.

Regards,

IIN

Mladen Rakic
154061
Mladen Rakic  

The trouble is this:

That idea with MA's is probably the oldest idea in technical analysis

I do agree that places like TSD are places for sharing ideas, and knowledge

But please no one should try to do it this way :

i was just wondering if any of you ever thought to make a correspondence between the same indicator on a higher and on a smaller tf at the same time....

Come on, what the hell are we trying to do here, anyway?

I hope that now I made myself clear

regards

mladen

iinzall:
I am serious mladen...

I am a newbie and not a programmer, may be scrat's way is not perfect, but maybe i can use it. I will try it. If it useful, i'll use it. If it's not, i will look for again another great way or other indicator.

I have ever ask Codersguru about the similar thing.

My question to him was if i use 1 EMA in 30M TF, then in 1M TF it's must be 30 EMA.

And he said it was not like that. But i was not satisfied, maybe there is another way, so i find it in here. But if it is not useful, It's all right to me... . At least i know the result is.

BTW, thanks for the latest RSIOMA mladen, i like it very much, and thanks to fxbs and Kalenzo too, for this great indicator.

Regards,

IIN