{ "source": "https://github.com/ByteSumoLtd/TrendCalculus-lua/blob/7f54f9a101283cc188dbcd9282292fc3f73de8e9/make/trendcalculus.lua", "source_sha256": "c099fac68c945768c71f7c09804a21777295bbbf2e7dd61db59d9cdfd78f49c0", "source_license": "GPL-3.0-or-later; Copyright 2014-2015 ByteSumo Limited (Andrew J Morgan)", "fixture_license": "AGPL-3.0-or-later", "generated_at": "2026-10-05", "runtime": "Lua 5.2.4", "command": "lua trendcalculus.lua -n{window} -r -H -p1", "stdin": "ticker,date,last header followed by x,{zero_based_row},{value} rows, LF-terminated", "note": "Do not use -h: embedded CSV column mapping already consumes the header and -h drops the first data row.", "detection": "Run every complete-window prefix through the unmodified CLI. Newly emitted rows get detected_index = prefix_length - 1. Assert output-prefix preservation.", "event_fields": [ "index", "price", "direction", "detected_index" ], "cases": [ { "window": 2, "values": [ 0, 1, 2, 3, 4, 5, 4, 7, 9, 12, 9, 6, 4, 1, 0, -2, -1, -3, -3, -3, -6, -9, -8, -6, -8, -9, -8, -9, -7, -8, -9, -10, -7, -6, -6, -6, -7, -7, -5, -4, -6, -6, -9, -7, -7, -6, -4, -1, -1, -4, -3, -4, -6, -4, -6, -6, -9, -9, -7, -6, -4, -7, -5, -7, -5, -2, -1, -3, -3, 0, -3, -3, -1, -4, -2, 1, 1, -1, -4, -1, 0, 1, 1, -1, -2, -1, 1, 3, 6, 8, 8, 8, 10, 8, 8, 5, 5, 2, 1, 1, -2, -1, 1, -2, 1, -1 ], "events": [ [ 9, 12.0, -1, 11 ], [ 21, -9.0, 1, 23 ], [ 23, -6.0, -1, 25 ], [ 27, -9.0, 1, 29 ], [ 28, -7.0, -1, 31 ], [ 31, -10.0, 1, 33 ], [ 34, -6.0, -1, 37 ], [ 36, -7.0, 1, 39 ], [ 39, -4.0, -1, 41 ], [ 42, -9.0, 1, 45 ], [ 48, -1.0, -1, 49 ], [ 56, -9.0, 1, 59 ], [ 60, -4.0, -1, 63 ], [ 63, -7.0, 1, 65 ], [ 69, 0.0, -1, 71 ], [ 70, -3.0, 1, 73 ], [ 72, -1.0, -1, 73 ], [ 73, -4.0, 1, 75 ], [ 76, 1.0, -1, 79 ], [ 78, -4.0, 1, 81 ], [ 81, 1.0, -1, 83 ], [ 84, -2.0, 1, 87 ], [ 92, 10.0, -1, 95 ], [ 100, -2.0, 1, 103 ] ], "input_csv_sha256": "8b146558fa0f23f8926404bfeb87e433f02dd253c5a8eed2cf7bec21fa7d62ab", "output_csv_sha256": "46915ca3dcb7da1b3f9e72a8ece1a8beb032a4f99657798022236150d9c336af" }, { "window": 3, "values": [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 11, 14, 16, 19, 19, 17, 14, 15, 17, 19, 18, 16, 18, 19, 17, 16, 19, 19, 18, 15, 16, 16, 15, 14, 17, 16, 17, 14, 14, 17, 20, 18, 21, 20, 22, 21, 20, 18, 21, 20, 23, 22, 19, 19, 18, 19, 18, 18, 21, 24, 23, 21, 23, 26, 26, 28, 25, 28, 31, 30, 27, 24, 24, 26, 26, 28, 31, 33, 35, 33, 34, 32, 32, 31, 28, 29, 30, 33, 33, 31, 34, 33, 30, 29, 28, 29, 31, 33, 33, 33, 30, 29, 28, 28, 30, 33, 34, 35, 35, 34 ], "events": [ [ 12, 19.0, -1, 17 ], [ 15, 14.0, 1, 20 ], [ 22, 19.0, -1, 26 ], [ 32, 14.0, 1, 35 ], [ 33, 17.0, -1, 38 ], [ 36, 14.0, 1, 41 ], [ 43, 22.0, -1, 47 ], [ 46, 18.0, 1, 50 ], [ 49, 23.0, -1, 53 ], [ 55, 18.0, 1, 59 ], [ 67, 31.0, -1, 71 ], [ 70, 24.0, 1, 74 ], [ 77, 35.0, -1, 80 ], [ 83, 28.0, 1, 86 ], [ 89, 34.0, -1, 92 ], [ 93, 28.0, 1, 98 ], [ 96, 33.0, -1, 101 ], [ 101, 28.0, 1, 104 ] ], "input_csv_sha256": "38beb51c87acae40c3226599d6819cd6b9f984b39428ba84d1995257ce2bbc1c", "output_csv_sha256": "cb847cc137aee4433d9d6b70a1a1c74d02a70325c2ffe771130d6626449a40d4" }, { "window": 4, "values": [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 11, 14, 13, 16, 17, 19, 17, 18, 17, 16, 13, 12, 15, 16, 19, 21, 23, 25, 23, 25, 24, 24, 22, 21, 21, 19, 16, 17, 16, 13, 12, 15, 15, 13, 15, 12, 15, 17, 18, 21, 20, 18, 16, 16, 16, 16, 17, 19, 18, 16, 19, 18, 21, 23, 21, 24, 24, 26, 29, 31, 32, 29, 26, 26, 26, 29, 31, 32, 29, 29, 28, 25, 22, 25, 22, 20, 22, 25, 27, 24, 22, 25, 22, 24, 22, 19, 20, 21, 19, 19, 22, 24, 25, 24, 25, 26, 23, 23, 24, 26 ], "events": [ [ 17, 19.0, -1, 23 ], [ 23, 12.0, 1, 27 ], [ 29, 25.0, -1, 35 ], [ 47, 12.0, 1, 51 ], [ 51, 21.0, -1, 55 ], [ 61, 16.0, 1, 67 ], [ 72, 32.0, -1, 79 ], [ 74, 26.0, 1, 79 ], [ 79, 32.0, -1, 83 ], [ 87, 20.0, 1, 91 ], [ 90, 27.0, -1, 95 ], [ 97, 19.0, 1, 103 ], [ 107, 26.0, -1, 111 ] ], "input_csv_sha256": "303cbcb636decdd1a7c6b3841ea696fec0881a95023eeb7af71132a501b53e83", "output_csv_sha256": "df8be88430783a0669fb9224952fe7a26f4fcf18e3f242e425b7279e75f69850" }, { "window": 7, "values": [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 24, 27, 29, 26, 23, 25, 25, 24, 26, 23, 22, 19, 21, 21, 18, 21, 21, 18, 15, 14, 14, 11, 10, 7, 6, 5, 2, 1, 1, -2, -2, -2, -5, -4, -3, -3, -1, -4, -1, 0, 3, 3, 2, 4, 3, 1, -1, -1, 1, 2, 2, 3, 2, 4, 3, 1, 4, 3, 2, 0, -1, -3, -6, -3, -2, -5, -2, -1, 1, -2, -1, -1, -2, -2, -5, -5, -6, -4, -2, 0, -2, -1, -2, -3, -1, 1, 3, 5, 3, 2, -1, -4, -7, -5, -4, -5, -7, -7, -7 ], "events": [ [ 24, 29.0, -1, 34 ], [ 54, -5.0, 1, 62 ], [ 75, 4.0, -1, 83 ], [ 84, -6.0, 1, 97 ], [ 90, 1.0, -1, 97 ], [ 98, -6.0, 1, 104 ], [ 109, 5.0, -1, 118 ] ], "input_csv_sha256": "01a6232710be1d4dd606fb077855c424e1b43b17ec602c59b28b6db4f87249db", "output_csv_sha256": "37fbaaf015d2020eff07e62c2aaeb2de0e4145dea85403c29a98dbaed94cf3d9" } ] }