PriceJump not detecting reverse split

Posted By: DdlV

PriceJump not detecting reverse split - 09/29/21 19:35

I have YANG EOD data for ~5 years. In 2018-03 it split 10:1. PriceJump changes from 0 to 1 at that point detecting an outlier, but never -10 - it doesn't detect the reverse split.

I have tried various settings for Outlier, but none detect the split. Is there something else that needs to be set?
Posted By: DdlV

Re: PriceJump not detecting reverse split - 09/29/21 20:08

Interesting... I tried more Outlier values, and 1.1 does detect the reverse split!

Why 1.1? Well, the manual says Outlier defaults to "1.1+2*sqrt(BarPeriod/1440)". Since EOD, I'm using BarPeriod 1440. This gives Outlier the default value of 3.1, which seemed too high. So I just nuked the sqrt term and went with 1.1, and viola!

So, what value should be used for Outlier to detect splits (regular & reverse)? Is the current default value calculation incorrect? AKA, a bug?! laugh

Thanks.
Posted By: jcl

Re: PriceJump not detecting reverse split - 09/30/21 13:55

Don't trifle with the dirty b-word wink. According to the manual, Outlier must be set to less than 2 for detecting splits.
Posted By: DdlV

Re: PriceJump not detecting reverse split - 09/30/21 14:48

Thanks @jcl. Actually, I don't consider the b-word dirty - finding (& fixing) bugs is a good thing...

And... the b-word can also apply to the manual. The PriceJump & Outlier page could use some fixes. Examples:

- The PriceJump section should explicitly say splits are ONLY detected by default for certain BarPeriods.
- The PriceJump section should say to detect splits Outlier must be explicitly set 0<Outlier<2.
- The PriceJump section should give guidance as to how the user would select a specific value in 0<Outlier<2.
- The Outlier section should say why the default of "1.1+2*sqrt(BarPeriod/1440)" was chosen, including why it should be dependent on BarPeriod.

In any case, given I now understand better how this is supposed to work, I would still appreciate clarification of the 3rd item above:

How do I determine what value between >0 and <2 to use for Outlier to best detect splits in EOD data?!

Or are splits ALWAYS detected if 0<Outlier<2, and setting Outlier to 1.999999 will suppress all other outlier detection & data changes?

Thanks.
Posted By: DdlV

Re: PriceJump not detecting reverse split - 09/30/21 22:52

@jcl,

Also, is there an upper limit on split detection? I have an asset with 1:40 reverse split that is not being detected as a split - only an outlier...

Thanks.

EDIT: It has happened with other assets, but only with reverse splits...
Posted By: DdlV

Re: PriceJump not detecting reverse split - 10/25/21 23:15

@jcl,

Would appreciate your thoughts on the above questions re.

- Picking a value 0> <2 for Outlier, specifically for Split detection
- Making reverse Split detection more robust

Also, I've run into an "anomaly":

When I loop over a number of Assets, PriceJump is applied to the 1st Asset in the loop as well as the Asset which actually had a price jump. I've tried reversing the Assets order, and again it's the (different) 1st Asset that gets incorrectly flagged. This "anomaly" happens with both regular & reverse splits. And if an Asset has multiple splits (on different bars), it happens each time.

Can you confirm this?

Thanks.
Posted By: DdlV

Re: PriceJump not detecting reverse split - 11/01/21 21:15

@jcl, would appreciate your thoughts.

Thanks.
Posted By: jcl

Re: PriceJump not detecting reverse split - 11/02/21 10:34

PriceJump has nothing to do with loops or asset selection. It is set by a price function call.

PriceJump = 0; // in case it was set before
priceClose();
if(PriceJump) ...

Hope this helps...
Posted By: DdlV

Re: PriceJump not detecting reverse split - 11/02/21 18:42

Thanks @jcl. OK, I will investigate further and try to create a smaller script that displays the problem (or reveals my error laugh ).

In the meantime, do you have thoughts about:

- Picking a value 0>Outlier<2, for particular purposes - Split detection, etc.

- Making reverse Split detection more robust

Thanks.
© 2024 lite-C Forums