winPercent = (wonTrade/(wonTrade+lossTrade)) * 100;
where I declared everything a Double and it worked.
Only problem is it gives a Long Decimal number. any idea how to Round that up.
('Math.Floor' to find to highest integer below and 'Math.Ceiling' to find to lowest integer above. There's a lot of help about these C# methods online.)
This is from one of my scripts:
int p = (int) Math.Round((double) Period/2); // Period declared as int
As always with these things, it comes down to making the appropriate int/double declarations.
Hope your indicator works well.
Comment