Highest high for an indicator - page 4

 

Highest high for rsi - within last 10 bars

Need help!

Who has the proper coding for finding out the highest high, up to 10 bars back, from current high of RSI/CCI or Custom Indicator? I see coding for a moving average, but not for a true named indicator with a name attached like RSI / CCI or Custom Indicator??

Dave

 

Hi,

Does anyone have a version that works on price rather than indicator.

Something like: If Highest High Value of the last n bars minus the Lowest Low value of the past n bars is less than x then draw line at HHV and LLV, or draw a box around the bars.

Example : Lets use a 1 min chart and the values could be if the Highest High value of the past 5 closed bars, minus the Lowest Low value of the past 5 closed bars is less than 7 pips then draw a box around these 5 bars.

Doesn't have to be a box but highlight in some way a period of consolidation in the price. If the values are adjustable it could be used on different time frames and currencies.

I have noticed that when a market stalls and the price consolidates the next move can be a good one. If I had an indi to draw these places I could back test it visually

thanks

 

Hi me again,

Just had another thought, as this is using the same basic requirements as a Donchian Channel is it possible to add something to this attached indicator.

If an extra feature was added that shaded between the top and bottom line when price difference is less than x pips that would help tremendously.

Ideally it would be better to shade between the top and bottom line and draw lines ONLY when shaded area is visible, this would highlight areas of consolidation.

thanks

Files:
donchian.mq4  2 kb
 

iHighest() function question

Hi,

I've got a little problem with the function iHighest, I can't refere the timeframe to a specific period....for ex:

R1 = High;

(to get the highest price for the last year, when t1 is t1 = TimeMonth(TimeCurrent()); )

it returs the right value only when my chart time is MN1, when I change the periodicity of the chart the R4 value change.

How should I do ??

Thank you !!

 

Done, I'v found the solution !!!

R1 = iHigh(NULL,PERIOD_MN1,iHighest(NULL,PERIOD_MN1,MODE_HIGH,12,t1+1));

 

Can't use this indicator

I can't use your indicator

See my picture

--

My name: jimmy

My email: lekimphuongminh@gmail.com

My phone: 00 84 989676794

Files:
 

This indicator coded might give good trading signals

Hello all,

I used to trade with several TRO indicators including TRO multimeter candle color and TRO multimeter pablopluto. But when you're trading with a trend bar, over time you're facing one big problem.

When you see that other timeframes than the one you're trading on are in the same trend, you can see this as a good signal to enter the market, but your problem is that the trend bar just give you trend on the other timeframes, it doesn't tell you where this trend starts, and if it coming to an end.

So often you jump into the market, and right after that the market starts moving against your position.

One of my favorite indicator is Parabolic Sar, I think we can avoid those kind of situations with this indicator.

Has anyone know the existence or ever coded a multi-timeframe Psar?

or can someone here code a Psar that will consider data on 3 tf, like M1, M5 & M15.

The color code could be as follow:

M1 trend = M5 trend, Yellow dot

M1 trend = M5 trend = M15 trend, Green dot

M1 trend different from M5 trend, Gray dot.

Of course the user should be able to change the parameters.

I don't know anything in MQL4 programming so if someone can code this and share it, I'll appreciate it.

Thanks

Descaboy

 

Highest Value in Custom Indicator for ea

Hello,

i just started with mql4 and don't know how to solve my problem. What i got: a custom trend indicator which has two indexbuffers, 1 for positive trend, 2 for negative trend. he's painting in bars.

now, for my ea, i want to find out which is the highest bar of a posivite trend.

i tried to do this with a for-loop.

double myarray[99999999];

double j;

for (int i=1 ; j==0 ; i++)

{

j = iCustom(NULL,0,"CustomIndi",IndiParameters,1,i);

myarray=j;

}

double high = ArrayMaximum(myarray);

double highvalue = iCustom(NULL,0,"CustomIndi",IndiParameters,0,high);

i thought i need to size the trend first in which to find the highest value. So i put j==0 for condition, because if iCustom with indexbuffer 1 is 0, then i have a negative trend (icustom with indexbuffer 2 positive). i put the growing i into the shift of icustom, that i find the trend from back to front.

To find the highest bar, i let him write all values for j in a array and read it with arraymaximum.

Well, that did not work. i do not get the highest bar, most times i get the bar before actual bar.

Could someone help me please? With corrections in this way or a complete new.

Sry for mistakes, hope u all understand me, english is not my motherlanguage.

best regards

 

Why?

for (int i=1 ; j==0 ; i++)

You are saying start with i equal to 1 until j equals 0. Sometimes iCustom returns EMPTY_VALUE instead of 0. Do things the simple way. Test the return value with an if j not equal to 0 and not equal to EMPTY_VALUE.

 

Thanks for answer. Hope I understood you right i tried this:

for (int i=1 ; j==0 ; i++)

{

j = iCustom(NULL,0,"CustomIndi",IndiParameters,1,i);

if (j!=0 && j!=EMPTY_VALUE)

myarray=j;

}

Still the same problem. I do not get EMPTY_VALUE, i searched for it with an alert, to be sure.

Is there another way to do this (maybe easier) or is this the right way and i only have to get it work?

Reason: