Can someone make a multi time frame macd crossed up/down indicator?

D

dcruz11

New member
I'd like to know if the macd is crossed up or down on multiple time frames...and show as a box like these below.

Right now I have one that shows if the current time frame is crossed up or down with the "M".
The other time flags on the chart are for the ttm squeeze, but I was imaging the same thing just for macd crossed up or down.

 
H

horserider

Well-known member
VIP
Warehouse
Send me the money !!!!

Add these lines to the MTF MACD and comment out or delete the "declare lower"

Code:
AddLabel(yes, if value > avg == yes  then "MACD Short" else "MACD Short", if value < avg == no then color.GREEN else color.RED);

AddLabel(yes, if midtermsignal == yes  then "MACD MID" else "MACD Mid", if midtermsignal == no then color.GREEN else color.RED);

AddLabel(yes, if longtermsignal == yes  then "MACD Long" else "MACD Long", if longtermsignal == no then color.GREEN else color.RED);
You can now choose your time frames as usual in that studyand have the label display red or green for the short, mid and long time frames you have chosen.

hahaha just put it together not tested. See if it works and let everyone know.
 
A

asianboy

New member
can you guy share the MTF MACD code it very interesting find.
 
D

dcruz11

New member
Send me the money !!!!

Add these lines to the MTF MACD and comment out or delete the "declare lower"

Code:
AddLabel(yes, if value > avg == yes  then "MACD Short" else "MACD Short", if value < avg == no then color.GREEN else color.RED);

AddLabel(yes, if midtermsignal == yes  then "MACD MID" else "MACD Mid", if midtermsignal == no then color.GREEN else color.RED);

AddLabel(yes, if longtermsignal == yes  then "MACD Long" else "MACD Long", if longtermsignal == no then color.GREEN else color.RED);
You can now choose your time frames as usual in that studyand have the label display red or green for the short, mid and long time frames you have chosen.

hahaha just put it together not tested. See if it works and let everyone know.
I don't think the MTF MACD does what I want...I want to know if the macd lines have crossed up or down. It looks like the current MTF MACD is red or green based on the histogram.

I was guessing this was the "declare lower" you're talking about....but like I said I don't think the indicator does what I'm looking for.

Thank you

 
D

dcruz11

New member
Here is the code for the current time frame.

I'm looking for the same thing but would like to be able to put in 4 other time frames.

Thanks for any help!

Code:
#How many Decimals to use
input Dec_Places = numberformat.TWO_DECIMAL_PLACES;


#MACD Reading Flag
input M_Fast_Length = 12;
input M_Slow_Length = 26;
input M_MACD_Length = 9;
input M_AverageType = AverageType.EXPONENTIAL;


def PBMCD = reference MACD(M_Fast_Length, M_Slow_Length, M_MACD_Length, M_AverageType).diff;


AddLabel (yes, "M: " + astext(PBMCD,dec_Places), if PBMCD > 0 then Color.GREEN else if PBMCD < 0 then Color.RED else Color.GRAY);
 
H

horserider

Well-known member
VIP
Warehouse
@dcruz11 Look closer. Which is using the histogram?
 

Top