This is one of the badly thought-out features of MQL4. It is one of the very few (if any) programming languages that does this.

When you divide two integers, the result is an integer. It does not matter if you assign it to a double or not, the result is an integer.

doublevar = intvar1/intvar2; // result integer, ie rounded down.

Workaround:

doublevar = (intvar1+0.0)/intvar2; // result double

There is an article somewhere that explain all these number things.

Disclaimer: However, overall, I am still quite pleased with MQL4 and it's built in functions. :)

Okay anytime I divide anything like 4/6 or 5/8 i get 0. Does MQL4 automatically round fractions down to 0? This is a real pain because I need to base my buy orders on a number between 0 and 1. Basically I'm assigning each indicator a weighting, adding up the weightings for buy/sell signals and then dividing it by the total weightings.. like this:

if(indicatorA=x)

{

SellSignal=SellSignal+WeightingA

}

if(indicatorB=y)

{

SellSignal=SellSignal+WeightingB

}

double SellTrigger=SellSignal/TotalWeight;

//SellSignal is the sum of all indicator weightings showing overbought conditions, TotalWeight is the fixed maximum value SellSignal can take ie the sum of all the signal weightings

But it consistently returns SellTrigger = 0 even thou SellSignal is showing some integer