NinjaTrader Support Forum  
X

Attention!

This website will be down for maintenance from Friday May 24th at 6PM MDT until Saturday May 25th at 11AM MDT. We apologize for the inconvenience. If you need assistance during this time, please email sales@ninjatrader.com


Go Back   NinjaTrader Support Forum > NinjaScript Development Support > Indicator Development

Indicator Development Support for the development of custom indicators using NinjaScript.

Reply
 
Thread Tools Display Modes
Old 08-02-2007, 04:20 PM   #1
Richard Von
Member
 
Join Date: Jul 2007
Posts: 93
Thanks: 0
Thanked 0 times in 0 posts
Default Variable rounded

I coded the attached indicator which has two inputs, Upper and Lower, each set to .03. When applied to a chart, the indicator window shows them at that value.

But the indicator doesn't work. To debug, I print the values to the Output Window which shows that both upper and lower or Upper and Lower are rounded to 1 -- which throws everything out of range.

I'm pretty sure that the double data type allows for the .03.

What's changing this?

ALSO: My square now print in the price window. Is there a way to make them print in the MACD window?

Thanks.
Attached Files
File Type: cs vWACRXChannel.cs (7.4 KB, 4 views)
Richard Von is offline  
Reply With Quote
Old 08-02-2007, 04:50 PM   #2
Gumphrie
Senior Member
 
Join Date: Jun 2007
Posts: 218
Thanks: 0
Thanked 1 time in 1 post
Default

Two things:

1. Your public variables in the properties section are ints not doubles.

2. You have "Math.Max(1, value)" in the properties section which will always round the number up to at least 1.

The other problem:

All draw objects will output to the price window unless you specify 'DrawOnPricePanel' to false in Initialize() (as I mentioned earlier).
Last edited by Gumphrie; 08-02-2007 at 04:52 PM.
Gumphrie is offline  
Reply With Quote
Old 08-03-2007, 06:36 AM   #3
Richard Von
Member
 
Join Date: Jul 2007
Posts: 93
Thanks: 0
Thanked 0 times in 0 posts
Default

Thanks. The Math.Max setting was done automatically by the NinjaTrader code generator. But I changed the settings of those and the function works fine.

Thanks also for the panel info. I must have missed it in your posts to others.

Thanks so much.
Richard Von is offline  
Reply With Quote
Old 08-03-2007, 06:55 AM   #4
NinjaTrader_Ray
Administrator
 
NinjaTrader_Ray's Avatar
 
Join Date: Nov 2004
Location: Denver, CO, USA
Posts: 11,163
Thanks: 6
Thanked 45 times in 32 posts
Default

The wizard does allow you to set a "double" type input instead of integer.
NinjaTrader_Ray 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
How to add minutes to variable in ToTime format OnePutt General Programming 4 06-09-2007 11:38 PM
Output variable values NinjaTrader_Josh Strategy Development 0 05-19-2007 09:39 PM
Exposing non dataseries variable tquinn General Programming 10 05-17-2007 04:12 PM
User variable scope ct General Programming 1 05-08-2007 07:02 AM
Compile error with MIN and MAX variable assignment lewdfinger General Programming 2 02-10-2007 07:13 AM


All times are GMT -6. The time now is 02:24 PM.