Help with compile error when importing indicator from NT6.5 to NT7 - NinjaTrader | futures io social day trading
futures io futures trading


Help with compile error when importing indicator from NT6.5 to NT7
Updated: Views / Replies:1,426 / 13
Created: by bergvall63 Attachments:5

Welcome to futures io.

(If you already have an account, login at the top of the page)

futures io is the largest futures trading community on the planet, with over 90,000 members. At futures io, our goal has always been and always will be to create a friendly, positive, forward-thinking community where members can openly share and discuss everything the world of trading has to offer. The community is one of the friendliest you will find on any subject, with members going out of their way to help others. Some of the primary differences between futures io and other trading sites revolve around the standards of our community. Those standards include a code of conduct for our members, as well as extremely high standards that govern which partners we do business with, and which products or services we recommend to our members.

At futures io, our focus is on quality education. No hype, gimmicks, or secret sauce. The truth is: trading is hard. To succeed, you need to surround yourself with the right support system, educational content, and trading mentors – all of which you can find on futures io, utilizing our social trading environment.

With futures io, you can find honest trading reviews on brokers, trading rooms, indicator packages, trading strategies, and much more. Our trading review process is highly moderated to ensure that only genuine users are allowed, so you don’t need to worry about fake reviews.

We are fundamentally different than most other trading sites:
  • We are here to help. Just let us know what you need.
  • We work extremely hard to keep things positive in our community.
  • We do not tolerate rude behavior, trolling, or vendors advertising in posts.
  • We firmly believe in and encourage sharing. The holy grail is within you, we can help you find it.
  • We expect our members to participate and become a part of the community. Help yourself by helping others.

You'll need to register in order to view the content of the threads and start contributing to our community.  It's free and simple.

-- Big Mike, Site Administrator

Reply
 5  
 
Thread Tools Search this Thread
 

Help with compile error when importing indicator from NT6.5 to NT7

  #1 (permalink)
Trading Apprentice
Pinewood Texas
 
Futures Experience: Intermediate
Platform: NinjaTrader
Favorite Futures: 6e
 
Posts: 7 since Aug 2010
Thanks: 4 given, 3 received

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.

DrawText("tot"+totcntr, ". " + tot.ToString() + " .", 0, getY(lowestprice)-TickSize, Color.White, fnt2, StringAlignment.Center, Color.Black, Color.Black, 6);
else if (tot < 0)
DrawText("tot"+totcntr, ". " + tot.ToString() + " .", 0, getY(lowestprice)-TickSize, Color.White, fnt2, StringAlignment.Center, Color.Black, Color.Red, 6);
else
DrawText("tot"+totcntr, ". " + tot.ToString() + " .", 0, getY(lowestprice)-TickSize, Color.Black, fnt2, StringAlignment.Center, Color.Black, Color.LimeGreen, 6);
}

DrawText("tag"+cnt, "." + getStr(vol) + "*" + getStr(vol_diff), 0, getY(pr), Color.White, fnt, StringAlignment.Center, Color.Black, Color.Black, 8);
else if (vol_diff < 0)
DrawText("tag"+cnt, "." + getStr(vol) + "*" + getStr(abs), 0, getY(pr), Color.White, fnt, StringAlignment.Center, Color.Black, Color.Red, shade);
else
DrawText("tag"+cnt, "." + getStr(vol) + "*" + getStr(abs), 0, getY(pr), Color.Black, fnt, StringAlignment.Center, Color.Black, Color.LimeGreen, shade);
}

DrawText("tag"+cnt, "." + getStr(vol) + "*" + getStr(vol_diff), 0, getY(pr), Color.Black, fnt, StringAlignment.Center, Color.Black, Color.Orange, 8);
}


I would appreciate any help, Anders

Reply With Quote
 
  #2 (permalink)
Elite Member
Portland Oregon, United States
 
Futures Experience: Beginner
Platform: Ninjatrader®
Broker/Data: CQG, Kinetick
Favorite Futures: Gameplay Klownbine® Trading of Globex
 
Zondor's Avatar
 
Posts: 1,327 since Jul 2009
Thanks: 1,246 given, 2,635 received

Draw methods changed in NT7

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
Reply With Quote
The following user says Thank You to Zondor for this post:
 
  #3 (permalink)
Trading Apprentice
Pinewood Texas
 
Futures Experience: Intermediate
Platform: NinjaTrader
Favorite Futures: 6e
 
Posts: 7 since Aug 2010
Thanks: 4 given, 3 received



Zondor View Post
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.

Hi Zondor,

Unfortunately I have zero programming skills, so what might seem easy to someone is not that clear to me. I don't even know where to start...

Anders

Reply With Quote
 
  #4 (permalink)
Elite Member
Portland Oregon, United States
 
Futures Experience: Beginner
Platform: Ninjatrader®
Broker/Data: CQG, Kinetick
Favorite Futures: Gameplay Klownbine® Trading of Globex
 
Zondor's Avatar
 
Posts: 1,327 since Jul 2009
Thanks: 1,246 given, 2,635 received

Where to start

Answer
This post has been selected as an answer to the original posters question Answer


bergvall63 View Post
Hi Zondor,

Unfortunately I have zero programming skills, so what might seem easy to someone is not that clear to me. I don't even know where to start...

Anders

If you post the cs file I will fix it.

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

Last edited by Zondor; August 18th, 2014 at 04:38 PM.
Reply With Quote
The following 4 users say Thank You to Zondor for this post:
 
  #5 (permalink)
Trading Apprentice
Pinewood Texas
 
