In Hong Kong, the Futures market runs at 9:15-12:00, 13:00-16:30 and 17:15-01:00 next day. I need to filter out the noisy data in those inactive gaps (such as time between 12:00-13:00 and so on) so as not to affect the Indicators. Only the Day & Night sessions in Intraday/Database settings are not sufficient. Is there a way to add more Filtering sessions, either by configuration or AFL? Thanks.
I'm not going to spoon feed how to get to sample output of 2nd chart pane. Try yourself first and post here (no matter if getting stuck or not).
(I am going to show my version if you show some own efforts first.)
Upper picture shows 24h trading.
But in your case you may do like so as seen below (plus including Sparse AFL functions). So in second case you would have to exclude only time window from 16:30:00 to 17:14:59 via Sparse AFL functions.
If an inbuilt indicator function (such as ATR, SAR, MACD, ...) does not have function arguments for inserting source array then simply override inbuilt OHLC, V, OI, AUX1, AUX2 arrays via Sparse.. before. SAR() depends on H and L. So you would only need to override those two arrays.
H = SparseCompress( condition, H );
And at the end after sparse array has been finished use RestorePriceArrays() function for restoring inbuilt arrays to original state.
With 24h enabled (so all sessions being defined via Sparse.. in 2nd pane)
Or just Day and Night session set in Database settings plus 16:30 to 17:15 excluded via Sparse.
Same results in 2nd pane compared to 1st picture.