Iím currently testing my indicator which uses the OnMarketData function. Unfortunately I observed 2 following issues:
1. Results are different between using this function live or with market replay. Is data in market replay reliable?
2. Results are different if I use the OnMarketData function in more than one indicator at the same time for the same instrument but in the different timeframe.
Do you know some limitation on the OnMarketData? Do all Indicators for one instrument which use the OnMarketData function share this function and if one Indicator uses this function with time intensive operations other indicator get less data (tick and volume)?
1. Data in Market Replay is limited to 1 second resolution so the bid/ask changes and trades can be different in Live data, only the sequence of trades will be guaranteed. Depends what your code needs, shouldn't have to be a big problem.
2. Is more likely to be a coding dependency, all indicators will get the same OMD calls. It rarely affects cpu or timing unless you need to do crazy code processing on each bid/ask/trade. Use debug Prints or put simple stat counters on OBU's and OMD's and use Ninja's own indicator plotting to see them, you'll be surprised at how little data is really coming in compared to the Ghz processor cycles that we have to waste.
The following user says Thank You to ratfink for this post: