ZScore ZProbability calculation incorrect logic

SQ.Columns.Databanks.ZScore lines 74-84



    if (i==0) Seria[i]=1;
   
    if(i > 0) {
    if (sign(pl)*sign(plPrev)<0) {
    Seria[i]=Seria[i-1]+1;
    } else {
    Seria[i]=Seria[i-1];
    }
    } else {
    Seria[i] = 0;
    }

When going through the order loop, for the very first order Seria[0]=1 and then straight after Seria[0]=0. Note, the yellow block is not getting run until 2nd order, so it doesn't make sense to have 1 and 0 straight after without much use.. What should the correct assignment be? I hope its not impacting accuracy of ZScore.

Also, the ZScore is not handling non-filling trades, e.g. limit/stop/cancelled/deposits/withdrawals etc. properly. It is treating them as Profitable trades, whereas they are not. Can you look into this properly?


Also, ZProbability should be be around 99.67% for ZScore=3 or ZScore=-3 and approaches 0% as ZScore gets closer to 0. The values do not seem to reflect like that. Though I have not tested ZProbability thoroughly, so not 100% sure.



Attachments
No attachments
  • Votes +1
  • Project StrategyQuant X
  • Type Bug
  • Status Fixed
  • Priority Normal

History

TB
#1

Tomas Brynda

10.12.2020 09:49

Status changed from New to Fixed

I improved the algorithm so it ignores unfilled orders and control orders in MT5 netting.

Votes: +1

Drop files to upload

or

choose files

Max size: 5MB

Not allowed: exe, msi, application, reg, php, js, htaccess, htpasswd, gitignore

...
Wait please