EA flexibilization
-
Here Im showing you a flexible way of applying a pretty simple RSI strategy.
https://fxdreema.com/shared/UDvtPF86
The left side of the EA is about a classic/rigid triple conditions built. The right side is the flexible version of it.
I attached below the results on the EURUSD H1 for each version for comparison.
The first version of the strategy :

With 11000 trades and 1.08 PF overtimeThe second version of the strategy :

With 28000 trades and a 2.05 FP overtime
It seems the flexible version of the EA gives way more trades and a better stability overtime.Note : The formulas are not elegant at all and a bit ambiguous so tell me if you have some questions
-
@seb-0 Impressive results. Sdaly, I don't understand what those custom code blocks do.
-
@l-andorrà
Yes Ill explain
In the custom blocks I am actually using the RSI formula. Because it converge to 100 that is the scale on which the score is expressed.-
The first line is 100-100/pow(pow((1+rsi-Rlvl),0.5),2), lets begin with 100-100/(1+rsi-Rlvl).
When the "rsi" value is getting important the value of the formula score is increasing also, the score so. Basically I applied the RSI formula to the RSI, I could just use the value of the RSI and interpret it as a score, but I needed it to be more sensitive in the extreme values.
The score is beginning to be positive when "rsi" is above Rlvl-1(lets say 55) only. And the RSI formula allows a non linear value variation(increases fast at the beginning then slower and slower).
Then I added the exponents : 100-100/pow(pow((1+rsi-Rlvl),0.5),2). Because when "1+rsi-Rlvl" is below 0 the score value is positive again and I don't want that. So with the exponents I achieved : (x^(1/2))^2 = x if x > 0, (x^(1/2))^2 = nan(ind) if x < 0 You can't square root a negative value -
In the second line : 100-100/pow(pow((1+k2*(-dif+atr)/atr),0.5),2 It's the same thing with a k2 coefficient parameter.
With (-dif+atr)/atr, when "dif" increases(ma100 is more above ma200), the score increases also. I just expressed the "dif" relatively to the "atr".
I also added "+atr" cause I want the score to begin being positive when ma100 slightly < ma200 because, when its the case on these periods, there still can be the MAs(ma50>ma500) reversed on a higher or lower period. And the more ma100>ma200, the more configurations of MAs will be in the same order, the bigger the score. -
In the third line : Same thing, with here, the [bottomWickSize relative to the bodySize] as "x" variable.
Then I am averaging it dividing by 3.
The thinking is the same for the opposite signals.
Finally I open a trade when the averaged score is above a certain threshold.
-
-
@seb-0 .. Hi.. looking at whats needed to write a sustainable expert, I have come to the conclusion I will never be able to make a profitable one... Very impressive work!
So a dumb question: Is the formula in my picture the same as what you wrote on top in a sentence, because I am trying to understand what you wrote and I am only getting more confuse?

-
@alphaomega
That is it you are on the way!
The middle brackets of the first formula are unnecessary actually.
I tried to explain how the formula is playing its role above, but it isn't easy to understand at first I know -
@seb-0 thank you for sharing this system with us.Just a question, I state that I am not a mathematician but making the power of 0.5 and then the power of 2 you get the initial number that is the two operations cancel each other out. Ps: i only saw the ea, i didn't download it because as a free user i am not allowed.
-
@miki
No problem : )
I explained in my answer to @l-andorrà above why I did that, I just don't want negative input values to give an output number, to exclude the possibility of a signal in this situation. -
@seb-0 are you sure the custom code is right? Because I see that even the builder detects errors in the custom code.
-
@miki Oh really ? Mine doesn't detect any, are you on mq4 ?
-
@seb-0 no i'm on mt5 hedge account and i seen that your ea is designed for netting account but what i mean, as you can see in the picture the part of the code that stays green, builder say you that this part is wrong

pow is green instead blue ,brackets are green instead black same for wup variable is green instead blue -
@miki
To be honest I have no idea what the colors mean, the second line is the same as the first one until the pow brackets, but top pows are black while the others are green so..