Two indicators in the same chart window

 
Hi,

I have been using two or more indicators in the same chart window, but I have a problem: the "Zero" of one indicator doesn't stays in the same level of the "zero" of the other indicator. So I end up with two "zeros" in the same chart windows.

Is there any way to put all "Zeros" of the different indicators in the same place (level) in the same chart window?

Some thing that works like "indicator_maximum", and "indicator_minimum". Some thing like "#property indicator_one_zero_for_all_zeros"?

thanks, brspMA.
 
Your request is clear but I don't know exactly when it will be implemented. Set the same fixed minimums and maximums 
 
Thanks a lot stringo,

Unfortunately, set the same fixed minimums and maximums would not work in my case. Unless if it is possible to set those properties in the middle of the program: or in the init {} area, or in the start {} area.

Is that possible? Can I set "#property indicator" in those mentioned areas?

Thanks again, brspMA.
 
hi everyone,

I've tried my best, but I just can't. So please could you kindly help me with this problem:

I want to fix the maximums and minimuns of two different indicators. those maximuns and minimuns have to have the same value in order to obtain both "Zeros" (of the different indicators) in the same place (level) in the same chart window.

can I use variable to set those maximus and minimus? how can I do that?

thank you so much for your time in reading my post, and hopefully I will hear your answer,,,
 

Here's the basic idea how to do it

You have to modify the source of the indicators you want to "balance"

Add a new index line to both indicators, give the new line the values for max and min
that you calculate, based on the maximum indicator swing, like +10 and -10 for one,
and +143 -143 for the other (as an example).

The subwindow will display the zero line for both indicators in the center.

Make the new lines invisible, color = CLR_NONE

 
phy:

Here's the basic idea how to do it

You have to modify the source of the indicators you want to "balance"

Add a new index line to both indicators, give the new line the values for max and min
that you calculate, based on the maximum indicator swing, like +10 and -10 for one,
and +143 -143 for the other (as an example).

The subwindow will display the zero line for both indicators in the center.

Make the new lines invisible, color = CLR_NONE


hey phy, you are very cool guy. I get it. thank you again,,,
 
hey phy,

i've tried and still having some difficulties:

1- which is the easiest way to have the maximum and minimum peaks of one indicator?
2- after I have those information (max. and min. values) I have to exchange them among those different indicators before they are ploted(of course), otherwise it is not going to work. how i will do that?

so, please, could you enlighten me here. thanks again,,,
 

"which is the easiest way to have the maximum and minimum peaks of one indicator?"


double MAX;

for(.....){

calculate Index0[i];

if( MathAbs(Index0[i] > MAX) MAX = MathAbs(indicator[i]);

}


after I have those information (max. and min. values) I have to exchange them among those different indicators before they are ploted(of course), otherwise it is not going to work. how i will do that?

For each indicator:

You want one value, not max and min.

Create a new line index, set all its values to MAX

Create a second new index, set all its values to -MAX

If original indicator looks like this:

start(){

for(...){
calculate indicator_index_0_[i];
}
return(0);
}

----------

Modify it to look like this:

---------

start(){

for(.....){
calculate indicator_index_0_[i];
if( MathAbs(indicator_index_0_[i] > MAX) MAX = MathAbs(indicator_index_0_[i]);
}

for(....){
fake_index_1_[i] = MAX; // new indicator index line with color CLR_NONE
fake_index_2_[i] = -MAX; // new indicator index line with color CLR_NONE
}
return(0);
}

----------------

"I have to exchange them among those different indicators "

There is nothing to exchange between other indicators.

Each indicator modified as above now has zero line in center of subwindow.

 
I get it! finally!!! actually you make the indicator become symmetric, and in doing so its zero line is going to be in the center of the windows always.

that is very clever, I am happy now.

thank you so much,,,
 

"you make the indicator become symmetric"

Yeah, that would have said it all

 

how to calculate the max value out of a buffer ?

let said we have :


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

pleasehelp[i]=iMA(NULL,0,FastEMA,0,MODE_EMA,PRICE_CLOSE,i)-iMA(NULL,0,SlowEMA,0,MODE_EMA,PRICE_CLOSE,i);

abspleasehelp[i]=MathAbs(pleasehelp[i]);

i need to know the greater value of it in the WHOLE_ARRAY

I have tried: 1 - High[iHighest(MathAbs(Null),0,abspleasehelp[i],WHOLE_ARRAY,0)];

2 - Mathmax....

I need only one value out a arrays (and i remind us the value inside that array are double type);
Thanks, Best regards

Reason: