NexusFi: Find Your Edge


Home Menu

 





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


Discussion in NinjaTrader

Updated
      Top Posters
    1. looks_one bergvall63 with 7 posts (3 thanks)
    2. looks_two Zondor with 5 posts (13 thanks)
    3. looks_3 Silvester17 with 1 posts (1 thanks)
    4. looks_4 ratfink with 1 posts (3 thanks)
      Best Posters
    1. looks_one ratfink with 3 thanks per post
    2. looks_two Zondor with 2.6 thanks per post
    3. looks_3 Silvester17 with 1 thanks per post
    4. looks_4 bergvall63 with 0.4 thanks per post
    1. trending_up 4,286 views
    2. thumb_up 20 thanks given
    3. group 3 followers
    1. forum 13 posts
    2. attach_file 5 attachments




 
Search this Thread

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

  #1 (permalink)
bergvall63
Pinewood Texas
 
Posts: 7 since Aug 2010
Thanks Given: 4
Thanks Received: 3

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

Can you help answer these questions
from other members on NexusFi?
REcommedations for programming help
Sierra Chart
Increase in trading performance by 75%
The Elite Circle
Better Renko Gaps
The Elite Circle
MC PL editor upgrade
MultiCharts
How to apply profiles
Traders Hideout
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Just another trading journal: PA, Wyckoff & Trends
34 thanks
Tao te Trade: way of the WLD
24 thanks
GFIs1 1 DAX trade per day journal
17 thanks
Vinny E-Mini & Algobox Review TRADE ROOM
13 thanks
My NQ Trading Journal
12 thanks
  #2 (permalink)
 
Zondor's Avatar
 Zondor 
Portland Oregon, United States
 
Experience: Beginner
Platform: Ninjatrader®
Broker: CQG, Kinetick
Trading: Gameplay Klownbine® Trading of Globex
Posts: 1,333 since Jul 2009
Thanks Given: 1,246
Thanks Received: 2,731

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
Follow me on Twitter Visit my NexusFi Trade Journal Reply With Quote
Thanked by:
  #3 (permalink)
bergvall63
Pinewood Texas
 
Posts: 7 since Aug 2010
Thanks Given: 4
Thanks Received: 3



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)
 
Zondor's Avatar
 Zondor 
Portland Oregon, United States
 
Experience: Beginner
Platform: Ninjatrader®
Broker: CQG, Kinetick
Trading: Gameplay Klownbine® Trading of Globex
Posts: 1,333 since Jul 2009
Thanks Given: 1,246
Thanks Received: 2,731


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
Follow me on Twitter Visit my NexusFi Trade Journal Reply With Quote
  #5 (permalink)
bergvall63
Pinewood Texas
 
Posts: 7 since Aug 2010
Thanks Given: 4
Thanks Received: 3

Thanks Zondor

I really appreciate it.

Attached Files
Elite Membership required to download: Euro.cs
Reply With Quote
  #6 (permalink)
 
Zondor's Avatar
 Zondor 
Portland Oregon, United States
 
Experience: Beginner
Platform: Ninjatrader®
Broker: CQG, Kinetick
Trading: Gameplay Klownbine® Trading of Globex
Posts: 1,333 since Jul 2009
Thanks Given: 1,246
Thanks Received: 2,731

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
Elite Membership required to download: Euro.cs
Follow me on Twitter Visit my NexusFi Trade Journal Reply With Quote
  #7 (permalink)
 
ratfink's Avatar
 ratfink 
Birmingham UK
Market Wizard
 
Experience: Intermediate
Platform: NinjaTrader
Broker: TST/Rithmic
Trading: YM/Gold
Posts: 3,633 since Dec 2012
Thanks Given: 17,423
Thanks Received: 8,425


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
Visit my NexusFi Trade Journal Reply With Quote
  #8 (permalink)
bergvall63
Pinewood Texas
 
Posts: 7 since Aug 2010
Thanks Given: 4
Thanks Received: 3


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
Click image for larger version

Name:	NT Script Editor.JPG
Views:	196
Size:	118.3 KB
ID:	153828  
Reply With Quote
  #9 (permalink)
bergvall63
Pinewood Texas
 
Posts: 7 since Aug 2010
Thanks Given: 4
Thanks Received: 3


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
Thanked by:
  #10 (permalink)
 
Zondor's Avatar
 Zondor 
Portland Oregon, United States
 
Experience: Beginner
Platform: Ninjatrader®
Broker: CQG, Kinetick
Trading: Gameplay Klownbine® Trading of Globex
Posts: 1,333 since Jul 2009
Thanks Given: 1,246
Thanks Received: 2,731


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
Follow me on Twitter Visit my NexusFi Trade Journal Reply With Quote
Thanked by:




Last Updated on September 5, 2014


© 2024 NexusFi™, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
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.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Privacy Policy - Downloads - Top
no new posts