![]() |
|
|||||||
| Indicator Development Support for the development of custom indicators using NinjaScript. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Junior Member
Join Date: Oct 2008
Posts: 25
Thanks: 0
Thanked 1 time in 1 post
|
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
Last edited by Brutus; 11-06-2008 at 11:39 AM.
|
|
|
|
|
|
#2 |
|
NinjaTrader Product Manager
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 106 times in 70 posts
|
Brutus,
Any errors in your Control Center? Is your connection to the data feed still working?
Josh
NinjaTrader Customer Service |
|
|
|
|
|
#3 | |
|
Junior Member
Join Date: Oct 2008
Posts: 25
Thanks: 0
Thanked 1 time in 1 post
|
Quote:
I am using it on the ES - zenfire feed.
Last edited by Brutus; 11-06-2008 at 11:41 AM.
|
|
|
|
|
|
|
#4 |
|
NinjaTrader Product Manager
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 106 times in 70 posts
|
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;
}
Josh
NinjaTrader Customer Service |
|
|
|
|
|
#5 |
|
Junior Member
Join Date: Oct 2008
Posts: 25
Thanks: 0
Thanked 1 time in 1 post
|
Thanks Josh, comparing that to another working script, I think thats it.
|
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
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 |