NinjaTrader Support Forum  

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 10-09-2007, 04:09 AM   #1
ATI user
Senior Member
 
Join Date: Apr 2006
Location: , ,
Posts: 1,316
Thanks: 1
Thanked 7 times in 7 posts
Default NT hangs on GetCurrentBid/Ask?

I have an indicator that hangs during pre-market.

I am wondering if this is because NT is sitting and waiting to pick up the current bid/ask.

When I run the same indicator on MarketReplay feed, it runs fine. Also runs fine during market hours. However, in really low volume, it hangs.

Ideas?
ATI user is offline  
Reply With Quote
Old 10-09-2007, 04:34 AM   #2
NinjaTrader_Dierk
Administrator
 
NinjaTrader_Dierk's Avatar
 
Join Date: Mar 2005
Location: Bamberg, Germany
Posts: 9,994
Thanks: 0
Thanked 6 times in 6 posts
Default

StrategyBase/IndicatorBase.GetCurrentBid/Ask does not lock up NT.
NinjaTrader_Dierk is offline  
Reply With Quote
Old 10-09-2007, 04:37 AM   #3
ATI user
Senior Member
 
Join Date: Apr 2006
Location: , ,
Posts: 1,316
Thanks: 1
Thanked 7 times in 7 posts
Default

More correctly stated I suppose, NT seems to hang between ticks.

I can see the tick come in on the TimeSales but the chart does not update nor does it print to the Output window. It just sits there and then will print 5 ticks to the Output window....then will hang again....which is why I am wondering if it has something to do with GetCurrentBid/Ask.

Everything hangs, including editor, all charts (can not switch between charts), etc.

My computer however does not hang as I can use a browser for example as usual.
ATI user is offline  
Reply With Quote
Old 10-09-2007, 04:51 AM   #4
NinjaTrader_Dierk
Administrator
 
NinjaTrader_Dierk's Avatar
 
Join Date: Mar 2005
Location: Bamberg, Germany
Posts: 9,994
Thanks: 0
Thanked 6 times in 6 posts
Default

I suggest removing the indicator from the charts and retrying. If issue is gone, then it's the faulty indicator in which case I suggest contacting the author.
NinjaTrader_Dierk is offline  
Reply With Quote
Old 10-09-2007, 05:15 AM   #5
ATI user
Senior Member
 
Join Date: Apr 2006
Location: , ,
Posts: 1,316
Thanks: 1
Thanked 7 times in 7 posts
Default

lol...very funny Dierk...I am the author.

I am trying to debug it and I am not having much progress.

I commented out GetCurrentBid/Ask...same hang up.....so that is not problem.

So, I closed the chart running the indicator and no hang up w NT...confirming yet again that it is the indicator causing the problem.

I then connect to MarketReplay and open a new chart and add the indicator. It runs fine a normal speed and 50x speed. I do everything that would hang up the same indicator on low vol/pre-market data, however I can not get it to hang up.

So, I switch back to live feed, and it hangs. Then, thinking it might be due to checking FirstTickOfBar when there are very few bars and ticks, I switched the interval from 1 min to 10 min. I then did everything I could to get it to hang up during a 10 min bar and it would not.

So, it has something to do with new bars and few ticks and the FirstTickOfBar condition.
ATI user is offline  
Reply With Quote
Old 10-09-2007, 05:19 AM   #6
NinjaTrader_Dierk
Administrator
 
NinjaTrader_Dierk's Avatar
 
Join Date: Mar 2005
Location: Bamberg, Germany
Posts: 9,994
Thanks: 0
Thanked 6 times in 6 posts
Default

>> I commented out GetCurrentBid/Ask...same hang up.....so that is not problem.
Great. This confirms it's not GetCurrentBid/Ask.

I suggest starting with a simple as possible indicator, see if it's working then adding functionality step by step to see where it breaks. Please read more here on how to debug NS code: http://www.ninjatrader-support.com/v...ead.php?t=3418
NinjaTrader_Dierk 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
NT 6 hangs on restart after IB auto shutdown Drew Installation and Licensing 15 06-25-2008 12:19 AM
Editor Find/Replace Hangs NinjaTrader KBJ General Programming 1 10-02-2007 12:53 PM
Reload Data bug- hangs NT zoltran Miscellaneous Support 2 08-13-2007 01:54 PM
Custom Indicator hangs NT on New Strategy Create zoltran Miscellaneous Support 4 06-20-2007 04:30 PM


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