Welcome to NexusFi: the best trading community on the planet, with over 150,000 members Sign Up Now for Free
Genuine reviews from real traders, not fake reviews from stealth vendors
Quality education from leading professional traders
We are a friendly, helpful, and positive community
We do not tolerate rude behavior, trolling, or vendors advertising in posts
We are here to help, just let us know what you need
You'll need to register in order to view the content of the threads and start contributing to our community. It's free for basic access, or support us by becoming an Elite Member -- see if you qualify for a discount below.
-- Big Mike, Site Administrator
(If you already have an account, login at the top of the page)
Help with compile error when importing indicator from NT6.5 to NT7
Hi,
I found an old indicator on my old laptop, and I was curious to see if I could have better use of it with a few years more trading experience.
I have ZERO programming experience though, so when I look through the NT support forum, it's like martian to me.
When I compile the indicator I get the following message:
No overload for method 'DrawText' takes '10' arguments
The error code is CS1501
The same error shows in 7 different places. I am cutting and pasting the 7 different lines.
The signatures of the Draw methods changed between NT6.5 and NT7 so the ordering and number of parameters is slightly different. It is easy to fix.
"If we don't loosen up some money, this sucker is going down." -GW Bush, 2008
“Lack of proof that something is true does not prove that it is not true - when you want to believe.” -Humpty Dumpty, 2014
“The greatest shortcoming of the human race is our inability to understand the exponential function.” Prof. Albert Bartlett
If you open the file in the Ninjascript editor, the Intellisense popup feature will show you the parameters needed by the signature, which is how I will fix it. Which will only take a few minutes.
I won't import it. I will copy the cs file into the indicator folder and fix the compile errors one by one until they are all gone.
Lots of people went through this exact same exercise a few years ago, after NT7 first came out and legacy indicators stopped working. A similar situation looms in the near future with NT8, I can't wait.....
"If we don't loosen up some money, this sucker is going down." -GW Bush, 2008
“Lack of proof that something is true does not prove that it is not true - when you want to believe.” -Humpty Dumpty, 2014
“The greatest shortcoming of the human race is our inability to understand the exponential function.” Prof. Albert Bartlett
For NT7, two additional parameters, the boolean AutoScale and the integer y pixel offset, need to be included in the signatures of the DrawText method. This should work.
"If we don't loosen up some money, this sucker is going down." -GW Bush, 2008
“Lack of proof that something is true does not prove that it is not true - when you want to believe.” -Humpty Dumpty, 2014
“The greatest shortcoming of the human race is our inability to understand the exponential function.” Prof. Albert Bartlett
Correct about the params and thanks because I wasn't aware of pixelOffset as I don't use this overload, but you still need to pass in a double (usually price) for Y, as well as the pixel offset, so I don't think the GetY calls are what you want in that code as the value returned is inappropriate but the int returned would still get recast to double by the compiler.
e.g.
You could use the ChartControl/Plot bounds and work in integer pixel space using the Windows direct draw methods instead but that's not usually necessary.
Thank you so much for taking this on. Unfortunately I still get 4 error messages, new ones this time. I'm attaching an image of the errors. If you feel you don't have time to mess with this I totally understand. Again thanks for your help
Anders
Disregard the new error, I screwed up when I imported the Indicator!!
Again THANK YOU for helping out!
What's really interesting about this indicator is that it opens a new window that appears to be an enhanced DOM and Time and Sales combination.
The Drawing of items on the price panel seems to work fine without having to make any changes to the GetY methods. A quick look shows prices are being multiplied by 10,000 and then being converted to integers, consistent with this indicator being specific to the Euro currency. Despite this, the objects seem to be appearing at the proper ordinates on the price panel of the chart.
The only thing I looked at originally was the syntax of the signatures generating the compile errors. Now it might be worthwhile to figure out what this indicator is trying to accomplish. It is accumulating real time data and does not backfill anything when it starts up.
Looks like it may be a cumulative time and sales indicator showing trades at the bid and ask. If this is the case, as it continues to run it will create a volume profile.
"If we don't loosen up some money, this sucker is going down." -GW Bush, 2008
“Lack of proof that something is true does not prove that it is not true - when you want to believe.” -Humpty Dumpty, 2014
“The greatest shortcoming of the human race is our inability to understand the exponential function.” Prof. Albert Bartlett