0000011011101000111111011001011101000011011101001011110001011101001111010010000100000100001000110011101000111011100101110101010110000101001001101010111111001000000011100110110100001110011001001101011111010001010010010010010000010011001111100111101001001011110100011111111000000100110100001111101010110111100010001101111010001101000101101000000001000100100111001011001000101010101001011111101011110010 1010000100000101110110001101100011010111110010101010100000001110111011111001110000000010111100111110000010101101001100110111101001110110011010110000001011110111110010000100100100010111001001010101110100110000110011011001111100110011111000010101001110100010110000001101111101000000011010111100110001011110100010111000010001101011101010110111001000001111000011000100010001110110100000011110100101000111 0110110101101110110110011010101011011001001101110011000010110000000100111101100001001000100001001001001000010010110011011001010001011111011010011101101000111110111000011010110000101010000101000111000011011110100100011000100101110110010111111110001001100010101011110001100000101101101100011010101010100110001000010110110000001011010110001110010011101110000101100100010000000101111111000001001010111010 0010001000001000010100101110101001001111101011011001100011110101001110111001010000010100011110101010011100110011100111101100010000000100010011101111011110000100101001100100100011011111011011101100110011000110000000100011100001100111111101001001110110010010011100111000100100010101011000110100000001000011010001100100011011101011000011100000110010011001110011001111101010101010101100000011001110010010 0110110010001100100110110100010110010100110011110101001100001101111010000101111000000101001010010111100111101101010111110110111100000101000111111111000101100000000010110010001100010110101100110010100010000111000000000100010010110000000110100100101000001110001001010010010111101111010001000111110010001001011100110101101000010011110100111011010000010110011010101111000111110000001100001011010000010111 0101101010100001000111000101010101011010010101111110101100000101001111101101010001000000100011011111010010111010111100101101111010100010001000001001010100100001010101110100110111001100111111100111100110010010110101111110000100010000101000110001110001110111010101101101110001100010101111110101100011000111101100011111000111110100111010011011100000100000110101100110100100100010101010010010011100000011 1001010010001010001000100000001100000011111011001001111111111011110000010100000000101010111111111001001011000000010011111110001101101101100110010101010101001110010101110100110101011001001101011111110111011110001101101000101111001000111111101011100111100110000010111101101111100100001100001001001110010110110111011100010001110010001100010011110101001111101011000111111010111011110000000101100010111000 0110000111110000001111101001110010110110101010001011000011110000101111001010111011010011101100100100011011011010111101010101000110001100101101110101000100101100111010000001001111110001001010010000010000111110001011100101010000101100101111001110110011111110100110000011000101011110001000001110101000001100110101100011110001011011011100001001010101001001101000101111111000001010011101001111101111001011 0111111011101011111101100111010011000010010110000011110111000011001101000000001100101100001110001010111101111110010001000011101101110010110001010110110110111011010110001000001011101000111011101101111010000000001111010001110110110111000001000010111001011101010101010101110001001110111110011010101011110000101100000111110101111011100001001101100110001011011011100111100100000101001101001100101000110011 0010010010100001111110010111011011100100000001111110111000001100101101111011000000111011111001111000101100000110001011011111010100101100000110110000011000010010011101110010111011111101000011110001011010001001001001010011110001100010010101010100110110000000000000111001101010000011110010000001010011000101110111010111011111100010100010001011011000101110111001011100011010111100110110001101110110110101 0100101100110101001111111010100010010101000101100110101101000000110100111000100110101110111100100101010100010010011000111101000101011100010101000011101011100100010111100111010111011010101111000010101000000110001101010100001010010000010111100000110111010000010110101101111010001100000100001101101110011101110000110111010100001110000100111000001101110111000011000100110000100011010100010101000000001000 0100100101101110110101101010100100001111100101101010110100100010000011111100101001110000011010010100110000010011111101101101010100110111100010110111100000011110111111101000000011111001100100100110001011101111000111011001110111011110100100111011010100000101101010111111001111000011011111101010110110101110100010000011110000010101100010100111100110010100000001110100101101000011010001111111111010011111 0001010000100010010001100101001011000011100101110001011010010011110011101110011000011011000110001110110110110010010000111110111101100110111010111110001111010001001000011000001001101101100101010101111100110001000111110001111011011100000100111000011000011011010110111110001001010010100010001100111110000101100000101011111101011101100010101110111011001101000110010011001101100011010111000001100001111100 1001000010100000001101110101010111110000100010111101110000001011011100001000110010111011100101101100010101011001010100010111011011000110001111000100000011101011101101101110011110110110111110101110111111010101010100101111101101111001101110011110001110110110000100011101101101101000011111111100000010010110010111011100100000010100101100000101010010010101001111010100011110000101101000010011000101110010 1000101110101101101011010101111000000000000100001101100101000101001000111001000101010000000000111110101111110110101101001110100000100011001101100101001011010000010010100000110100100110011010111001000000011111101101100111101001110110101100101000110000100001000100010100100000010110100100001001100111110011000111111100101001010110010111001100011010111001101010000000010100001000100100010001010000111101 0000011110010101100111000011001001110010111001111010001111111110100100001010100110101100101001110011010100011001011111010011011111100100111011010100100110011111110000111101100101110110010000111010010101110000001010001011010001010101010100010111011100101101100100000001001001000100010011100100100001110100111001001100011011001001000011011000111110001100101000001010000001010011110001101101110110001101 0101100000000100110101110000101111100000000001010011111101100010101001010111101100111011010111010111011101011000100110011000001001011111100001001100001001011111100101011000101011010001000110001011110101001000110011110011101110001000011000110110110110010011101011101011100100010101101011010000110011110110111100110000111111000000111000010011111001101011110010111010011111101100010100101010111001101001 1010010010111101100110001100011010101001001000011000101101111011101011000111010000110101101010000011010011110010000101001100100110000101010110110010100000000111000010011010001001011011011011111100010101011100101011000010100101000011001001000011100111110010010000010000101111010010101100100110011110001011001000010011110010010101101010011011011110101010100000101010011100001010001000011100010101000110 1011000000111011010111100011110110011100110111101011111111100110111001101011001110011011000010101101100100110101001110001000010000000100010000111001100011000011001010001100000000010001001011101011001010100011011001011000100101010111010110001100101001111111001011011010011100101001110010000110000010000110001001001001100111101000100100101001011101101111111111010001101011011110011011011010011001101001 1001011001110100000011101110001110100111101000100100101010000011110010000001101111100011011100011110011011010111010110001111110101110011011100010111011000000101000111010000110111010111100110110011010111110001010110101101110010100101111001101001110100000100000011111001100010011110110101000111001000010110111000101110010001101001001101001111110111001001100101010110100000001010011011000011011000111000 1010110111111001101100001100001101111010001001110101001100111010011101011101111001011111000011111110011100111011001010001010010101010111010100100000011001111001011110000011100110010111010001001110011011111001101111011101010111111000000001110001111001101010101011000111000010110000111000111011010110110111001011000110000100001010001001000101000110000100100010100001111000111110101100101010101000101011 0001111001010100110010011111010100000100010100101110111100111001111111000100010011000000000111011101110001111000011101001000111101000011101001001101100000000101100101111000100110110111011000110000011001000101010110011111001000101001001110110000010100101000001000011100001101001000110001001111010110010011111100000001010100101101010111011101011010110111111001101001010000001100100111011011010100110101 1111001011100111101100110010001000100000110101110110100100101111111000000101011111101000101100000000110111010011111000110100100010100111011000110001111010110000011100100111100000100010100000010110001000010111001011110001010011000010110101010111101111000101101010010000110101110001001000110000110110010010000101111011110110110010010111100110000100101010000000011101000001111000111111111000111011100001 0001101000101001111100111111111111100000110000110011100000001101001101100110100101101111001011010101110110110000011110001101000000111110011011010100101101110110000110111000111000011000100110001000111011011111111111000111011010001011111010110010000001111011011101100110100100111100100100001101010110000001100101010010011101100011110111010001110110101001110100011110110011000010111101010010110001000001 0110110000111001111110110001111010111010001111001101011101011011011011111000010001000011101110110001111101011110001000101101011011010110110111000000111111101000010000101010000000011101110010110001101010011000100110111011100100111110001001010010011001000000101000010000110011001110000000111100001111010100011100101001110011000101011110000110000011010001111011010101111101000111000100000111010100010001 0101000010000011011011100110001110010111001111100001010001101010001101100010110110111010111011001001011000001001111101111001101011101011010100110110110010011010011001111000000001010100000101110111111010001001110011100010001110100001001001110001110000101011001111010110000100000011111110110010111010011111101011000001000100001001011111001110000111100010010001001101110011100001111000000011001010110010 0000111110110000011100101111111111100011001001111011110000010111100000010101110110001111001111011101001110001000001000001111001101001111101000111011000010011101001010100001000110100100110011001101011111101101001101100100100010100000101011100110100100000010011111011001001000001001111111000101010010010010101000110110100110010111010110100111001110010110010111110001000010100001000010100010011010111101 0111010010010000011100010101011001001101001110111001110011110110111010110001011101011101001001111100001001100010011111110011011011010111010010110010101111011010100001110100010110010101011011001011000001100011101011101110000111010111110001011001101000010101010100000110111100000100010001100000100001011011010111011100100011010101011011111011001000010110100001101110101100101110001111110110011011111011 0111111110111000000010111001001010000001000011011011011010010011010010101101000001011101001000011101100100111011110010111010101010001110011111010000001000001011101011110101000000100010001111000111000110100011100001110110001001000011010010111011101001111100110000000101000110011110000011000110111010001100010000011000110110110001010111101100011011101101100100100101000110101010111110011101000001111000 0101110001011100100011011010111100111010010000011110010101100010111101010100110011001101101000110100000010110011101010100000010001110110011010001110110101110001101100111011100100010110011001011111101000100010011000101100100110110000000101100010101001001011110001001110100100111011110100111010101101001000010000111111011010010110010001010111001011111011001110010001111101001101101111101110000111110111 1110100011100111000110000010111010101001111001001111011111010011000110111001000100010101111111011000010101010111111011011101100010000011110000100111101000100010101001011101110010111111101111110011110010001010010110011001101011000010011100000111101111000110011110100000110111010000001001011100111110011001010010000110011100011011000000010010010000000111110000111100011101001011110010110011011110010100 1101110110111110100100000011100000010000101011001011111011000101101000100111101000111110110101001110001001100001011101011011011001100111100001010000101010001011100011001110011001001010001110000101001110000000011001111000011000011010000100000001010111111100100101010000011101100000111100100000101010111100110010110100010111100100101000101101010000110000110010100110001101100110010010100000010100101111 0101000010010001110010011000100001110011011110110101011111010111100011100100101111101111000001110000000111010000111000001010001110101001111110011111001100000011100010110011010110010000000001111010110110111001010110110000000001001001001011101000000000100001011111011100000011000100111001000110011000101011010111011110010110011110111110010110101101011010111011001111100011101000101011100101101111001001 0001010100111111100010110011010010010100111111011101111001100111011101111010111010001001110110001110101111001010001000000011010100010010101001011010101100011101111110111001100111100011110111101001000110101011001110010010011110000001100100110001110101110111111101101010001011000000101000001101101000000111001110010100101110111111101000101000000111000111011000101001100110000100110000000011010111010110 1101100000110000100011011100011000111000011000001110011001110100110000011111000100100001010001000010011100111001101101001111010101001111001101110100100010100110000110000000000100001110101011100110111110111010001100101001011011100001000100110001011010110010111011011011101001101000100011000001111000000001010110001000010010001101010110100010101101110000011110111000011100010111100100111101110010100000 0110000111110101000010101011001011110111111011000111010110101011101110100000010101101100011111000111110011111101100011001100000111010000010101100000100010011111010001001111001101101001101011010110001001001100110000110011111101100011111000000011101101000001100011011001110110011000000000110100011101001111101111010100111011110111110001011011110010101110011100010100000010111110001111110001101000001100 0101100010010110111000111101001010100010110110111011000000110000001010110100101111000100111110010011101010111000111101000101010011001011000100101000100000101010100110111101001010110100000111110001011011000010011011110111111000110000011001001000110100011011101000001010110011111111001011000111001100100001010010000100101011110111100111011011101000011111011101100010110100000100000100001000011100000001 0010011101101010100010001100000100110000100100101000011001000011010100000100111110100011001101101100110001000001110010000110000001100100111001101110101100100000011100011011001101001011011110110001011011111101111101011010101101101001010001100011110100000100000000000000010100110010100010111000000001100011011001010001110001111101001001000111111101110101111101000111111111110000001000001101000100110010 0010010111100011001111010010110010000011100101111111011111101111100001100011110110010010100101001001000100110101000010111100111111000110000111010000110110000000110011110010001010101111001101000010001011001011011101011100101010110000100000101111101001110101000000110110100101011001001011111111000101010100001000010001001101110111100110010111110011011101011100110010111101100000111010010001101001110011 1101111100011011100001100111110010111100110001110001010110011000100101101000111011011110100110100000001100010101001100101001010101011000101110000010101100100000010100110000001001100001110010101101100000110000101111101101100011000110000001011100111000000000111001110110001010001000111101001110011011001110000101101010001101011001100001111011111100001100100001100001100001110001000000101110001000000011 1000001010010011101010001111110110110110010100010100000001101111111111010001001110111100100011100010010001001000000101000000101110111000101111000100100101110010010011001100101010111110000100011110100111001011111001101111010110111011110000000101100010010101010100011100010110101110010000001011111101000101110011110101111000100111010110110011100100011000101000000001000111100011010110000111011111111000 0001001001100101001011110111010001111110110010001110010000001011010111011000011111111110000101011100011110010111001101110011010111010001001101001000100111100000110101010111111010011100111000101110110011010111110000001000110110111100110100011101100100111100000000111000110101000001000100010100110001010001101001110000010111010101010000100000011011101110001100110101101111001000000000010011001001111011 0110001101001000001100011000101010101101011000001001011111111100000001000111011101011110010100001111100000101111010110001000101000010000111111111000111111010111101100100110110000101111110000100100010000101100101100011010100001100110110111000100001111011110010110100100001100111100100010011111101101100100111110101101000010011100011101110100110001000011101001000001110100011011110111101101001001110100 0110110000100111010110111111110100101110100110110011101001010001010101000001011001101011111100101101110110111100011111100011011111001010100111000010101000101110100100111001101010010111010000010111111010001111111010010101101111100100111110111100011100111001011011101010011111001001000011110010111011010001000110011111011110110110001010111100110101000110010110101111000101000010100110110111110010010101 0100111100011100111001110111111000110000100111100001001110001001001010000011110011111011010010101110100110001000000010010011100001111000110001101111011011001101101110111000000000000110000011101111000101001001111100001100111101101101001101101011001101001100001000010000011000000100111110101101010110011011101001000111100111011001011100100001110001011111110000110001011101101101110100001101111111111101 1100001001111100100101001110110010001011101010101101010010001011000010000100110101110111001110100010000001110110111111101111111110011010001000000000111010000100011110010011111111001000111000001110010001110001000110010001011101111111001010001011001001001010000101111100000100010010011111011100010010100111101110000100000111001000011101000110110000111000011111100000100100101101011001111100100011110100 1111001111101101001111010011101001110110110010001111000010001000010010100000010000001110010111101001000011101101010011011111001111001110110111010111011111010110000111101111111110000110110100111100010110010101000111000001111111110110001000100111011101011011010101110011101001101110111101100010001101010011001101011011100100001100001110000110000011100000111001101001100000100101001001001000011011100010 0000011000100001001011101011001000100000011111010100101110101111110001000101110100111010101100000111100000010010101001010010110111111011111011100001100011000110010110010111111010011001010110101110101011111000001111011000010110101101010001101000001000111011000001111100100101111101000011001011011111101110110100110010000110110000101100011011010110001110110000010111010101000001000001100000001110000111 1010100010000100100101001111010011001001010010010001110110001000011001100100000001111000110011101001000100100000100111110101000010101010010100110101010111001000110101011001100111110111110011010001111001100010110101010110110010000011011110111111111101010101111100010001011101100111111111111011100111100110110111110101100000100110101000011000101011010000011000101100111001000011011010011111100000001100 1101001101000011111110100001011011100101011010111110000011110110110111000000100001100111010101000011110110001111011101000100110011111001000001100110010001000001111011100111000111010010111001010011110000111001100011011101010000011100100100101001011111001111101001111110100010010110001100111010101000000000000110110010111101000000111001001010111101110001001100100110100100111110111010101101111001111111 0101011011011101000000101010110011011001111001010011000100110100100011000111101110110100000100010101101111111011100111110001111110100000000101000001011100011110010101000110110010010001001111110110001000000100001010010100100111110011101010011111000001000101101110101110000001001111000101111001001000111111111010110001011001101100000111011001111100110110100111010111111100101001100101100000100010111110 1110101101010100111110100001000101010110110110000010110101111101101111111101101010010110011110000111110011000010100101011100100011001100001111010011001101101111010001011100010010010010111100111000001000011101100010010110111101100110100101111001100011000100010010111001111110011110100101000100011110110110010011000101001101001011001001011101111001010100100110111000100101011011111111111110110010110000 0100110101000100011111011010111010010111000010110010001110001010011110101001010100011110011010100101101001000110010100001000001011100011110001001010110000000000110010000010110011100100001111111001010101001110010101011101101101000111000011001100001111111010011011010111001111011011010000100001101010010001100101110101100110011100011001100010010110101100110110111010011111100110000010111000000001011000 0000110001000001011010001011010010010110001111100000100001111011100111011010101101101000111100010101100000000100010101000101010010010111011111011000011110000010011110101011010100100011010000011010000011011100010000011110110000011111010000101100011110000000001010101011101100101110001100111101101001010100110000000101111101110011100000101101110011011000010110000011100001100010000001011001001010100000 0110110101111000100010011101001110000011011011110101000101001001110010100011101100100011110111110011111011111111100011000011000101001111100101110110100001011011100100111111011110001101111110110101011001001011111000101000111001011101110110101110011100100010111111100010000000111101010110000000001101001001010100100111011010100101110100000111010101011101000101010000100111110111001101110110000100110000 1100110111001101110111111000111001010011010000110110000110100101110010011111111100010010010100010110100010111100111101110100111101000000011110011101101100001110111011110110100011001011011101000100110110111110000101100010011110011110111100010100001110001000100100100010000110001011001001111011001000110100011010100101010011010001110010111011110100001011100101101111011010000100100111110111010101010001 0101111000110010001111101001110010101111101100000010010110101111010100101010000001110001000000010110101100011110000010110110011100010011110010011111111110111001001010011100101101011010011011011110101110100001011110001111010110001000110100000100001000001001111001110011100001000011011110011110001011010001000010100010101110001101111000011010110100001111101011110101011011001101000110101011100101101011 1011110011101000010100011011000011110001111110100010111111011100100100110110101100101110011000000011001001101101110100100111111101110010110101010011010110100100010111101111000110000010111100000110001001100110101011011010101111001101000100011010111110010000010111001101100010011100111000111110010100001001110011011100101100011101010100100101000000000111001110100100100101010000000100111110111001101011 1110000101011110011000100000100010100110000101110000000011100010001000101001010111100100001111101000100100001101101011010011001100101110111101111011010111111011100100000101011001011011101110010001111111100000100101000110100010010010111100001111111101001000001101101100001000111101110111100100000100001111101000010001001110100101100100101110101111110100010101100010100110111100100111111100111111010110 0000100001110110010011010011100100001100011101010000111000101100010110110100110011101100101101100100100011101001111111101101001000101000110001000100100011101110100011101011001010100100110111010110100101010111110101100110010011001100001110101110000110011101111001010110001011100100101100000000110110000100010110011111000010101011010010000111010110000111100001111101001011001010000001010011011101100001 1110111100001101011011000100000010000100000000010100101001110100110110000011110111000011011111110100000101100001000010010100010000010110000111000100001111010011110011010011011110101001010000110111010011001000101101010100111110001101010000100101111000101011010011011001011000001101111100111001010111101001111011101110001000001111000110001111010011011100100110100011111001100110100111000100000100111000 0111011111100101011011100001010011101101000001010110011100000011000101101000111010100001101101000000010110000011000000110101010011011011100111110010100001011001101100010110100000011010000011101000000110101011101110101111100101010111111010111001000111111101010000000011101010000011110000001001101100001001110000110011010011110011000100001000110101110011000000011010110110100101111100100100011010000000 0001001001001000110010001000100110000000000000111000000111111100001100000111110101111001001010101111100001000010001010000100111100101111110110100110001001101110101000110011110000100000010101010110011010011100111100010110100101101110101001011101001000010010111010111111101101010000100011011111100101001110111110111010110011110110011110110001011011010011111101101111110111010001101110100110101100100001 0010001100010110011101110011110100111000110101101101110101111011001010101010011111111000101001011001110110100001001100000100110100100111000001110000010110111000001101100001000100010001111111001101001010101101000101010101010000011001110010011101011100110101000010011100111101010111000001001011110011010000111101110101011000101000011110000011011100110110101000101100010110110101010001111010111011010101 1010010101101001010000100001010000000001000011011011110001111101101000100100100110000101001010001101001101010111011000010001110110001101001111010100011010001000000100101110111011001111110100010111101100001100000101001001011110000000011001111010010001011010100000010001011010000011001001000011100110011011111011111101101101001001000110110100110101101100101001111001000010000010101001101111010100000010 0101011001101000011110011010001011100001001101110110101000011111000101110110011001011011000101101010100000101010111100001010101101101001001110111110111010101011011010010010100001111110011100001101110111100101100010101100111000011011010000101111010000101000101111101000101110101101100101010001010110111110100000000110100001000010000100101100110001010001001010111011110001111111001001100011010011111011 1011110100010000101010101010100111000101001111000001110000111001100110011101110111100011010010010011000101110101000011010000010110101110110000110101001110001111001110101110111101111011101100001110101100110011011111110110110100110100001100011000011010101110101100111100001000100101100001011010100000100011010001001011100010010010010110001101011100010100011010110111101000100000101100010011110110100100 0011111001111110100110110110101000110110110011111101010110011111000101001000011000001101001000110011000000000011001111110011000010001100010110011110011101001100101011100101000000111100101010011001011000101110110101011110000101101000010000010101101110010101010011011100100010001001001000110110101001110010000101100110110000010101000000110010001100101001101110000010110010001111001011001101001100010011 1110111000101111010010111101000010010010011111010000101110010001010101100101001011011010111010111110110010100011110100111111110001001011010010011011111110001011111111011101010000100000011010110010110100100110100011101101100111010011111011011000111101111011000000010011101000011011001110111001001101010000110011101001011010011010011001111001000001100110111111101001011011100110101110110100100001111110 0100111011111100101110001110101010001110011000101011110010010001111011001100011100110011010011100010010111000000100011110110010101000100001010110100010100010100011000110111100001010001001010000010111110111011010101110001110100000111100001100101010001110001011010101000111111111010101100110001100001010010011001011110100110100110011001111010000001100001110010010000111011001001000011001000111010010010 0010111110101101001001000010101100110110010000100101010101010011000000110101011111101011100101010110001001001000011110100010000011111110100110010101011010110110010100101000110010100000010100110101100000100101010011100000111011000100110111110001000000110111111011000101100101100100011001001010110110100010010000111001111011111001101100110001100110011101001000000100100010100001010000011100110110100110 1101011100010100110100001111011101111110000011001100001010001111111011001110111101001100101000000111010001111111001110011001101010111011010111111100010110001100111011110111001001111100011100001100100001001001000100111110010110111010100010100110110111110000111001010110101010100101100011110100111011101011110010010101011010111011001110000001010110100100111101001011011111001110010100100001010000000100 1001010000100110110100110000011110111100011000011001111011010011011110001101101110011111000000111111110101111110000111110111110000011101000100001100000101011000110110111100111110110100110000110010110010101000110011010110011111001100100111100011010010110100010010011111001110100100111101100011010000010111011100010001110100001000110010111001000011100010101101111100111011111110010101111010111010111101 1101000101100001110011011011110101010010100101010100011001100001111001010011100010001111101111000011110110001101100100001010101111111101100111010000011100011100010100111000001011111110010011101101000110010111110010000111100101110000000000111001000111001001011000111001100001000111011111110000111110111011111100100100110011110101010111000100010000111111010111100100101000101110111101110011100001000110 1101111101111100010000100001000100001010111001100010011010110010001010001000101001011010111100101001010011001011111001101000100010010111001110010110100000001110111111100001111000101001101001011000100011101101110101110101101100000110100011110010110101000010011111100100101011110010001010111011101001111000011111110011011100100110010000010111110111100001100010011000101111110100001001101011000010110111 1000110101111110111010011010110010010100011110011100011001100000110011110001011011010101000100110000010101000100000111010010111010010011000010001111000101011110011110101010101100000101000001101001110111111001110001000000001000110000111111111100100000010011111011001000111001000000000110110001100000100110000011000011000100101001010001111010010100001111101110111111001110010101110011010001111010010000 0100111000001001001111000010110101001010100110001011011011110001100010011001101010110110000111001001011111000001000010011111111100101100011110101110001100000010010101101000111101111101101010111000000010111011100110101001100100001001111010111001111110010111111011101101100110001000001001111010110001100000001001000101110011100011000110100110000101001001010101011001001111101001110100011000100010110110 0110110001111111000100011101110000110100000011010000000010010100100101110111110111011110001110000111001101111110001000100111101110010010111010001111111101111001110100101100101111000100111101111011101111001101100000110110001110010100110000011101101011000110111000000011000000001011001001010101001011000101100100100110101110110111000001010001000001001110100011110110111101110011011101000100011001001101 0001010000101111000000001100110001111001000101000010100110110100101010100100010000011101000001101010111010100100111100101010001011100011111001011001001101100100100100101000001100000101010010111111100101001000111110111101001000110111111001010110001101111110101110111011111101101111010000101110111110111101010111010000001100110010111101001000101001010011010000111100100000100111000101100000100011000011 0001000100111101010110101100100000100010000010010011001000001000100000011010101100001001010001010100010110011001011110100110011101001000011011110101001101000101011010111000000011111100111000101111011100000101001100001101110011101001100001101010001000001111111001010111000001110001100111101000111100110001110011001010110000001010000110000011111010010101010010100000000100010110100001110000000010101000 0010111101111010111110001011110111110111110101001000010001011100101010000000101010000010010000010001101110010010101111000000001001100010001010011110001100101100100000010010000101000100110101111111100000110111101011011011011100110001111101001000110111110101110111010001011011000001101111010011010010001010111100001010100100001000000110100100100000011000101110100110010100110001100011011100100010011011 1000101000110000100100110110110000111001011001100001111000010011001110000110011111101001110110011000001000001100101011011000110110110011101000111000000111110100000010011000010110010011101111000000101001101110111000000111000110101011010110110111100000110111001000110000101011000101001111110101000100110110010011010010111001011110111111001000011110111110110000100111111011011110001001011010001101111000 1000100001101110101010110011011000000101111111110111111001001111101111111010000101100000101110110110110101100100001001100001111100010101001110000001100101000101100110001101010101101001111000011100110110111110010001000100010110100011110101110101111110111101100101101010110100101001000101110001110101111011011101100110101110100101010100000011101011001011111110100000101011010001101101000111000111101001 1100001111100110011100010101101111101001011001101010010111101101111010110100100111000001000101001111110100011001011000111111101111101111110101111010001011001011111111110100001000000010000010011011010101110011101010101100001010011010101110001001111110101111000100000011011111011001010101001000000110111011000001110101101000111100010000101100110100011001001001010110110111110000111001010010011101111101 1101111100011010000001111111111011010111111010110001000001010111111010010000100010010111110011111101101001001110110011000101101111100011011100100100100011001001101010110010101101101101001110001100011010000111111000111111100111001110010110110011101101101010110010101001011110011011100001111011110001101000101111010101001000011101110100100110000101110001001000010101100101010011001000011011001101100010 1111110000101111101001110000001100101111100110010000000101111000011000110001011010001000001001010110101110001001110000011001100101100010110100100011111100101000111000111010001000011100101101001000111000110101110110101100101010011111110100011101001001001111110110110111001000010001111100001101110001000010111010011000100010001100010000111111000011111000001011010111011000110101001011011001110011100100 0000111111011011010100011110001000101000001000101000000111110010001110010011000100000111110101010010111101010000110001010101110001110010000000010100001100111101111100010101011010101100100010011001011000010000010011100101010110111101111110010111001100110000000110111111000100001111010000110101110110101011100110101100100101111000011000110111011011011110100111100010110011001011111000101100110101011011 1101111010001011110111110101101010111010000000111101000011101100101110110011001000111011011111001101111110011001011010010000010001100001011010000110010101010011011101101111011110110001001100110111000011110111010101011111100110011000000101001111111001010001011011101010110011111001011101100000011110001000111100111010110011001111011101100100110001011101010110001000010000100111011000010101111001100100 1011001110110000011010110011100101101011111101110000010100010100001001110001111010100000110001001110111100001000110100011111011110011010110011101100011110010011000011001101110110011011000111101110101101011010010000001101101111101100110000011100010110111100000100111000101001010010001010101001111000010101101000100100001000111110111011010001101011101011010101110101111101011001011010001011110111001111 1011001001000101100000011100011001100101011010001110100100100000010101111001111000101000001000101000101011000110010111010010111011000100111111100010011001101001111110000101001001110100001111010010001000101101010100000000011011011111011101010110000011011011110001000100100000001010100111101110001010100011111110011011000010010010010111011111000001000001100011111001010111110111000011101111001011101100 1110110000011100011100001011100011001101110011111011111110101001101110111001111001100111011011001101110001000100111101101011011000001110011011111001001011011110100110001000001100011001111010100000110001000101010110101101111000100100110011111010100001100100011000010000001011100000110010011000000100001100011011001000100101011110110110101000101110001010111111100111000101110011000000000101010001110110 0100101111011001110011011101100011111101110000000000001100111110100000100100000000000110001001010111011100101010001010001111111010100100011001110101111101111111011011001001000111011011011010000010011110000110000001010111000001010110110101111001101111010001101000100111110010101010100000111111111010110101011110010101100101001011011111110101101011001000101011111000111101001111010111011010001111011001 0010001001000010101110011001001110111011111001010100111011001001111110000110101001001011001100110111010011010000000110011101111000011111111110100111001010000101011110110110011010100110000011100110011111101101110000001111110010101110010101001000111001000000110000100000011111110010101010110101101100110010111100000111010100011000010000001111000011111011011000111000100110010100000100100001101001110010 0111000100001111110110100100111010011001111011100001000001101100000000110011001011110110100111111110111000001000100100000001001010101111000011001100101000100101001110110111111111001111111101010111000001110011110011010111000111011010000010011001101010111101111000101100101011110001110100010101110000001111111110101010010010010010101101000111010110110100101110110100100010111011101001011101011111101011 1101000110110111010000100111110010100010011000011100110100001110000101101010101110101000011110110011101110010010100101001110101110001000111000111110001110111100100111101111100011011100011101000101011001111011100110001001100001000111111100011010111100001010100011101001101100001011010000011001000101111110100110101010000000111010000100010001111011011010000111001100010110111101001000000011011000110101 1101110101100101110001100111010100111001111011111000000010001001111100101011010100010011110011011010101011001011110111000100100001111100111010011000010010111011100000100111101011101111111011110110011011111010111000000010000000100011011000100000101010101101101011010011001100001010111011011101000100101011100011000100101000111100111011010101011011001110110011010100111001000101010110110001111010110000 1110010001110111010011001011011010001010000111011001010000000010010111101010010010111001011010010101111000000001101010101111100110110001100010111100111110000111000111100010101100011110010001100010110101100111010001011000101001010100111110010001101100100101110010100011101010011100001011111010110110100110010100110001101111000001100101000101111000000001010101000001101110000010000000111100001110110110 0100010000010001011001110110011000011111100101000101100111011001111111001010111101111010011111001011111000011000000011001111000000101001111110000100110111001010110101001101101111111000001010000011101011010101001011001111111111101000010100001100001110111000001110001101111100110010000100100000011100001010001000001000000100111111001100010100100100111010101100101010100111010111101100010100111011110011 1111011011011111111110001000111111110001101000011100100010101111011110000001110111111110111000100000111101011001000101111110100111110011001010110100100101010001011111101100000101010001010000001001100000110000110010010001111110000100000111110110110010011101110001111001011001101010010000001011001110110000101100010001010011011010011100010001011100000000100011011101101010101001100010010100011010100100 0111111011100110010001111110100111111000001111011000001010011110010111101101000011101100111000100100000000110011001100011001110000101001111000100100111010001011101100111001011110011011111100011110111011101011110010100001011011000001110100110001111111111000100100100111110000111011100011110010000011100111101110110000100100001010010011111100010101101111000110110011001110100111110110000001000011100011
cTrader AlgocTrader

