KX Community

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

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

  • error: "test.testTab" (FP.Functions.test/classifyTrades.quke:3)

    Posted by bl on September 10, 2023 at 12:00 am

    Hi,

    Is the classifyTrades.quke correct?

    I get the error: abort in before block due to error “test.testTab” (FP.Functions.test/classifyTrades.quke:3).

    My classifyTrades function is ok when I run it against tradeContext table.

    When I replaced test.expTab and test.testTab to expTab testTab inside classifyTrades.quke, then the test is passed.

    bl replied 2 months ago 2 Members · 4 Replies
  • 4 Replies
  • megan_mcp

    Administrator
    September 11, 2023 at 12:00 am

    Hi  !

    To help me better assist you, can you send me your code for classifyTrades?

    You can do this using the spoiler tag or you can dm me!

    Thanks,

    Megan

  • 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
        }
    
    
    
  • megan_mcp

    Administrator
    September 20, 2023 at 12:00 am

    Hi ,

    Sorry for the delay in response, it’s because you didn’t define your function as ‘classifyTrades’.

    I defined the function and the tests passed.

    Thanks,

    Megan

  • bl

    Member
    October 16, 2023 at 12:00 am

    I logged in again to test the suggested solution. Now I cannot reproduce the error, no matter if I define the function name or not

Log in to reply.