1. Originally Posted by ixbone
well i dont understand the logic completly well, but whatever, 5 for 5 digits, 0.5 for 4 digits broker, it works, thats the point :-) i'll keep your quote in my mind, if someday i need it.
The purpose of the MathAbs is to turn a negative number into a positive number. So, if the MACD is -0.0023, it will return 0.0023 instead. In this application it means you can go both long and short with the MACD either above or below the zero line. If, however, the MACD is very close to the zero line, the EA won't trade.

The other thing here is that you are normalising the double to 4 decimal places. So, if the MACD is 0.00009, the equation will return 0.0000 instead because it will ignore the value of the 5th decimal place. If you are setting your trade entry threshold at 0.00005 (ie 5 * Point for a 5-digit broker), then the trade won't actually trip until the MACD hits 0.0001 rather than the 0.00005 which I suspect you may have intended.

That's why I questioned the use of the two functions to process the MACD in my earlier post.

2. Originally Posted by jezzer1961
The purpose of the MathAbs is to turn a negative number into a positive number. So, if the MACD is -0.0023, it will return 0.0023 instead. In this application it means you can go both long and short with the MACD either above or below the zero line. If, however, the MACD is very close to the zero line, the EA won't trade.

The other thing here is that you are normalising the double to 4 decimal places. So, if the MACD is 0.00009, the equation will return 0.0000 instead because it will ignore the value of the 5th decimal place. If you are setting your trade entry threshold at 0.00005 (ie 5 * Point for a 5-digit broker), then the trade won't actually trip until the MACD hits 0.0001 rather than the 0.00005 which I suspect you may have intended.

That's why I questioned the use of the two functions to process the MACD in my earlier post.
jezzer,

thx, for your help and explanation, it helps me a lot zu understand how indis are working

this code is combined with 3 other indis (stoch,rvi,rsi) to generate entry signals, all indis must confirm the signal in their given range, then the ea opens the buy/sell trade. yes there not so much confirmed signals, but i trade more pairs for diversification and higher lot size.
My mistake was my non understanding of the 5*points logic (unusually for me). stoch, rvi, rsi coding wasnt a problem for me, but this macd code snippet was for testing first (5digits broker) and was working properly with the others indies well, so i dont remove it. As an technician, "i must know" how it works and why it dont work on 4 digits.
My EA is an high secure martingale system, with 4 indies, separate reverse and non reverse EA, basket, time trading and much more features.

So thanks again for your help, without your suggestions, i can only trade on 5 digits broker, now i can trade both = broker quote engine diversification + broker time diversification

IX