Multi Timeframe Indicators - page 324

 

I tried it again ... and this is what I changed (the changes are blue):

#property indicator_separate_window

#property indicator_level1 0.0002

#property indicator_level2 -0.0002

#property indicator_buffers 2

#property indicator_color1 Red

#property indicator_color2 Lime

#property indicator_width1 4

#property indicator_width2 2

//---- input parameters

extern int BearsBullsPeriod=13;

extern int TimeFrame=0;

//---- buffers

double BearsBuffer[];

double BullsBuffer[];

double TempBuffer[];

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

//| Custom indicator initialization function |

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

int init()

{

string short_name;

//---- 1 additional buffer used for counting.

IndicatorBuffers(3);

IndicatorDigits(Digits);

//---- indicator line

SetIndexStyle(0,DRAW_HISTOGRAM);

SetIndexStyle(1,DRAW_HISTOGRAM);

SetIndexBuffer(0,BearsBuffer);

SetIndexBuffer(1,BullsBuffer);

SetIndexBuffer(2,TempBuffer);

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

short_name="BearBulls("+BearsBullsPeriod+")";

IndicatorShortName(short_name);

SetIndexLabel(0,short_name);

SetIndexLabel(1,"BearBulls2("+BearsBullsPeriod+")");

//----

return(0);

}

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

//| Bears Power |

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

int start()

{

int i,counted_bars=IndicatorCounted();

//----

if(Bars<=BearsBullsPeriod) return(0);

//----

int limit=Bars-counted_bars;

if(counted_bars>0) limit++;

for(i=0; i<limit; i++)

TempBuffer=iMA(NULL,TimeFrame,BearsBullsPeriod,0,MODE_EMA,PRICE_CLOSE,i);

//----

i=Bars-counted_bars-1;

while(i>=0)

{

BearsBuffer=Low-TempBuffer;

BullsBuffer=High-TempBuffer;

i--;

}

//----

return(0);

}

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

The attached pictures show both indicators set to M30: Chartwindow 1 shows my trial and chartwindow 2 shows MrTool's effort. Picture 1 shows them indicators added to an EURUSD M5 chart and picture 2 shows them on M30 chart.

I'm absolutely sure that MrTools shows the right indicator ... what is wrong with my kind of MTF change?

 
cosmiclifeform:
Hi MrTools,

Thanks for your efforts to help others and for showing me an interesting way to add MTF to the SuperTrend indi... Some of your coding is a little beyond me and I'd like to learn a little more. My effort was a bare-bones basic way to change to MTF and your code has added much more to the indi.

And they definitely give different results.

The original code had no iCustom statements. I don't quite understand what indicator the iCustom is calling? It almost looks like it's calling itself? And what is the "calculate" statement for?

Also, it looks like the buffers are being used by both routines...the original code and your new iCustom statements? Plus the original code still contains the "NULL, 0" format. Is this somehow now bypassed by your new code?

BTW, if your code is more accurate/useful, I have no problem deleting my simple changed version so people don't get confused with so many versions.

Thanks in advance for your help...and I'm still enjoying learning more and more...!

Robert

Hi Robert,

I"m sorry for posting the Mtf after your post honestly didn't see your attachment, and anyway to explain best i know how is first of all i am learning and like you enjoy learning a lot and i have especially learned everything i know about coding by the strong helping attitude of this forum, that being said this is code is from different MTF indicators posted in this thread, and its counterpart in Elite section of this forum.

Regards

 
studbiol:
I tried it again ... and this is what I changed (the changes are blue):

..

..

The attached pictures show both indicators set to M30: Chartwindow 1 shows my trial and chartwindow 2 shows MrTool's effort. Picture 1 shows them indicators added to an EURUSD M5 chart and picture 2 shows them on M30 chart.

I'm absolutely sure that MrTools shows the right indicator ... what is wrong with my kind of MTF change?

Hi StudBiol,