【cTrader】LineAlert【Tools】

2/22/2021 3/12/2021

4年以上前の記事です。内容が古くなっている可能性があります。

ラインに価格が触れてから考えたい

水平線やトレンドラインを使ってトレードしてる方にはわかってもらえると思うのですが、こう目安となるラインを引いたところで現在の価格がまったくラインにからまないと何もしようがなかったりしますよね。

とりあえずライン触れるまで待つんだ、話はそれからだ」と自分に言い聞かせてそっとチャートを閉じるわけです。

でも結局ライン触れたかどうか気になってちょくちょくチャートを見てしまったり、見るたびに「ラインからは遠いけど入れそうだな」とか邪念が湧いてきたり・・・ばかばかしいことこの上ない。

もうね、こんな無意味なこと考えなくてもすむように、ライン触れたら自動でお知らせしてほしいわけですよ。

 

LineAlert

というわけで、水平線やトレンドラインに触れたら音鳴らして教えてくれるインジケーターを作成しました。単純なインジケーターなのでソースコードも公開します。好きなようにカスタマイズして使ってください。

 

機能概要

チャート上のすべての線を見張って、どれかに価格がタッチしたら音を鳴らしてお知らせします。

どの音を鳴らすか、水平線とトレンドラインどっちかだけを対象にするか両方対象にするかも選べます。

