Combine MACD and DMI indicator together?

O

otmane

New member
hey everyone i develop this code using macd value and dminus but they dont come acrosses

Code:
#--------- macd val

input fastLength = 2;
input slowLength = 3;
input MACDLength = 2;
input averageTypee = AverageType.EXPONENTIAL;
input showBreakoutSignals = no;


plot Value = MovingAverage(averageTypee, close, fastLength) - MovingAverage(averageTypee, close, slowLength);

#--------- dimis
declare lower;

input length = 22;
input averageType = AverageType.WILDERS;

plot "DI-" = DMI(length, averageType)."DI-";
"DI-".SetDefaultColor(GetColor(8));


but when i put them in one case they crosses cheek this link https://ibb.co/N79GNb6and they give me good result cheek the picture below can someone explain me or help me how to solve that i wanna use that for watchlist as custom indicator help to identify the move of the market . thanks
 
Last edited by a moderator:
YungTraderFromMontana

YungTraderFromMontana

Well-known member
I'll help you out but I'm not exactly sure what your saying. What do you mean by "they don't come acrosses."
 
O

otmane

New member
sorry about that i mean two chart studies macd value and diminus the two lines do not intersect when i developed the code above . but when i put them together in one case they intersect cheek even the image in the link https://ibb.co/N79GNb6 using diminus 22 wilders and macd value 2.3.2
 
O

otmane

New member
I'll help you out but I'm not exactly sure what your saying. What do you mean by "they don't come acrosses."
sorry about that i mean two chart studies macd value and diminus the two lines do not intersect when i developed the code above . but when i put them together in one case they intersect cheek even the image in the link https://ibb.co/N79GNb6 using diminus 22 wilders and macd value 2.3.2
 
inthefutures

inthefutures

Active member
why is declared lower is in the middle of the code, should be at the top
 
inthefutures

inthefutures

Active member
Code:
#--------- macd val
declare lower;

input fastLength = 2;
input slowLength = 3;
input MACDLength = 2;
input averageTypee = AverageType.EXPONENTIAL;
input showBreakoutSignals = no;


plot Value = MovingAverage(averageTypee, close, fastLength) - MovingAverage(averageTypee, close, slowLength);

#--------- dimis


input length = 22;
input averageType = AverageType.WILDERS;

plot "DI-" = DMI(length, averageType)."DI-";
"DI-".SetDefaultColor(GetColor(8));
 
O

otmane

New member
@inthefutures thanks for your help but look at this link is screen of my tow charts https://ibb.co/8bJW5c5 both of them have the same code but they dont behave with same way
 
T

TrueDepth

Member
VIP
When you combine two studies on the lower, they are scaled to fit with each other. There have been a lot of people trying to do this with various different studies, but the problem is it moves depending on how much you zoom in and out. If you combine the codes of two very different studies you have to make them the same scale. For example, DMI might be on a 0-20 scale and MACD might be on a -20 to 20 scale.
 
O

otmane

New member
When you combine two studies on the lower, they are scaled to fit with each other. There have been a lot of people trying to do this with various different studies, but the problem is it moves depending on how much you zoom in and out. If you combine the codes of two very different studies you have to make them the same scale. For example, DMI might be on a 0-20 scale and MACD might be on a -20 to 20 scale.
thanks
 

Similar threads

Top