Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Cannot convert method group 'ToString' to non-delegate type 'string'. Did you intend

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

    Cannot convert method group 'ToString' to non-delegate type 'string'. Did you intend

    What's wrong with this code? It generates the error:

    Cannot convert method group 'ToString' to non-delegate type 'string'. Did you intend to invoke the method?

    Code:

    string Str1, Str2;
    Str1=Position.MarketPosition.ToString;
    Str2=Position.Quantity.ToString;
    Print(Str1);
    Print(Str2);

    #2
    ToString() is a method not a property. Should read:

    Str1=Position.MarketPosition.ToString();
    Str2=Position.Quantity.ToString();
    DierkNinjaTrader Customer Service

    Comment


      #3
      Thanks!

      Obvious...

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by canzana, Today, 12:11 AM
      0 responses
      1 view
      0 likes
      Last Post canzana
      by canzana
       
      Started by canzana, Today, 12:10 AM
      0 responses
      1 view
      0 likes
      Last Post canzana
      by canzana
       
      Started by thebionukerlife, Yesterday, 11:41 PM
      0 responses
      2 views
      0 likes
      Last Post thebionukerlife  
      Started by thebionukerlife, Yesterday, 11:40 PM
      0 responses
      2 views
      0 likes
      Last Post thebionukerlife  
      Started by KirkHammett, Yesterday, 11:15 PM
      0 responses
      5 views
      0 likes
      Last Post KirkHammett  
      Working...
      X