![]() |
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
|
|||||||
| Indicator Development Support for the development of custom indicators using NinjaScript. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Member
Join Date: Jul 2007
Posts: 93
Thanks: 0
Thanked 0 times in 0 posts
|
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. |
|
|
|
|
|
#2 |
|
Senior Member
Join Date: Jun 2007
Posts: 218
Thanks: 0
Thanked 1 time in 1 post
|
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.
|
|
|
|
|
|
#3 |
|
Member
Join Date: Jul 2007
Posts: 93
Thanks: 0
Thanked 0 times in 0 posts
|
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. |
|
|
|
|
|
#4 |
|
Administrator
Join Date: Nov 2004
Location: Denver, CO, USA
Posts: 11,163
Thanks: 6
Thanked 45 times in 32 posts
|
The wizard does allow you to set a "double" type input instead of integer.
Ray
NinjaTrader Customer Service |
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
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 |