Please help me make WAVE

#1
Dear my friends,

im so poor make a code, n i need your help.

the logic is, if close > close-1, wave = high
and if close < close-1, wave = low
and then i will get wave trend line... please help me to make this code...thanksss
 
#2
exampe :

yesterday, close = 9;
today, hi = 10, low = 5, close = 10;
because close today > yesterday, then wave = hi = 10;

other case:
yesterday, close = 9;
today, hi = 10, low = 4, close = 5;
because close today < yesterday, then wave = low =4;

please help me
 
#5

colion

Active Member
#7
exampe :

yesterday, close = 9;
today, hi = 10, low = 5, close = 10;
because close today > yesterday, then wave = hi = 10;

other case:
yesterday, close = 9;
today, hi = 10, low = 4, close = 5;
because close today < yesterday, then wave = low =4;

please help me
Off the top of my head:

wave = iif( c >= ref( c, -1 ), h, l ); //change >= if want another condition for the case where c == ref( c, -1 ) - could use, for example, wave = iif( c > ref( c, -1 ), h, iif( c < ref( c, -1 ), l, c ) );
plot( wave, "", colorwhite, styleline | stylethick );
 
Last edited:
#8
Off the top of my head:

wave = iif( c >= ref( c, -1 ), h, l ); //change >= if want another condition for the case where c == ref( c, -1 ) - could use, for example, wave = iif( c > ref( c, -1 ), h, iif( c < ref( c, -1 ), l, c ) );
plot( wave, "", colorwhite, styleline | stylethick );

thanks dear for your help
 

Similar threads