NinjaTrader Support Forum  

Go Back   NinjaTrader Support Forum > NinjaScript Development Support > General Programming

General Programming General NinjaScript programming questions.

Reply
 
Thread Tools Display Modes
Old 07-11-2007, 05:36 AM   #1
MindSabre
Junior Member
 
Join Date: Apr 2007
Location: , ,
Posts: 26
Thanks: 0
Thanked 0 times in 0 posts
Default 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);
MindSabre is offline  
Reply With Quote
Old 07-11-2007, 06:34 AM   #2
NinjaTrader_Dierk
Administrator
 
NinjaTrader_Dierk's Avatar
 
Join Date: Mar 2005
Location: Bamberg, Germany
Posts: 9,994
Thanks: 0
Thanked 6 times in 6 posts
Default

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

Str1=Position.MarketPosition.ToString();
Str2=Position.Quantity.ToString();
NinjaTrader_Dierk is offline  
Reply With Quote
Old 07-11-2007, 07:13 AM   #3
MindSabre
Junior Member
 
Join Date: Apr 2007
Location: , ,
Posts: 26
Thanks: 0
Thanked 0 times in 0 posts
Default Thanks!

Obvious...
MindSabre is offline  
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Indicator convert from decimal to 32nds Json Indicator Development 5 03-08-2007 01:45 AM
How To Convert Simulator to Live longtex Installation and Licensing 7 05-31-2006 03:55 AM
Unknown OIF file type. Zardoz Automated Trading 3 04-17-2006 05:34 AM
Problem with 'Parameter Type' set to Price codeye Miscellaneous Support 5 12-09-2005 07:06 AM
Group Accounts jrn317 Miscellaneous Support 3 05-03-2005 06:41 AM


All times are GMT -6. The time now is 12:10 AM.