Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Trying a Probability Indicator Need Help!

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    #16
    thanks Bud. I used Code:
    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.
    You can use the 'Math.Round' method to find the nearest integer.

    ('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:

    Code:
    int p = (int) Math.Round((double) Period/2); // Period declared as int
    It seems that Math.Round expects a double as its argument.

    As always with these things, it comes down to making the appropriate int/double declarations.

    Hope your indicator works well.

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Geovanny Suaza, 02-11-2026, 06:32 PM
    0 responses
    601 views
    0 likes
    Last Post Geovanny Suaza  
    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
    0 responses
    347 views
    1 like
    Last Post Geovanny Suaza  
    Started by Mindset, 02-09-2026, 11:44 AM
    0 responses
    103 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by Geovanny Suaza, 02-02-2026, 12:30 PM
    0 responses
    559 views
    1 like
    Last Post Geovanny Suaza  
    Started by RFrosty, 01-28-2026, 06:49 PM
    0 responses
    558 views
    1 like
    Last Post RFrosty
    by RFrosty
     
    Working...
    X