![]() |
|
|||||||
| Indicator Development Support for the development of custom indicators using NinjaScript. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Member
Join Date: Aug 2008
Posts: 59
Thanks: 0
Thanked 0 times in 0 posts
|
[IMG]file:///C:/DOCUME%7E1/Benutzer/LOCALS%7E1/Temp/moz-screenshot.jpg[/IMG]I have a problem with the Bid/Ask prices in the premarket phase.
I try to scan for gappers during the premarket phase. if you look at the attachment you can see, that in the marketAnalyzer is a valid Bid/AskPrice. If I want to get access of the bid/askPrice in an Indicator the GetCurrentBid() and GetCurrentAsk() are delivering another value like the MarketAnalyzer. Then I found out, that there exists a MarketData-member, where the prices are correct. But when the the indicator is used in the MarketAnalyzer the MarketData-member is null ... and the GetCurrentBid() and GetCurrentAsk() are delivering again the wrong values does anybody know how I could get access to the right Bid/Ask values in the MarketAnalyzer during the premarket phase? Many thanks for you help in advance.
|
|
|
|
|
|
#2 |
|
NinjaTrader Product Manager
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 106 times in 70 posts
|
Please provide the line of code you are using for your print statement and in which method it was placed in. Thank you.
Josh
NinjaTrader Customer Service |
|
|
|
|
|
#3 |
|
Member
Join Date: Aug 2008
Posts: 59
Thanks: 0
Thanked 0 times in 0 posts
|
Hi Josh
Thank you for your quick reply ... here is the code line. This problem only occures in the premarket phase - if you try it during market hours the values are correct if ( MarketData != null ) Print ( Instrument.MasterInstrument.Name + "; GetCurrentAsk(): " + GetCurrentAsk() + "; GetCurrentBid(): " + GetCurrentBid() + "; MarketData.Bid.Price: " + MarketData.Bid.Price + "; MarketData.Ask.Price: " + MarketData.Ask.Price + "; " + Time[0].Year + "." + Time[0].Month + "." + Time[0].Day ); |
|
|
|
|
|
#4 |
|
Member
Join Date: Aug 2008
Posts: 59
Thanks: 0
Thanked 0 times in 0 posts
|
oops .. this call happens in the OnBarUpdate()-event
|
|
|
|
|
|
#5 |
|
NinjaTrader Product Manager
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 106 times in 70 posts
|
Can you please try this inside OnMarketData and use the MarketDataEventArgs?
Josh
NinjaTrader Customer Service |
|
|
|
|
|
#6 |
|
Member
Join Date: Aug 2008
Posts: 59
Thanks: 0
Thanked 0 times in 0 posts
|
OK - thank you for this hint - since the market is running now I will try it tomorow
|
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| GetCurrentBid/Ask on Multiple Instruments | SystemTrading | General Programming | 2 | 11-06-2008 08:57 AM |
| GetCurrentAsk Question through NT | beauw | Automated Trading | 17 | 10-06-2008 08:10 AM |
| GetCurrentAsk Multi time | nigeleyre | Strategy Development | 4 | 10-02-2008 12:39 PM |
| GetCurrentBid/Ask | SystemTrading | Miscellaneous Support | 1 | 08-20-2008 01:19 PM |
| NT hangs on GetCurrentBid/Ask? | ATI user | Indicator Development | 5 | 10-09-2007 05:19 AM |