KX Community

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

Home Forums KX Academy error: "test.testTab" (FP.Functions.test/classifyTrades.quke:3) Re: error: "test.testTab" (FP.Functions.test/classifyTrades.quke:3)

  • bl

    Member
    September 12, 2023 at 12:00 am

    Hi Megan,

     

    {[tab]
        //Pseudocode:
        //Performing an update will keep the original table
        //When classifying, need to first check the side
        //If side is Buy, then a good trade was bought for less than what the market was asking for
        //If side is Sell, then a good trade sold for more than what the market was bidding for
        //The vector conditional might prove useful   
        s: exec side from select side from tab;
        b: exec bid from select bid from tab;
        a: exec ask from select ask from tab;
        p: exec price from select price from tab;
        exQuality: ?[s=`B;?[p<a;1b;0b];?[p>b;1b;0b]];
        new: update exQuality from tab
        }