Give yourself credit for trying...and learning...and actually...you coded it correctly using the basic MTF code I provided because your version compiled and worked fine...

So treat yourself to an extra dessert tonight for at least trying...and now you are an official MT4 coder and you can add these new skills to your resume....lol!

Thanks to MrTools for providing another MTF version to compare and learn from... It clearly has different results...and I'm not sure why (yet).

Which MTF indicator is more accurate?

Don't know yet, although I agree with you that it looks like MrTools MTF version matches the TF's better when you compare it with the basic BearsBulls indi charts on different TF's.

Here's what I see when I compare the code -

Your MTF code uses the original BearBulls code.

MrTools modified a MACD indicator, added iCustom calls to get the BearBulls indi values, and added his changes using the time array series that are more complex (for me) so I'm not sure how it's working (still a novice coder and still learning myself)...

So they are definitely different and worth exploring further...

I'll continue with some questions in the next post to MrTools...

Meanwhile...please let me know if you find out any more on this MTF coding and the differences...

Take care,

Robert

 

Using Time Arrays For MTF

mrtools:
Hi Robert,

I"m sorry for posting the Mtf after your post honestly didn't see your attachment, and anyway to explain best i know how is first of all i am learning and like you enjoy learning a lot and i have especially learned everything i know about coding by the strong helping attitude of this forum, that being said this is code is from different MTF indicators posted in this thread, and its counterpart in Elite section of this forum.

Regards

Hi MrTools,

Thanks for your reply.

To start with, I appreciate your work and efforts to help others, so there is never any reason to apologize for your contributions.

And in this case (with your MTF versions of the SuperTrends MTF and the BearsBulls MTF), you have provided a "different" way of doing the MTF code...so it's doubly appreciated - I'm always open to a Universe of Infinite Possibilities...and I look forward to learning something new. I can't say that I understand it yet...but that's the intrigue...

I do have a few questions for you:

I would like to understand why the MTF changes were not done directly in the BearBulls original code and instead make another indicator to iCustom call the indicator? Seems doing the MTF in the original code would be the much simpler way to do it (faster operation, less CPU cycles, etc.)?

The biggest difference in your MTF code compared to the basic MTF coding is that you use Time Arrays. How does the TimeArray code work? And why are the results different from the basic MTF coding?

Hopefully you can help us understand your MTF Time Array version better...and/or some other good coders can help explain why they produce different results.

Again thanks for your help to others!

Take care!

Robert

 
cosmiclifeform:
Hi StudBiol,

Give yourself credit for trying...and learning...and actually...you coded it correctly using the basic MTF code I provided because your version compiled and worked fine...

Meanwhile...please let me know if you find out any more on this MTF coding and the differences...

Take care,

Robert

Hi Robert,

thank you very much for your kind words. I hope I will learn much more ... ok: I have to learn much more.

Have a nice weekend

Files:
 

can somebody help me please

is there any mtf ma & mtf rsi that can be used in the trade simulator.

or they're all the same??i have one but when i put it in the simulator the mtf rsi only show straight line & the mtf ma doesn't show up [when i put them in the higher TF than the current simulator TF, ex. i put mtf rsi&ma TF 15 in TF5 simulator]

sorry for my bad english

 

hi all

need help with this indi i am trying to make it MTF i think i need 10 years to do it , darn i am trying to learn how

thanks

Files:
tcci.ex4  7 kb
 
kashour:
hi all

need help with this indi i am trying to make it MTF i think i need 10 years to do it , darn i am trying to learn how

thanks

Hi kashour, I'm not sure whether this is what you are looking for. This is T3CCI_mtf and not TCCI_mtf.

Files:
 

sh cable

studbiol:
Hi kashour, I'm not sure whether this is what you are looking for. This is T3CCI_mtf and not TCCI_mtf.

thanks a lot but its not the same as tcci i wish u can help

tcci is like hull ma thanks again

 
takbir:
Can someone make this indicator as a MTF one, please?

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

I hope someone helps me, please !

Reason: