![]() |
|
|||||||
| Market Analyzer Support for the NinjaTrader Market Analyzer. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#16 |
|
NinjaTrader Customer Service
Join Date: Sep 2008
Location: Germany
Posts: 22,563
Thanks: 261
Thanked 1,015 times in 996 posts
|
Profitmake, your outcomes are expected as you work in the OnBarUpdate() that would trigger updates on each tick if CalculateOnBarClose is set to false.
For updates on each Level 1 data change, you would need to work in the OnMarketData() method as suggested. Historical bid / ask data series access is supported for IB in our NinjaTrader 7 release, which is currently in public beta.
Bertrand
NinjaTrader Customer Service |
|
|
|
|
|
#17 | |
|
Member
Join Date: Apr 2010
Posts: 89
Thanks: 0
Thanked 0 times in 0 posts
|
I'm up against a brick wall again. I tried to modified it from "OnBarUpdate()" into "OnMarketData()". It didn't work. Here's the modified code:
Code:
protected override void OnMarketData(MarketDataEventArgs e)
{
if (Historical)
return;
BidSize0.Set(GetCurrentBidVolume());
}
Sorry Bertrand, may I ask you to help me once more? I merely need some coding advice this time and for this particular issue only. I deadly want the ability to watch bid/ask/last size in Market Analyzer. Quote:
Code:
if (Historical)
return;
|
|
|
|
|
|
|
#18 |
|
NinjaTrader Customer Service
Join Date: Sep 2008
Location: Germany
Posts: 22,563
Thanks: 261
Thanked 1,015 times in 996 posts
|
For historical bid / ask data series access, please add the respective MarketDataType in the Initialize of the indicator in NT7 -
Code:
Add("ES 06-10", PeriodType.Minute, 1, MarketDataType.Ask);
http://www.ninjatrader.com/support/h...nt7/closes.htm For a correct way to work in OnMarketData(), please see the snippet we have in the helpguide for this method - http://www.ninjatrader.com/support/h...marketdata.htm
Bertrand
NinjaTrader Customer Service |
|
|
|
|
|
#19 | ||
|
Member
Join Date: Apr 2010
Posts: 89
Thanks: 0
Thanked 0 times in 0 posts
|
Code:
Add("ES 06-10", PeriodType.Minute, 1, MarketDataType.Ask);
Quote:
I even tried the example and it still failed: Quote:
"NinjaTrader.Indicator.BidSize' does not implement inherited abstract member 'NinjaTrader.Indicator.IndicatorBase.OnBarUpdate() '" I don't understand what this message means. It appears I'm forced to use OnBarUpdate(). Other codes just don't pass the compile test. I tried over 1 hour in vain. If it's just a few lines of codes to achieve this, I hope anyone could kindly give me a better pointer so I can watch up-to-date bid/ask/last size in Market Analyzer. Thank you in advance. I'm still trying in the meantime. |
||
|
|
|
|
|
#20 |
|
NinjaTrader Customer Service
Join Date: Sep 2008
Location: Germany
Posts: 22,563
Thanks: 261
Thanked 1,015 times in 996 posts
|
Profitmake, you could make the instrument input for this a string user input so you could enter a symbol to be used.
Were you trying to use the OnMarketData() snippet outside the OnBarUpdate() method? This would be needed, as it will not work inside the OnBarUpdate() as it's an own method in NinjaScript. Since you're not a programmer, it might be best to pass this work to a consultant to create the needed code for you - http://www.ninjatrader.com/webnew/pa...injaScript.htm
Bertrand
NinjaTrader Customer Service |
|
|
|
|
|
#21 |
|
Member
Join Date: Apr 2010
Posts: 89
Thanks: 0
Thanked 0 times in 0 posts
|
Well my purpose hasn't been changed from day 1. I just want to display bid size, ask size, last size. Unfortunately those information aren't readily available in the columns
. That's why I'm trying very hard now.I simply try to hack based on the file you gave it to me last time. Originally I should be all happy. Unfortunately your sample used OnBarUpdate() method, not OnMarketData() method. I pointed out the problems and you suggested OnMarketData() method. Unfotunately I'm up against a brick wall now since I'm unable to hack your sample to use OnMarketData() method instead. My first attempt I have replaced OnBarUpdate() with OnMarketData() so I don't understand what the error message says. I tried quite many different variations to see if I can guess the right line of the code. I have spent about 30 minutes on that in vain. Second attempt I simply copied the example to see how it works. But I couldn't pass the compile test. I'm searching for simple samples which use OnMarketData() method so I can grab one and try to mock it. So far I couldn't find one. I tried other variations too. All failed. I must have made some very dummy mistakes. I don't think it's worth wasting space to post screenshots here. |
|
|
|
|
|
#22 |
|
Member
Join Date: Apr 2010
Posts: 89
Thanks: 0
Thanked 0 times in 0 posts
|
Regarding consultant, it would be silly to ask a consultant for such a simple task that may only take a minute to code. The consultant may laugh out load at me for such a dumb task. I'd better ask people or members on the forum to help this time.
I hope you could help me on this issue if it only takes a few lines of codes to complete it. Otherwise let's just forget it as it's not a reasonable request. I'm still evaluating this software and see whether it fits my trading needs. I will definitely need a consultant to code my system later if I decide this is the right software which I should work on it. PS: I clicked on the button for info of CS0534 butthe help program failed to redirect me to the right page.
Last edited by Profitmake; 05-14-2010 at 01:03 PM.
|
|
|
|
|
|
#23 |
|
NinjaTrader Product Manager
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 107 times in 70 posts
|
Profitmake,
BidSize is likely a reserved word. You will need to name your indicator differently.
Josh
NinjaTrader Customer Service |
|
|
|
|
|
#24 |
|
Member
Join Date: Apr 2010
Posts: 89
Thanks: 0
Thanked 0 times in 0 posts
|
Hello Josh, I created another indicator called ShowBidVol. The same error message occurred when I used OnMarketData() in the code. I still keep trying in the meantime.
|
|
|
|
|
|
#25 |
|
NinjaTrader Customer Service
Join Date: Sep 2009
Location: Denver, CO
Posts: 8,117
Thanks: 249
Thanked 418 times in 415 posts
|
ProfitMake,
You will get error messages from all indicators when you compile, not just the one you're working with. The bulk of the code you have is the same from this page http://www.ninjatrader-support.com/H...arketData.html This code compiles successfully. You're trying to Set a DataSeries within OnMarketData and this won't work. Data Series are synced to bar objects so you will have to do this within OnBarUpdate() In the future when sharing code you're using, can you copy and paste the text rather than images?
Ryan M
NinjaTrader Customer Service |
|
|
|
|
|
#26 | ||
|
Member
Join Date: Apr 2010
Posts: 89
Thanks: 0
Thanked 0 times in 0 posts
|
Quote:
I know it's a bad way to spot the problem area. Anyway this part is not important. Quote:
Could you tell me what code exactly I should use to replace DataSeries? Or perhaps you have a sample OnMarketData() with / bis/ask so I can try to imitate it? Yes if you prefer it. But the code would be very long since it will always expand every potion of codes. |
||
|
|
|
|
|
#27 |
|
NinjaTrader Customer Service
Join Date: Sep 2008
Location: Germany
Posts: 22,563
Thanks: 261
Thanked 1,015 times in 996 posts
|
Profitmake, please attach the latest version of you're cs file directly so we can take a look at what you attempt doing. You can find the file in the Documents\NinjaTrader 6.5\bin\Custom\Indicator folder. If you just work very close alongside the sample from the helpguide you should be able to compile and see the prints for last, bid, ask from the OnMarketData() method accessing the Level 1 stream directly.
Bertrand
NinjaTrader Customer Service |
|
|
|
|
|
#28 |
|
Member
Join Date: Apr 2010
Posts: 89
Thanks: 0
Thanked 0 times in 0 posts
|
Here you are.
Nothing interesting have been done on the indicators. No change I made could pass the compile test so I simply revert to the last state. You may simply create a new sample to replace the mess. The indicators are simply based on the sample you gave me last time. My purpose is to plot bid/ask size and update properly in real-time. |
|
|
|
|
|
#29 |
|
NinjaTrader Customer Service
Join Date: Sep 2009
Location: Denver, CO
Posts: 8,117
Thanks: 249
Thanked 418 times in 415 posts
|
Hello Profitmake,
Was using a prior version of your code and it plotted successfully. The current one has the same issue where values are set within OnMarketData(). You may need to pursuse this with a 3rd party NinjaScript consultant who can develop your code to your exact specifications.
Ryan M
NinjaTrader Customer Service
Last edited by NinjaTrader_RyanM; 05-18-2010 at 09:16 AM.
|
|
|
|
|
|
#30 |
|
Junior Member
Join Date: Feb 2008
Posts: 5
Thanks: 0
Thanked 0 times in 0 posts
|
I was looking to do the same and wrote two simple bid size and ask size indicators for the purpose of calling them up within the Market Analyzer. I posted them to the Ninja Version 7 Indicator section of the forum. It is called "Bid and Ask Sizes".
|
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Only 1 level of Bid/Ask Size on SuperDom? | tjendra | SuperDOM and other Order Entry Windows | 9 | 11-05-2009 06:46 AM |
| Ask and Bid Depth Size... | Fritztx | SuperDOM and other Order Entry Windows | 1 | 05-17-2009 01:43 AM |
| Largest ask and bid size text | Brutus | Indicator Development | 4 | 11-06-2008 12:43 PM |
| 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 |