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 11-06-2008, 11:19 AM   #1
Brutus
Junior Member
 
Join Date: Oct 2008
Posts: 25
Thanks: 0
Thanked 1 time in 1 post
Default Largest ask and bid size text

Hi

I used your sample market depth book example and modified it to show the largest ask and bid size, above and below the current price bar.

Problem is half way through the trading day the text freezes on that point of the chart and fails to update. I have to reload the script.

I have tried checking each askRows[*].volume is not null etc, it still freezes.

Any ideas why?

http://img89.imageshack.us/img89/8272/bidasktextgk1.png
Attached Files
File Type: zip BidAskText.zip (2.4 KB, 28 views)
Last edited by Brutus; 11-06-2008 at 11:39 AM.
Brutus is offline  
Reply With Quote
Old 11-06-2008, 11:26 AM   #2
NinjaTrader_Josh
NinjaTrader Product Manager
 
NinjaTrader_Josh's Avatar
 
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 106 times in 70 posts
Default

Brutus,

Any errors in your Control Center? Is your connection to the data feed still working?
NinjaTrader_Josh is offline  
Reply With Quote
Old 11-06-2008, 11:35 AM   #3
Brutus
Junior Member
 
Join Date: Oct 2008
Posts: 25
Thanks: 0
Thanked 1 time in 1 post
Default

Quote:
Originally Posted by NinjaTrader_Josh View Post
Brutus,

Any errors in your Control Center? Is your connection to the data feed still working?
No, everything seems fine, I have other real time scripts and when I reload the indicators for a bid ask text freeze I lose all the history. The other scripts keep working fine and updating.

I am using it on the ES - zenfire feed.
Last edited by Brutus; 11-06-2008 at 11:41 AM.
Brutus is offline  
Reply With Quote
Old 11-06-2008, 11:44 AM   #4
NinjaTrader_Josh
NinjaTrader Product Manager
 
NinjaTrader_Josh's Avatar
 
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 106 times in 70 posts
Default

Try adding checks to ensure that you have enough rows in the bid and ask.

Code:
if (askRows.Count > 4)
{
    if (askRows[4].Volume > askbig) askbig = askRows[4].Volume;
    if (askRows[3].Volume > askbig) askbig = askRows[3].Volume;
    if (askRows[2].Volume > askbig) askbig = askRows[2].Volume;
    if (askRows[1].Volume > askbig) askbig = askRows[1].Volume;
    if (askRows[0].Volume > askbig) askbig = askRows[0].Volume;
}
            
if (bidRows.Count > 4)
{
    if (bidRows[4].Volume > bidbig) bidbig = bidRows[4].Volume;
    if (bidRows[3].Volume > bidbig) bidbig = bidRows[3].Volume;
    if (bidRows[2].Volume > bidbig) bidbig = bidRows[2].Volume;
    if (bidRows[1].Volume > bidbig) bidbig = bidRows[1].Volume;
    if (bidRows[0].Volume > bidbig) bidbig = bidRows[0].Volume;
}
NinjaTrader_Josh is offline  
Reply With Quote
Old 11-06-2008, 12:43 PM   #5
Brutus
Junior Member
 
Join Date: Oct 2008
Posts: 25
Thanks: 0
Thanked 1 time in 1 post
Default

Thanks Josh, comparing that to another working script, I think thats it.
Brutus 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
Set Entry Size Based on Current Account Size Anagoge Strategy Analyzer 4 09-30-2010 04:57 AM
Recalculating position size based on account size, % risked and stop loss clivehunt Strategy Development 18 03-22-2009 11:25 AM
Retrieving Last Bid and Ask size Brutus General Programming 8 10-17-2008 01:17 PM
ATI to get Bid, Ask and LAst Size PHOLAN Automated Trading 1 07-11-2008 08:27 AM
NinjaScript SS Orders and bid/ask size Json Automated Trading 1 12-17-2006 03:13 PM


All times are GMT -6. The time now is 06:52 PM.