即時Alertの場合はローソク足当たり1回しか音が鳴りません。次にローソク足更新するまでは複数回タッチしても、別のラインにタッチしても鳴りませんのでご注意ください。

 

パラメータ

TrendLine

トレンドラインをアラートの対象にするか指定します。

HorizontalLine

水平線をアラートの対象にするか指定します。

SoundFile

サウンドファイル名を指定します。ファイル名のみの場合はC:\Windows\Mediaを探します。それ以外の場合は必ずフルパスで指定してください。また.wavじゃない場合は必ず拡張子まで指定してください。

BarWait

ローソク足確定を待つか、タッチ後即アラート出すか指定します。Yesならローソク足確定を待ちます。

 

ダウンロード

(2021/3/12 修正済み 下記参照)

 

ソースコード

using System;
using System.Linq;
using System.Collections.Generic;
using cAlgo.API;

namespace cAlgo {
    [Indicator(IsOverlay = true, TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)]
    public class LineAlert : Indicator {
        [Parameter(DefaultValue = true)]
        public bool TrendLine { get; set; }
        [Parameter(DefaultValue = true)]
        public bool HorizontalLine { get; set; }
        [Parameter(DefaultValue = "Alarm01")]
        public string SoundFile { get; set; }
        [Parameter(DefaultValue = false)]
        public bool BarWait { get; set; }

