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 CarlTrading, 05-11-2026, 05:56 AM
    0 responses
    52 views
    0 likes
    Last Post CarlTrading  
    Started by CarlTrading, 05-10-2026, 08:12 PM
    0 responses
    29 views
    0 likes
    Last Post CarlTrading  
    Started by Hwop38, 05-04-2026, 07:02 PM
    0 responses
    190 views
    0 likes
    Last Post Hwop38
    by Hwop38
     
    Started by CaptainJack, 04-24-2026, 11:07 PM
    0 responses
    354 views
    0 likes
    Last Post CaptainJack  
    Started by Mindset, 04-21-2026, 06:46 AM
    0 responses
    273 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Working...
    X