Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Operator >cannot be applied to operands of type method group

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

    Operator >cannot be applied to operands of type method group

    Iam coding a strategy based on volumetric bars, but as soon as I try to reference the previous bar delta (example) I get the error code Operator '>' cannot be applied to operands of type 'method group' and 'method group'.

    This code is fine.
    && barsType.Volumes[CurrentBar].BarDelta > barsType.Volumes[CurrentBar-1].BarDelta

    This line of code looks the same, but I receive an error.
    && barsType.Volumes[CurrentBar].GetMaximumNegativeDelta > barsType.Volumes[CurrentBar-1].GetMaximumNegativeDelta

    In addition to the above I receive the error Operator '*' cannot be applied to operands of type 'double' and 'method group' for below code. Do I just need to create another variable?
    && barsType.Volumes[CurrentBar].BarDelta > (DeltaPercentage * barsType.Volumes[CurrentBar].GetMaximumPositiveDelta)

    Thanks in advance!

    #2
    Hello,

    Thank you for your post.

    GetMaximumNegativeDelta() and GetMaximumPositiveDelta() are methods, so you need to add parentheses to the method call.

    Code:
    barsType.Volumes[CurrentBar].GetMaximumNegativeDelta() > barsType.Volumes[CurrentBar-1].GetMaximumNegativeDelta()
    Code:
    barsType.Volumes[CurrentBar].BarDelta > (DeltaPercentage * barsType.Volumes[CurrentBar].GetMaximumPositiveDelta())
    Please let me know if you have any further questions.

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Mindset, 04-21-2026, 06:46 AM
    0 responses
    86 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by M4ndoo, 04-20-2026, 05:21 PM
    0 responses
    125 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Started by M4ndoo, 04-19-2026, 05:54 PM
    0 responses
    64 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Started by cmoran13, 04-16-2026, 01:02 PM
    0 responses
    117 views
    0 likes
    Last Post cmoran13  
    Started by PaulMohn, 04-10-2026, 11:11 AM
    0 responses
    67 views
    0 likes
    Last Post PaulMohn  
    Working...
    X