        private List<double> _targets;
        private string _soundFile;
        private bool _isTouched;
        private double _exBid;
        private DateTime _exOpenTime;

        //---------
        // init
        protected override void Initialize() {
            //--- soundFileセット
            if (SoundFile.Contains("\\")) {
                _soundFile = SoundFile;
            } else {
                _soundFile = "C:\\Windows\\Media\\" + SoundFile;
            }
            if (!_soundFile.Contains(".")) {
                _soundFile += ".wav";
            }

            // 最初はこうしようと思ったが、AccessRights.FileSystemが必要っぽいのでやめた
            //if (!File.Exists(_soundFile)) {
            //    _soundFile = Environment.GetFolderPath(Environment.SpecialFolder.Windows) + "\\Media\\" + _soundFile;
            //    if (!File.Exists(_soundFile)) {
            //        Print(_soundFile + " is not found!");
            //        throw new FileNotFoundException();
            //    }
            //}

            // --- ターゲット設定、更新
            _exBid = Bid;
            _exOpenTime = new DateTime();
            _updateTarget();
            Chart.ObjectAdded += _ => _updateTarget();
            Chart.ObjectRemoved += _ => _updateTarget();
            Chart.ObjectUpdated += _ => _updateTarget();
        }

        //------------------------
        // update target
        private void _updateTarget() {
            _targets = new Listt<double>();
            if (HorizontalLine) {
                var hls = Chart.FindAllObjectst<ChartHorizontalLine>();
                _targets.AddRange(hls.Select(hl => hl.Y));
            }
            if (TrendLine) {
                var tls = Chart.FindAllObjectst<ChartTrendLine>();
                _targets.AddRange(tls.Select(tl => tl.CalculateY(Bars.Count - 1)));
            }
        }

