Need Help Coding a New Indicator Idea

 
Hello MT4 Gurus,
I have this idea for a simple indicator, that I think would be very useful for everyone.



It would work like this:
If the current price is 10 pips or less near the current day HIGH or LOW them it plots a RED bar in a separate chart window.
And if not, then it plots a BLUE bar.
The 10 pips should be user changable.
I'm adding here in atachment a indicator that perhaps could aid to buid
the new indicator.

The purpose of this indicator is to prevent the trader to enter the market too close to the days maximum or low. Thank you Mico Yoshic

Files:
 
If the current price is 10 pips or less near the current day HIGH or LOW them it plots a RED bar in a separate chart window.

And if not, then it plots a BLUE bar.
The purpose of this indicator is to prevent the trader to enter the market too close to the days maximum or low.
During a trending day, current price will almost always near the day HIGH/LOW and the day new HIGH/LOW will be continuously established, then you will miss the opportunity to make profit. OTOH, during sideways the price may not fluctuate big enough and may eventually give you a loss.
 
Hello fireflies,
I'm aware of that problem but, this indicator its not intended to be used to trade alone.

My idea is to use it conjunction with a system, any system.
I Know that if a breaking news comes out and starts a new trend this indicator will be useless.

But just take the indicator that I attached before and make a visual backtest and see by your self how many times a normal trend in the mid day, or in the afternoon ends when its reachs the current day low or high. You will see that I'm right, and if you trade with a system that gives out good signals many times, and you can afford to stay out of tha market half the times that the system signals, then, these periods, would be good times to stay out, because they are very risky.

You never know if the Maximum (or minimun) will be the stop of the trend.

Example:
if the Maximum of the day is broken, most of the times after a awile it will retrace back to that breaking point, probably just to go up again, so, you can almost always get in, in the right time. This method for trading is more secure because then you would already known that that barrier was allready broken, and at this time your target will be probably the new day maximum.

Of course this doesn't happends always, example: very big news like - Interest rates and Non Farm Payrols etc.
 
You're quite right that before the price breaks it max of the day it often retraces back for a while, and you may capitalize the situation.
However when there is a big news like you mentioned, and you may already have an open position, what kind of SL are you suggesting for this kind of indicator?
Too tight (within day max/min) SL may give you a string of losses, a too wide SL (outside day max/min) may give you one big loss.

Hmm, anyway this is not a problem for this indicator in particular, but it will always be a problem for any strategy.
Cheers.