How to determine how strong is a resistance line ?

 

My EA trace resistance line but i'm looking to specfify how much a resistance is strong by counting all the touch made on this line on a ceratin period. ( like Resistance at 0.87800 on AUDUSD -> see image )

How to achieve this ?

Thks


Resistance Line

 

No idea ?

snif :)

 

This is no more than an idea. But you would get the result you want from the chart above by taking iLow() for the period in question of course. You could strengthen the signal if there are more lows in the vicinity as is the case in the chart.

But if it's not as neat as in the chart, which it's typically not, you could use Fractals. I use Fractals to set sl, and I'm about to try to having my EA's look for the most recent peak in Fractal values, sort of a Fractal of Fractals, to give a stronger sl. Maybe something along those lines could help with your question.

 
joetrader wrote >>

This is no more than an idea. But you would get the result you want from the chart above by taking iLow() for the period in question of course. You could strengthen the signal if there are more lows in the vicinity as is the case in the chart.

But if it's not as neat as in the chart, which it's typically not, you could use Fractals. I use Fractals to set sl, and I'm about to try to having my EA's look for the most recent peak in Fractal values, sort of a Fractal of Fractals, to give a stronger sl. Maybe something along those lines could help with your question.

Thanks...I will study this idea.

 

I finished my thought, and here's what I came up with. I use this to determine sl. Are you trying to determine resistance for sl or as a trade signal? I'm still trying to think of ways to program EA's to recognize patterns that are clearly visible to the naked eye like S/R lines or trends, but I haven't done any better than to depend on indicators so far. Anyway, here's my 'fractal of fractals' sl generator:

double BuyStopCalc()
{
for (BuyCycle=0;BuyCycle<CycleMax;BuyCycle++)
{
BuyStop=iFractals(NULL,0,MODE_LOWER,BuyCycle+1);
if (((BuyStop<(Bid-MinSL*Point))||(PreviousBuyStop<(Bid-MinSL*Point)))&&(PreviousBuyStop!=0)&&(BuyStop!=0)&&(BuyStop>PreviousBuyStop)) break;
if ((BuyStop>PreviousBuyStop)&&(BuyStop!=0)) PreviousBuyStop=BuyStop;
}
if (BuyCycle==CycleMax) BuyStop=(-1);
if(PreviousBuyStop!=0) BuyStop=PreviousBuyStop;
return(BuyStop);
}
double SellStopCalc()
{
for (SellCycle=0;SellCycle<CycleMax;SellCycle++)
{
SellStop=iFractals(NULL,0,MODE_UPPER,SellCycle+1);
if (((SellStop>(Ask+MinSL*Point))||(PreviousSellStop>(Ask+MinSL*Point)))&&(PreviousSellStop!=0)&&(SellStop!=0)&&(SellStop<PreviousSellStop)) break;
if ((SellStop>PreviousSellStop)&&(SellStop!=0)) PreviousSellStop=SellStop;
}
if (SellCycle==CycleMax) SellStop=(-1);
if(PreviousSellStop!=0) SellStop=PreviousSellStop;
return(SellStop);
}

It looks for fractals in past bars, and when it finds one, it looks for more. Once it finds a fractal with a higher value than the previous one, it stops because that's a peak. It then takes the higher value. If it finds no peaks by the end of the CycleMax, it takes the highest value and uses that. If it doesn't find any fractals, it returns -1 to indicate no trade.

I put in a MinSL variable to make sure it doesn't set a stoploss so close to the Ask that it stops out right away.

 

Hi JoeTrader

Are you trying to determine resistance for sl or as a trade signal?

I' m using R/S as trade signal and SL. I create them by a simple use of iLow/iHigh. I don't understand Fractals. What is the difference looking for a resistance with iLow instead of fractals ? You also need a loop to check the lower one...

It looks for fractals in past bars ? -> What is a fractal and what difference with ilow ?

I'm still trying to think of ways to program EA's to recognize patterns that are clearly visible to the naked eye like S/R lines or trends, but I haven't done any better than to depend on indicators so far

so am I ! I'm using both S/R line and indictors to make decision. However, I want to add how strong a level S/R is to avoid bad signal.

for (BuyCycle=0;BuyCycle<CycleMax;BuyCycle++) I suppose BuyCycle is Integer and define in top of EA ?

I will re-read Construction of Fractal Lines !

I will try to integrate your code into one module of my EA to test it and also the Ilow(). Thanks for sharing.

Philippe

 

Fractal Trailing Stop Loss design is discussed in series of articles, maybe below links of interest?

Designing a fractal-based trailing stop EA

Defining our Fractal-based Trailing Stop EA

Completing the Fractal-based Trailing Stop Logic


seeAlso:

Trend line Drawing with Fractals

 

my indicator will show you the strongest s/r

https://www.mql5.com/en/code/mt4

 
Matutin wrote >>

Hi JoeTrader

Are you trying to determine resistance for sl or as a trade signal?

I' m using R/S as trade signal and SL. I create them by a simple use of iLow/iHigh. I don't understand Fractals. What is the difference looking for a resistance with iLow instead of fractals ? You also need a loop to check the lower one...

It looks for fractals in past bars ? -> What is a fractal and what difference with ilow ?

I'm still trying to think of ways to program EA's to recognize patterns that are clearly visible to the naked eye like S/R lines or trends, but I haven't done any better than to depend on indicators so far

so am I ! I'm using both S/R line and indictors to make decision. However, I want to add how strong a level S/R is to avoid bad signal.

for (BuyCycle=0;BuyCycle<CycleMax;BuyCycle++) I suppose BuyCycle is Integer and define in top of EA ?

I will re-read Construction of Fractal Lines !

I will try to integrate your code into one module of my EA to test it and also the Ilow(). Thanks for sharing.

Philippe

The links above are good. A Fractal is just a turning point at the extreme of two bars it's between. I got the idea for using them as a stoploss with this article:

https://www.mql5.com/en/articles/1571

I probably gave you overkill with my "fractal of fractals" idea for finding s/l. I wrote it because I was tired of getting stopped out - My current EA tests pretty well but has been losing money while forward testing. But it would at least find the strong s/r lines on a chart, even in a trend.

But as far as setting s/l, here's what I've been using. All it does is finds the last fractal and sets it for stoploss as long as it's far enough from the current price (using the MinSL variable). I think I need to incorporate some sort of trailing stop with it though. But I liked the fractal trailing stop idea that fbj linked to.

double BuyStopCalc()
{
for (BuyCycle=0;BuyCycle<CycleMax;BuyCycle++)
{
BuyStop=iFractals(NULL,0,MODE_LOWER,BuyCycle+1);
if ((BuyStop>1)&&BuyStop<(Bid-MinSL*Point)) break;
}
if (BuyCycle==CycleMax) BuyStop=(-1);
return(BuyStop);
}

double SellStopCalc()
{
for (SellCycle=0;SellCycle<CycleMax;SellCycle++)
{
SellStop=iFractals(NULL,0,MODE_UPPER,SellCycle+1);
if ((SellStop>1)&&(SellStop>(Ask+MinSL*Point))) break;
}
if (SellCycle==CycleMax) SellStop=(-1);
return(SellStop);
}

Good stuff. Thanks for the challenge.