Re: Does this indicator repaint?

281
mrtools wrote: Fri Jan 04, 2019 6:07 am

If you have causal = false it will be a recalculating/repainting indicator.
Again from Mladen::

It is a digital filter based on sync() function. In short sync is defined as sync(n) = sin(n*Pi)/(n*Pi) and is, as it is obvious, using a syne wave like shaped coefficients for filtering - smoothing.

But, there is a but : sync can not be used "as is" for that purpose or one will get surprised with the result "jumping around" for different calculating lengths (I know at least one person that did not know that and was even bragging with a "fastest moving average there is" based on sync() and I suppose that by the time he discovered that "jumping effect" al he was left to do is to disappear from internet scene). For purpose of avoiding that, windowing is used. In this indicator I "overdid" a bit and made almost every window variation that is found in wikipedia (here is a link with rather good description of different types of window functions : Window function - Wikipedia, the free encyclopedia ).

After this description, now about some of the parameters. The 3 most important parameters are the frequency cutoff, the filter (window) type and the "causal" parameter.
Filter type can be :

0 - Hamming
1 - Hanning

2 - Blackman

3 - Blackman Harris

4 - Blackman Nutall

5 - Nutall

6 - Bartlet zero end points

7 - Bartlet Hann

8 - Hann

9 - Sine

10 - Lanczos

11 - "flat top"

Frequency cutoff can vary between 0 and 0.5. General rule is that the greater the cutoff is the "faster" the filter is, and the smaller the cutoff is the smoother the filter is.

And the most "problematic" parameter : the causal. In original filters (in digital signal processing) they are mostly using a non-causal (centered) mode since that way they can get a much clearer signal and a delay in a couple of hertzs is not noticeable at all. But in TA it can cause problems. So I decided to have an option to have a causal (non-recalculating, non-centered mode) and a non-causal (recalculating centered mode). One may ask why did I leave the non-causal mode. Well, for estimations, and for some other possible applications, And I like the extrapolation method used in it (it makes the possible error less and less depending on distance from current bar). Recalculation takes is (period-1)/bars (for example for a 15 period filter 7 bars can recalculate : 7th very little, 6th a bit more and so on ... I think that explains the how extrapolation is done) . Here is a comparison of the 2 modes (15 period, 0.01 Bartlet-Hann window types) :



Second indicator attached was a tool I made to check myself if I am doing the windowing OK. Decided to post it here too since it can help greatly in understanding how the filtering is done for some window type and that way it can help. Here is how a Bartlet-Hann window looks like for cutoff 0.1 (left) and 0.01 (right along with filters with same window type and cutoffs

Thanks soo much Mrtools, soo if I understand well if turn causal to = True the indi dont repaint.


Re: Does this indicator repaint?

285
Cladi39 wrote: Sat Jan 05, 2019 6:27 am

Thanks for your help, Can i ask you last question? In what conssist the repaint? the dots can desapear in current candle? in the history? My interest is when candle close.
Please spend your valuable time to see exactly what is happening that's best to way learn. Load the indicator in M1 charts and wait for sometime.


Re: Does this indicator repaint?

289
Mrforex wrote: Tue Jan 15, 2019 8:40 am Good day all my Boss here, please i want to know if this indicator repaints, if it does can i get a non-repainting version of the indicator or can it be made not to repaint.
Hi, the indicators based on Tma, triangular moving average, recalculate continuously, an indicator that does not recalculate will have different results from the Tma..this is my thought, the other experts can explain in more detail.

Re: Does this indicator repaint?

290
mrtools wrote: Fri Jan 04, 2019 6:07 am And the most "problematic" parameter : the causal. In original filters (in digital signal processing) they are mostly using a non-causal (centered) mode since that way they can get a much clearer signal and a delay in a couple of hertzs is not noticeable at all. But in TA it can cause problems.
Addition

Non-causal filters are used in digital signal processing for system identification only, that means offline (non-causal means it can look into the future). The final observer with the mathematical estimated model works online, causal. Since you have natural laws behind it and most systems are slow (even a combustion engine is slow), the delay is small and absolutely ok. In financial markets you have no real natural laws behind it. An OB/OS market can still run for 10 or 30 more bars in the same direction in a strong trend. Also sudden and strong amplitudes in price are possible here. Imagine a sudden jump in acceleration of your car. Either the engine jumps out of the engine bay (but the power couldn't be brought on the street - slippage) or you hit or were hit by something, from behind or in front of you. "Support and resistance" has another meaning here and when you love your car, you'd better avoid "supports" or "resistances" :problem: Boxing is a good example either :D


Who is online

Users browsing this forum: DotNetDotCom [Bot], Majestic-12 [Bot], rajivdave222, Ruby [Bot], Spank, thomdel, Woodyz, Yandex [Bot] and 91 guests