View Full Version : Help! Indicator disappeared.
Richard Von
10-01-2007, 06:52 AM
The attached indicator draws diamonds when an MACD and MACD avg cross each other. It is used on the same panel with and overlaying an MACD with the same fast, slow and smooth settings.
It has been working fine for some time but has disappeared from all charts using it Saturday. I have tried everything I can think of to fix it: I tried putting it on a brand new chart, recompiling, replacing with a backup version and recompiling, removing NinjaTrader through the Control Panel, clearing my browse cache and reinstalling NinjaTrader, all to no avail.
Other panels on some of these charts do have diamonds that show up.
This was a very useful indicator for me which I really need but I have no idea what to do next. Please help.
NinjaTrader_Dierk
10-01-2007, 07:04 AM
- please contact the author of the indicator for support
- if you are the author: the logs will give you indication what's going wrong.
Richard Von
10-01-2007, 07:10 AM
I am the author and have made no changes.
I found the log and there is nothing in there regarding this indicator. It has messages regarding another indicator "Failed to call method 'initialize' for indicator 'vWMACDSwingD'; Index was outside the bounds of the array." -- but that indicator is showing find on the chart. I think it just needed several bar inputs to work, and that indicator has never given any trouble.
Still no idea what would cause a working indicator to disappear when working fine for some time.
NinjaTrader_Dierk
10-01-2007, 07:13 AM
You'll find the logs at the "Logs" tab in the Control Center. You always should look there is something if funny.
Also: For debugging your indicator check out this thread on the educational ressources of this forum: http://www.ninjatrader-support.com/vb/showthread.php?p=16558#post16558
Richard Von
10-01-2007, 07:22 AM
Please see my edited comments from last post.
First, the code worked fine and has not changed.
Second, I did try a stripped down new version also with no results. No log errors.
Baffled.
NinjaTrader_Dierk
10-01-2007, 07:28 AM
1) I just threw your indicator on a chart here and it see something meaningful.
2) Please proceed as per link I provided to locate the source of trouble in your indicator.
Richard Von
10-01-2007, 10:32 AM
Here is my latest version and I'm still stumped. The output window shows that the code is finding the crosses, computing the right levels, and incrementing the tags -- but the diamonds still don't print.
I can find nothing wrong with the DrawDiamond code itself. I'd appreciate any help you can give.
NinjaTrader_Ray
10-01-2007, 11:01 AM
Check the y value parameter for the DrawDiamond() method, I bet you are setting it to a value that is offscreen. Subsitute the value High[0] to verify that it does work.
Richard Von
10-01-2007, 11:11 AM
This indicator is drawn in the MACD panel, not the price one. The y values are well within the displayed range and are shown by the Output Window to be right on the right spots. (I also tried this with a fixed y value of .05 which also doesn't work.)
Still no diamonds.
NinjaTrader_Ray
10-01-2007, 12:04 PM
How about setting
DrawOnPricePanel = false;
in Initialize()?
Richard Von
10-01-2007, 12:52 PM
Good suggestion, but already there.
What is so mystifying to me is that this code worded fine for quite a while, then suddenly the diamonds disappeared.
I'm at my wits end.
NinjaTrader_Dierk
10-01-2007, 12:55 PM
Since it
a) works for me
b) did work for you
I strongly recommend you proceed by the debugging thread I linked below.
Richard Von
10-01-2007, 01:34 PM
I have used the method suggested of printing each step of the process. The triggers are calculated and printed correctly as are the tag numbers and level. Also, following the DrawDiamond command, the sounds are correctly played.
I have tried deleting the DrawDiamond lines of code and re-entering them with no luck.
What engine is compiling/executing this code? Something is not working for this DrawDiamond command.
NinjaTrader_Dierk
10-01-2007, 01:46 PM
Sorry, I'm out of ideas. You need to roll up your sleeves and start with simple as possible and add logic step by step to see where it breaks.
Richard Von
10-01-2007, 03:35 PM
I appreciate your help.
I simply have no idea what else to do. I completely deleted the indicator and re-created it from scratch to remove any hidden glitches. It continues to do every step correctly and log these in the output window. The only thing it will not do is draw the diamonds.
I've closed all of my charts and created a new chart just to test this and still no luck.
Given that the code executes for you, is there someone in your development group that might know why good code would not be executed?
Is there some underlying c# engine that might be corrupted and could be reloaded?
I just don't know what to do.
NinjaTrader_Ray
10-01-2007, 03:45 PM
Somwhere in the process your logic is breaking. You just need to go step by step until you uncover the logic change that breaks your indicator.
The attached indicator works as expected. Please open a chart and apply this indicator to a default MACD indicator inthe same panel. I assume you will see diamonds.
Assuming you do, that means the core functionality is working. Then you can take this indicator and layer on your code step by step until it finally breaks.
NinjaTrader_Josh
10-01-2007, 04:58 PM
Hi Richard Von,
Have you tried reinstalling the .NET framework yet? Your code works fine for Dierk, Ray, and me. It worked fine for you before too. This suggests to me there is something wrong with either your .NET install or your NinjaTrader install. Try uninstalling .NET, uninstalling NinjaTrader, reinstalling .NET, reinstalling NinjaTrader.
You can get the .NET framework here: http://www.microsoft.com/downloads/details.aspx?familyid=0856eacb-4362-4b0d-8edd-aab15c5e04f5&displaylang=en
Richard Von
10-02-2007, 08:12 AM
Thank you both for your thoughtful help. I've got a real mystery for you.
First, I uninstalled Microsoft.NET 1.0 and 2.0 and NinjaTrader. Then re-booted. Deleted all brower history. Then downloaded and installed Microsoft.NET 2.0 and NinjaTrader.
Then installed the new DiamondTest indicator. Closed all charts, created a new chart, added new MACD and DiamondTest indicator. NO DIAMONDS?!?!? Changed the DiamondTest indicator to DrawSquare and squares appeared! Wow.
Went back to my indicator and changed diamonds to squares and they appear at the correct spots!!!
Then reloaded my stored templates with a variety of indicators and all work.
WHAT IS REALLY WIERD IS THAT ANOTHER INDICATOR USES DIAMONDS IN A DIFFERENT PANEL AND THEY APPEAR. I am afraid to change or recompile that one, but this is the real mystery.
I can limp by with the squares, but they are not as desirable and am concerned what else might go wrong if I depend on this software for my trading. I'd be happy to discuss this with anyone - email me a number to call if you like.
I know someone must be intrigued by this puzzle.
Richard
NinjaTrader_Dierk
10-02-2007, 08:14 AM
Sorry, I would not know what could cause that nor do we have any other reports related.
Richard Von
10-03-2007, 10:46 AM
It seems to me that the problem must be in the compiler.
1) Another indicator compiled in the past and not changed does draw diamonds. I'm afraid to open it and re-compile because I think I would lose the diamonds.
2) The indicator that was working and now doesn't was one I modified and re-compiled.
3) The indicator you sent me had to be compiled here and did not work with diamonds but did with squares.
The question is where does the compiler reside and who would I go to find a way to correct or reinstall it?
Thanks,
Richard
NinjaTrader_Dierk
10-03-2007, 11:13 AM
This is the standard C# compiler. There is nothing we could do about it. As explained below I would not know what causes that. Sorry
Richard Von
10-03-2007, 11:42 AM
Is the compiler loaded as part of NinjaTrader or is it resident separately on my computer from Microsoft?
NinjaTrader_Dierk
10-03-2007, 11:47 AM
It comes with the .NET runtime from MS.
Richard Von
10-03-2007, 12:04 PM
Thank you for your patient replies. I'll do my best to track that down and will post any success I find.
Richard