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 NullPointStrategies, Today, 05:17 AM
    0 responses
    22 views
    0 likes
    Last Post NullPointStrategies  
    Started by argusthome, 03-08-2026, 10:06 AM
    0 responses
    120 views
    0 likes
    Last Post argusthome  
    Started by NabilKhattabi, 03-06-2026, 11:18 AM
    0 responses
    63 views
    0 likes
    Last Post NabilKhattabi  
    Started by Deep42, 03-06-2026, 12:28 AM
    0 responses
    41 views
    0 likes
    Last Post Deep42
    by Deep42
     
    Started by TheRealMorford, 03-05-2026, 06:15 PM
    0 responses
    45 views
    0 likes
    Last Post TheRealMorford  
    Working...
    X