KX Community

Find answers, ask questions, and connect with our KX Community around the world.
KX Community Guidelines

Home Forums kdb+ Convergence using binary? Re: Convergence using binary?

  • jfealy

    Member
    August 12, 2022 at 12:00 am

    Is this the behavior you’re looking for?

     

    q)t:([] a:100?10;b:100?1.) 
    
    q)f:{[x;it]c1:(-1_(>':) (it+1)>x`a),0b; c2: 0.5>abs log ratios next x`b; cond: $[1=it; c1; c1&c2]; delete from x where cond|prev cond}
    q)count {f[;y]/[x]}/[t;1 2] 56