Futures Experience: Intermediate
Platform: NinjaTrader
Favorite Futures: 6e
 
Posts: 7 since Aug 2010
Thanks: 4 given, 3 received

Thanks Zondor

I really appreciate it.

Attached Files
Register to download File Type: cs Euro.cs (57.6 KB, 5 views)
Reply With Quote
 
  #6 (permalink)
Elite Member
Portland Oregon, United States
 
Futures Experience: Beginner
Platform: Ninjatrader®
Broker/Data: CQG, Kinetick
Favorite Futures: Gameplay Klownbine® Trading of Globex
 
Zondor's Avatar
 
Posts: 1,327 since Jul 2009
Thanks: 1,246 given, 2,635 received

This version compiles on my PC

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
Attached Files
Register to download File Type: cs Euro.cs (57.3 KB, 16 views)
Reply With Quote
The following 5 users say Thank You to Zondor for this post:
 
  #7 (permalink)
Elite Member
Birmingham UK
 
Futures Experience: Intermediate
Platform: NinjaTrader
Broker/Data: IG/eSignal
Favorite Futures: Dax
 
ratfink's Avatar
 
Posts: 3,339 since Dec 2012
Thanks: 11,282 given, 7,092 received

Answer
This post has been selected as an answer to the original posters question Answer


Zondor View Post
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.

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.

 
Code
        protected override void OnBarUpdate()
        {
			if (CurrentBar % 100 == 0)
            {
				DrawText("tag"+CurrentBar, true, "show tag"+CurrentBar, 0, High[0] /*double Y*/, 0 /*int pixelOffset*/, 
							Color.Black, ChartControl.Font, StringAlignment.Center, Color.Black, Color.Blue, 5);
			}
        }

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.

Travel Well

Last edited by ratfink; August 21st, 2014 at 04:47 AM.
Reply With Quote
The following 3 users say Thank You to ratfink for this post:
 
  #8 (permalink)
Trading Apprentice
Pinewood Texas
 
Futures Experience: Intermediate
Platform: NinjaTrader
Favorite Futures: 6e
 
Posts: 7 since Aug 2010
Thanks: 4 given, 3 received


Zondor View Post
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.

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!

Attached Thumbnails
Help with compile error when importing indicator from NT6.5 to NT7-nt-script-editor.jpg  

Last edited by bergvall63; August 21st, 2014 at 07:32 AM.
Reply With Quote
 
  #9 (permalink)
Trading Apprentice
Pinewood Texas
 
Futures Experience: Intermediate
Platform: NinjaTrader
Favorite Futures: 6e
 
Posts: 7 since Aug 2010
Thanks: 4 given, 3 received


ratfink View Post
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.

 
Code
        protected override void OnBarUpdate()
        {
			if (CurrentBar % 100 == 0)
            {
				DrawText("tag"+CurrentBar, true, "show tag"+CurrentBar, 0, High[0] /*double Y*/, 0 /*int pixelOffset*/, 
							Color.Black, ChartControl.Font, StringAlignment.Center, Color.Black, Color.Blue, 5);
			}
        }

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.


Thanks Ratfink for helping out. It's amazing to see how many nice guys/girls there are in this forum helping out us non-programmers. Much appreciated!

Anders

Reply With Quote
The following 2 users say Thank You to bergvall63 for this post:
 
  #10 (permalink)
Elite Member
Portland Oregon, United States
 
Futures Experience: Beginner
Platform: Ninjatrader®
Broker/Data: CQG, Kinetick
Favorite Futures: Gameplay Klownbine® Trading of Globex
 
Zondor's Avatar
 
Posts: 1,327 since Jul 2009
Thanks: 1,246 given, 2,635 received

What is this indicator doing, anyway?


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.

Please register on futures.io to view futures trading content such as post attachment(s), image(s), and screenshot(s).

"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

Last edited by Zondor; August 21st, 2014 at 12:45 PM.
Reply With Quote
The following user says Thank You to Zondor for this post:

Reply



futures io > > > > Help with compile error when importing indicator from NT6.5 to NT7

Thread Tools Search this Thread
Search this Thread:

Advanced Search



Upcoming Webinars and Events (4:30PM ET unless noted)

Jigsaw Trading: TBA

Elite only

FuturesTrader71: TBA

Elite only

NinjaTrader: TBA

Jan 18

RandBots: TBA

Jan 23

GFF Brokers & CME Group: Futures & Bitcoin

Elite only

Adam Grimes: TBA

Elite only

Ran Aroussi: TBA

Elite only
     

Similar Threads
Thread Thread Starter Forum Replies Last Post
Importing Custom Indicator Causing Error Problems shmcclun NinjaTrader 17 May 23rd, 2016 11:29 AM
Error when importing an indicator. moneypenny NinjaTrader 4 February 17th, 2014 06:20 PM
Old NT6.5 indicator coding for NT7 jsengxx2 NinjaTrader Programming 3 October 8th, 2013 12:26 PM
converting an NT6.5 indicator to NT7 aligator Traders Hideout 3 March 2nd, 2011 07:01 PM
NT indicator script compiling issuses / error while importing skyfly NinjaTrader Programming 8 July 20th, 2010 01:56 AM


All times are GMT -4. The time now is 02:18 PM.

Copyright © 2017 by futures io, s.a., Av Ricardo J. Alfaro, Century Tower, Panama, +507 833-9432, info@futures.io
All information is for educational use only and is not investment advice.
There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
no new posts
Page generated 2017-12-15 in 0.15 seconds with 40 queries on phoenix via your IP 54.82.56.95