2. something is wrong acting the rules ea with hma, look at pictures.

Maybe better to open/close position when divergence appers will be :
to confirme signal in : value hma1(5)> value hma2(12) - buy
1(5)< 2(12) - sell

and close buy : at the moment hma1(5) cross down < hma2(12)
close sell 1(5) cross up > 2(12)

3. Ok, here is another version.

4. Originally Posted by funyoo
Ok, here is another version.
thanks, could you add to this condition : usehma-true/false ?
it help to eliminate what is bad

5. i'm optimesed v.1.3
results are ... no good

6. so, i,m not programmer ,i tried do condition to hma cross in/out trade .
But i'm ignorant so please explain when is the moment -"0" " i" "i+1",
like on the picture? or on the second side ?

7. Originally Posted by przem81621
so, i,m not programmer ,i tried do condition to hma cross in/out trade .
But i'm ignorant so please explain when is the moment -"0" " i" "i+1",
like on the picture? or on the second side ?
Yes that's like that.

0 = current bar
i = previous bar
i+1 = second previous bar, etc...

8. Originally Posted by funyoo
Yes that's like that.

0 = current bar
i = previous bar
i+1 = second previous bar, etc...
so, what am i did ?
I've to test it

9. Originally Posted by przem81621
so, what am i did ?
I've to test it
It's nice that you want to code, it's very simple. Anyone can code, you just have to know english and that's all, then it is only logic.

10. Originally Posted by funyoo
It's nice that you want to code, it's very simple. Anyone can code, you just have to know english and that's all, then it is only logic.

uhmm, simply

I find that my comp is to slow to do back test
but ea work

tell me , what are you thinking about moment of cross stoch condition ? better will be used moment " 0 " and one back " i " ,
or that whitch ended "i" and " i+1"