So was coding up a function last night and was just trying to Comment my Tp and Sl levels on the screen.. They showed as the full numbers going many Digits past the decimal point... Ok.. So i Normalize it down to 2 digits... and it just wont work.. I either get the same number of many digits showing or sometimes ill get 4 .. But either way it was never consistent..I even made up a dummy test EA just to test this one specific thing and it did the same problems there.. You can see that the Tp normalized down but the Sl didnt.. Same code used for both..
Any ideas?
the code used;
Code: Select all
void OnTick()
{
GetSlAmount();
GetTpAmount();
Comment("Sl amount = ",slamount,
"\n Tp Amount = ",TpAmount);
}
//+------------------------------------------------------------------+
void GetSlAmount() {
slamount=NormalizeDouble(.01*(SlPercent*Balance),2);
}//end of GetSlAmount();
void GetTpAmount()
{
TpAmount=NormalizeDouble(.01*(TpPercent*Balance),2);
}//end of GetTpAmount();