        //-----------------------
        // Calculate でタッチ判定
        public override void Calculate(int index) {
            if (!IsLastBar) return;
            // OnBar
            if(_exOpenTime != Bars.LastBar.OpenTime) {
                _exOpenTime = Bars.LastBar.OpenTime;
                if (_isTouched) {
                    _isTouched = false;
                    if (BarWait) Notifications.PlaySound(_soundFile);
                }
            }
            // OnTick
            if (!_isTouched && _targets.Any(t => ((_exBid < t && t <= Bid) || (_exBid > t && t >= Bid)))) {
                _isTouched = true;
                if (!BarWait) {
                    Notifications.PlaySound(_soundFile);
                }
            }
            _exBid = Bid;
        }
    }
}

本当は最初にサウンドファイルの存在確認したほうがいいです。今回はAccessRights.FileSystemが必要っぽかったのであきらめました。

ポイントらしいポイントもないんですが、線の追加、更新、削除時に対応するため、Chart.Object~のイベントでターゲット更新を行うようにしておきます。チャートオブジェクトを使う場合はこの辺の処理を忘れないようにしましょう。

あとはCalculateでOnBar的な部分を作ってるところでしょうか。最後のローソク足のOpenTimeで確認してます。TickVolumeは値が飛ぶことがあるのであてになりません。確かMT4のEAでも同じでしたよね。if(TickVolume==1)とかしないようにご注意ください。

 

(2021/3/12追記)

たぶんバグあります

申し訳ありません、アップデート用にいじってて気づいたのですが、このコードだとトレンドラインのアラートがうまく機能しないと思います。OnBarでのターゲット更新処理が抜けてます

上記のダウンロードリンクは修正済みです。すでに自分用に手を加えている場合は下記のように1行追加してください。

        public override void Calculate(int index) {
            if (!IsLastBar) return;
            // OnBar
            if(_exOpenTime != Bars.LastBar.OpenTime) {
                _exOpenTime = Bars.LastBar.OpenTime;
                _updateTarget();//←この行追加
                if (_isTouched) {
                    _isTouched = false;
                    if (BarWait) Notifications.PlaySound(_soundFile);
                }
            }

 

(2021/3/2追記)

他のツールにも組み込んでみた

この前作ったMTFストキャスティクスでも音なるようにしてみました。


まだコメントはありません

新しいコメント

コメントは承認後に公開されます。承認まで次のコメントは投稿できません。

cTrader's Life

© 2025 ajinori