Announcement
Collapse
Looking for a User App or Add-On built by the NinjaTrader community?
Visit NinjaTrader EcoSystem and our free User App Share!
Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less
Partner 728x90
Collapse
NinjaTrader
Conditionally include OnMarketDepth / OnMarketData in an indicator.
Collapse
X
-
Conditionally include OnMarketDepth / OnMarketData in an indicator.
I have an indicator that includes the OnMarketDepth / OnMarketData override methods. Depending on the user configuration of the custom indicator properties those might not be needed. So the use of those methods is conditional. Ideally they would not process when they are not needed. Any suggestions on how to accomplish this? My thought was to create a separate indicator that contains those methods and only reference it in the primary indicator when needed.
Tags: None
-
Hello martyn73,
Thanks for your post.
Adding the OnMarketDepth and OnMarketData overrides will add these events to the NinjaScript and it is advised to not add these methods if they are not used.
You could use AddOn code to add MarketData and MarketDepth events to your script conditionally. I have attached an example in this post.
MarketData Events - https://ninjatrader.com/support/help...marketdata.htm
MarketDepth Events - https://ninjatrader.com/support/help...arketdepth.htm
Please let us know if we can be of further assistance.JimNinjaTrader Customer Service
-
This solution works well for MarketData but the MarketDepth solution does not fire as often as the OnMarketDepth() method does. I need to retrieve that data as fast as OnMarketDepth but only conditionally. My current solution is to put OnMarketDepth in a separate indicator and import it into my primary indicator only when needed. But this creates an indicator on the indicator list that should not be used which is confusing to users. And NT does not allow you to hide indicators from the list. Is there a way to accomplish my requirements with a modification of the solution you provided?
Comment
-
Hello martyn73,
Thanks for clarifying.
I do not have a way I can suggest to modify the refresh interval for the MarketDepth.Update event. If you have found a solution writing to the AddOn namespace from another indicator, you could move forward with that approach, otherwise I would suggest implementing anything that requires MarketDepth in a separate indicator.
I have submitted a feature request on your behalf to be able to customize the rate at which Market.Depth.Update refreshes. The ticket ID is SFT-3862. As with other feature requests, we cannot offer an ETA or promise of fulfillment, but interest for this idea is being tracked.
If there is anything else I can do to help, please let me know.JimNinjaTrader Customer Service
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by SnailHorn, 03-27-2024, 09:54 AM
|
4 responses
17 views
0 likes
|
Last Post
by SnailHorn
Today, 09:19 AM
|
||
Started by ninza33, Today, 07:16 AM
|
3 responses
18 views
0 likes
|
Last Post
by ninza33
Today, 09:01 AM
|
||
Started by foxtrott21, Today, 08:27 AM
|
0 responses
4 views
0 likes
|
Last Post
by foxtrott21
Today, 08:27 AM
|
||
Started by jaypelle3, Today, 08:26 AM
|
0 responses
3 views
0 likes
|
Last Post
by jaypelle3
Today, 08:26 AM
|
||
Started by linkcou, Today, 07:01 AM
|
2 responses
26 views
0 likes
|
Last Post
by bltdavid
Today, 08:25 AM
|
Comment