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 WHICKED, 03-27-2024, 12:33 PM
|
4 responses
41 views
0 likes
|
Last Post Today, 12:28 AM | ||
Started by f.saeidi, Today, 12:12 AM
|
0 responses
3 views
0 likes
|
Last Post
by f.saeidi
Today, 12:12 AM
|
||
Started by Conall, Today, 12:06 AM
|
0 responses
5 views
0 likes
|
Last Post
by Conall
Today, 12:06 AM
|
||
Started by proptradingshop, 03-21-2024, 09:50 AM
|
6 responses
27 views
0 likes
|
Last Post Today, 12:02 AM | ||
Started by mly916, Yesterday, 09:48 PM
|
1 response
12 views
0 likes
|
Last Post Yesterday, 11:54 PM |
Comment