Can anyone out there please tell my why these two simple equations, do exactly the opposite of what they're supposed to do?
limit = avgprice+((Target*10)*Point); //----Calculate Limit
pl = (Bid-avgprice)*mult; //----calculate open position profit/loss in pips
These two lines are simple arithmetic. calculating a limit based on a previously calculated average price (which is calculated correctly) and a user input. In the above example, the user input (hard coded) is 100 (for 100 pips). The average price is 1.57000. The result SHOULD be 1.58000, but it calculates, 1.56000...I have checked this again and again. I'm not seeing things.
As well the "pl" could calculate open position profits by simply subtracting the bid (for a long) from the average price (which again I have confirmed is calculated correctly). Thus if the average price is 1.5700 and the current pid is 1.5701, the pl should read 1, but instead reads -4.7...HUH?
These two equations, seem to be the only bit of code that is screwy...can anyone explain why this is?
limit = avgprice+((Target*10)*Point); //----Calculate Limit
pl = (Bid-avgprice)*mult; //----calculate open position profit/loss in pips
These two lines are simple arithmetic. calculating a limit based on a previously calculated average price (which is calculated correctly) and a user input. In the above example, the user input (hard coded) is 100 (for 100 pips). The average price is 1.57000. The result SHOULD be 1.58000, but it calculates, 1.56000...I have checked this again and again. I'm not seeing things.
As well the "pl" could calculate open position profits by simply subtracting the bid (for a long) from the average price (which again I have confirmed is calculated correctly). Thus if the average price is 1.5700 and the current pid is 1.5701, the pl should read 1, but instead reads -4.7...HUH?
These two equations, seem to be the only bit of code that is screwy...can anyone explain why this is?