0001111101000111100110101000010010111000110110111010011010101011001000110101011011000001000110101011111011100011000000000000101110001000000101011101110100010100100011110011101011111100000111111000011100011110000111100111000011010101000101000101111110100001111111011001000101101110010010000000011111001101011011011010000101110101001000111010100010010010001011010110100111011110001100011010100010110111 0010011001100000000100111010001001111011101110010110111111010001000011001000110011011111000001010111011100010001000010010011011010111001001111100111001111011101000110011111011001010111111000100011001000000011000011100101011101100111001101000010110101011101001011010000110110000101001010100110010001010110001011001100111100101010000001110001100011111110001011010111111000000111000101101001001110001000 1010100100010011010111001110000011111101010111111001000001000010000000101001100001100010011101101110010011011000000101000001101101100001011111001101010000001101101101111101010100101011011010100011110110100010101111000101011000111011110011010011110100010010111011111101010111111101011000010101100000010110000100111011001011011100000010100111111010010001011011111011011011000110100000110100001101110011 0010101011011110000111000011001110010101100101100000010111110010100101100010011010001110110000110111011010101100000010110110001011100010011111110111011010000111101111000111011110010110001100001100000110011101001000111100110111101010000110110001011000000110001101000110110011010000010011010001011110101101010100011010000011000100000100001111000100001001110111000110001000100110101000001000110101101010 1001111110100111010111010100110001100000001100010011001001111010000110000000011000010011011001011010110011111010011101000010100001111001111010011101010010010110100010010011011000111100111100001100001111010011101001001111011110000010010111111000110001111111100110001100110111001111110000011001011111101110001011110100010101001100111011111101110001000001000101001100010101001010010011100010110101101100 0011010101011101000111001001101001010011010010101000010000100111100000011100000010011010010111001001000100110110001111101000111001110000011010000011101000111000101111000011001000001011100010111011001101101110111010010101000100110100000111111101011110100010010101100110000011001001101000110001110111001111011010110011011111111111101001011100101010000110010111101110001011000010101110001110101111111110 1100001101100101101110001101010101010000111000011011001110100010010110001110010011111101110000011110001010010000001010111111011011100101001110111011110111111001010011101100010101001100000101110010101101101111011100001110001010101000000101111011100110001111000001111110111111111110101111010001100011011000000100010000001011010100101110000100001000101111111011110001100010100010010111000011110001101101 1010100011011010100100001000110101111000011000111000111011110011110101001110101010110010100111101001010111111111000111010111001100011100110000111000101010110100011100001110101100100001011100010101110110000110101101110011111110110001110110110100011110000011111110011111110110111011100001010101110111100101110001000101001010101010101000011111010100011111110010011010011111010011100010100110100000101110 0011110011100000111001110110110011110100100111111111000110100010101001101011001111111001101100110010001010010010111111010011000100110110010100010101010000010010100110110111100010100110101010010110010001110111111100111001010000000010011011110100011001110001101110001001011001010010000000100110000000110010010010011110101000101100010101000001111011001000100101101100010111101001011100110000111110100011 1111111001111011101100101110110101110111111011000100000011001011011101010101111010111001011100011100011111111101000001111101010011011010100001101010100110111000100100010001010100101011110110010000011010100000100100000111011000110100011001111110100000011010001110011001101111011011110001110001001111110001010110000110111100100001110100000100000100001000110011010110101001100111111110011111110000110100 1111010101101010100011110111000001011011100001000000010000110010110100101110010101001100000110101011001001110101010011110011111111011011101111010010011011101101011100100001010111011100001111010000111010101001111110001000011010001111011100101111010100011110011111001111100010101011001110000101000110001110011011010010101001011101100110010110111011111011001001001010001011100010000110100000111001000111 1011011000101100110011001010111010011010001110010100110110000011100010010010100001011010100110100011110001110010111111010100111111101111111000010010001101001011011100100011000110111100110011001010100110000110101101010001010111000000001111010010000111000110110111000100011101100010011100111001101001100011111100100101011001111101110010010100010011110000011100100010001001110010100111110000111111010010 0010111100001000111100110010111100110111011001111011010001111011111010100111111111101111001110110011100010111110110011000001110000001111011010111101010100001101110111111001101000000000001101100101000111111001001001100001111010010010011001001100101000100000001100001001000110100000011011100110001100111110011100000101100011011111000000000110100000011010110000001000100101100110000110001101110010100011 0101111110101011101101011110101001111110001001111110110010011101110010101100011010110000011011010110010000010000111111001101101011011110000001111000100110111111000110111000110011110000100110010110000100111010111011011110011001110001110101110000101011111110001001101111101010111110110000000100010100011011100000101001100111100011111001110111111101000011011111000110001101111011001011001000001101001010 1011111110000101101010001000100100111111111010111010110010010111111001011011000110001011011011100011110000000000110110001110010110101001011111011111100101110010111100100011010111011100000010101000101101101110111010001001001000110100111110111101110110001011111011100101101111000100001000111100000010000100111001111010010110111000011100010111110101001010111101101001110111010010100011000110111101001000 0010011111101110010100111101101010100101000000011011001001100100111011111010010000101010010000010000010101000111001100001011010111101100001000101101100101111010000110011010010100111101010001101011110111110110101000110001101100101011001100111011001000101000110101111000010001110100101100101010010111101001111111110000010000011101000010111101110111011000111111011111001111111101011101101001101111010011 1110101011010011111010010000001010011011011010001100110000110000011001100010000111010001011011110011111011100000101111011000110011011101001001000111001100000000101111110110101010101001100011011111010110110100110011110101010000111000110101001001001101110101011101001100111011111100011011100000100001010101000101101111010001001010110101100110110100001010010100000001001110111001100000001100011001101011 0100111011100111100111100010101101101001110000110111011100100000101100100000001101100000000011100001111011011010011110110011001100010000000010011101011100100001001110100100100011101001100010100010111101000011001100100100111111001001011011010100000000100101110000100010100111010001011000100010110111110011101001011000010000001100101001111001000000101100100100011111101010001001100011010101111110001011 1000010011011000111101001100011000101111111011011001101101001110000000010111010110011110001110011011000101011001010010001001001110010111101001100010001100101110111111110110110010011000011000010001111111011101100111110000101111000011001100101010110100101110101110001011001101101111110010001001000100010110000011110110011100001001010101111001101001111110010010011010001101000101001100110111111111001000 1100101010000000010001001101101111101111110101101011111010101100111101001111000101001110110100110111101000010101001001101011010110101101110000001110001010000100110101100100111100100010111110111100101000110111011011001011111110111110101011011100010110000000010110000100001101110101011000111100000001011100101101011010100100101101011111001101111110101010111011101000111000110110110000111100001101000000 1100001010010110100001110111101011111000010111001101011011011001010000000110000011111010011110100000001101001011000111100101110110110000101110010111000110000110100101000000000110100111000111100001010000100101100000100101000011101010010110001110111010001001101010000010101001100110111000001001100000010010101100100010111110111010001010010001110110011001110101011100100101111001101101100111101011100010 1010110101011111111000110110110101111000100110010100010000010011111001101101001100011011011010101001000001111000001000110010111110010010000100001111100100100111000011000010010011000001000111100100001010011110000111110001000100010111110100001000010110111111111000101010101111100110011000111010100101100011010001100100100001101100111101011011010000101100010011000110110101101001010010000000110101000010 1011001110110010101010110001111100011000110111001000101111010100110111000010011001111101111101101100000010000011000010000010101101010110111101011000011000010111110000110111011001101101010100001001010101111101100011100110001000010000100100111000100000111000101111100000111100100001010100101110101011011111100001010001100011111000001010010011100001101001000011011001010010110100000111111000010011011011 0000111100100110001011011000001100111001000011101011101100000100010010001001111010011000101101101100110010111100110000001001111001101010100011110101000000010100001100101010001100101001101111011011011110111110000011000101000001000011010101100000110111010000001100111011111111101111011110100010001101000111011001010000100100100100001110000011010011111101000111010011000111000010100111000000001011001010 1001000011001000110010100100000101011111001001011111111111110010001011000111011110001101111010111101100111100110001011000111110100100110100000101011110101110100101100101000111101101110111110111011101000101101111010110100010110100001101101011100100010110111100111100010011100110001110001111011011001000000111111101111011110001001111000011000010100001010111100110000110011100011000011111110001010100010 0001101101110010101001110111100011101100101001011001100001000001011111110100111001000111110010110110011001011101011111110111110110000010100111000001100011110110110101110011011010101010010010111011001100110101011011010110001011001000110110011011000101001100111111100011101011011010111101000010100110101011010100000111011011001110010000000001000100011011111010010101011111110000101000110001101010001011 0111101110101010111101001111100101111101110100110000100010111111111000001011101111010100110100110001101011101100111111100100100100011000101110001001110111011000100011110000100101101010010111010111101001101110011011011010010011001010100110111010001001100110111010011010110111110110110111100101001011011110100111101111010100001011001101010100010000111100110001011111100011101101110011110010010110101111 1100010111100001001111001110110111011110000011100010111100111001010110111011011000000100101010110111000110010010111111010000011000011111001001111110100100110010101111001010010100100011000110011000001011010011100111110101000000100001010010100001111100011111000111001010010010100000001100000010110111101110000001000011001001011110010111000111101010110001010010000110101110110001101101101001110011101000 0011111100100100011010110110111001001011011010001010100001000001001110111000000110111000111010001001110111110001101101100100101011010101010101111000010110011101101010100111000100111000101000001110011000011101010011100100011101010111010011111100010110000111010010010100000001010011100100110001100000100000100110110010111001001101111101110010010010011101010011000001011100010000001101100000000101101001 0010110011010001100000110110101001010000011011010101010101100111001010001011000001110001010111101001001111010010011000011011000010110111111110000001100110010001001101101000110101010111011111010001101011110100010010011011010101011101110111011111011111100001101011011010001110011001111011100010000101111101111110000010101011101111110011010111001001001011110110001100011111101010011110100101111011000000 1010101101111000100111101010110111100111111010110000011000111011000011111001110110011001111100111010110111010011000110000010010001001101000011110011110111010001001111100011110000001101000001100000101110010010100010111101101101111011010111101100011111110000000101011000110011011111101011111010000010000110001101100010011010101001100101101100000010010000011110100010001000101101111110101101000111010101 1011100101100111111001100101000101111100000111001100000001101010110000100111111010100011010100111000011010111010001101011100011010111001000000010000010101111010100110011101101101100111010001010100000110110110011001011101101001010010000000010101111110110011011011011101011111100000101010000111000011001111111011011001010010011101110100000110010110010101011100000000010101100000011101101110000100111011 1111110011010011110100100001111000010100101111111010010101111111011100101110011010010001111100001101101111100100110001100001110010100001000010011111100110111010111100001011000111001110100100100111001000001101000011101011010010000010101101010110111011110000011111001101101001000001000001011001011110001110000001001110011010111101110011110101111000001010000000110100010111110101011011010110110001100010 0110110010011000011100101111001101011111010010010111101100111000100101001110011000100011110000001101101000110010000110001100100000010000000111010001111011101100101011011011100001101110000010101001110110101110001010111001110111011110100101100001011010011010100011100110100010001101001000000101011110001001111101110001111000001010001011000101101110001011011011111110001101010111111111010111010000111010 1111110110001100011010011011110101000011000111000110000000111001111110001011100010100100100111111010101010010100010000111000111110011000100111011001110101000010001110100100010100110101000110000100110010010001111001010001110000001011110000111110101001100101110011011010111011011001100110110010010111001111011110101001011000101111111111010001110001001010011100001011010010101110010101111100110010000001 1000011001100110100010010100100010000101111101100100011100100101101010101111011110110011010111011101100101000110111111001101010011011111001001110101111101110101001001111000001111101110110101001111101000001000111111111000100110110101001010000010001110100101111100001011110011001110111100001111100101011011001111100110010101101110010101000101011110110011000101010101100001010001110110111110010100100100 1100001100110001110000100101101110101000000110110101110010010001010101010101011111111110010101010101101011011111001001100001011001010000110010100101011000001100010000100111011011001011111111001001000110110000101111000000111100001100000010111111101001100011100101110111101100000111110011110010010010101110100101001011101000101110111101101000011010011010111000110101101110110000011111000100011111010001 0010001101101100001110011001010011000000010110011011010000010100101110001010000001111101010100111110010011011000011010011100100010011110010001100110010010110101001011011100101111011111000011100010010010101000011000000011011100000011011010001110010110011110010100010100010010000110110111000100011011010000110110011001101110100010110101100111100000110000101110110111100011001100100101011111110110111100 0011110110001001110111001110110111000111110001001100000000100110001000001001010010100100111011011110001000010101110001110010100111011111010111101110111110000010010101010101011000001011010111110101011110101100010100100011110110001101000010001101100001010001010101100000110001010101110000111001010000110111011100000011011111011000000100111110010001001001111010000101110110110111100010111011100101011111 0101111011011011110100111110101001101001110111011010010000011111011101110111001110011001000100100111100101111011111000001110001110011111001000101000001110110101001000111101100010101110001101010110011010100000011011011110001011101101011111000110110010000110110100011100000001001010010010101010110001101110100101010010110111000001010110010000001011100101011111101000111111111001001000110110000101011010 1101100010011010000100001001010010010000111000010000100101000110110111001000101111001000110110001011100110110100000111001011010011011100000100000100100000010011100001110100011100101111000100011011011100010011000001111001011101100101100111101001001110100110000001011001100001001010001111110010000011001000111011010000111101011001011111100010011000111101010001111110010111100011011011110110011011000110 0111010001110011111011000100110001100000001011101001000010101101010000111011110111011111111011101111101101001001110110000011111011011000010100110111000111010011110101011011110011000100010101011101011000001110111100010010100001111010100100111010111111000110101001110101100111111100111110000100010111100101100010101111011110100110101110111011000001111010010011000110111111101000100111001001100111010010 0000010100011000101001001111111011011111100110011101000011110001010100110001100100111000110001101111100010100001101010111010010110111100100001110111011001110011001110010110110110001110010010000101000001111010010111111011011100101101111110000101101100011001011000100011011111010110010000110001011100101000100011010111010111011011000100111011010101111101011000001110111110111010100000111010101101001111 0000101000001011001111101110001110010100010110011011111001000111010111100101101000111111000110111100100111000110000010100111101001110010010010100011100101100101011100101101001000000011100111110110101011101100100100001100011010110010111001111100001110010100001110110100110000100000110101111100010100001000111110001001001000101010101001100100010110010001011001001110011011111100000010101101100001011110 1100010111010100000000101011010110001101110100011011011010111001111100100001010011101110011111000110001000101100100101111000111101111000101001011000010100101011010111000111101101010000010001000010011111010100001110011111000000100001001101011111101000000001110010101011110011011001000001010000001110100001101010011001111001101110001010001110011001000011010001000100011010100011011011011111011110010101 1101111111100010100001010101100111111000000110100110100000101010100100000101100001011000111001110011010001001100111111011110110011100111000010100101101111101111001100010011110011110011011110000100110010111010011001001001101000011001000101011111111000000101011001110000101010000001101010111010100001010111100010111110010111010110000101100011000000111010001110000100010000100001000110110010001000100110 1100110010101001011001000000001001011101100101110010110011110001100010110101001100011001110111011011010011111010101100011101001100110001001011010000100010000111011111110001011111101110110000100001101001010010000001100011111011111010100110011101110001101000000000000100011100011100101010100100110010110100000101001100100001110110110110110101010100010001001101110011101100000110100000000000001101010111 0001001111001011000001010111101000101001000110111100001001111001011110100011100111101100001010011110000010011110010001001110010110111111001000010110001001111011001001100110001001111001111111100000101100100000010000101101101100111011010100010111010000011101111011011100110000101111011110001000101001101111001011111001001100111111110011111101111100010001011000001000011101110111001111101000000001011110 0000010110101100111001000110111000001011111000011000000000100110110011010011101101110000011101110110010100100110000000111011010111101001111111000101100011000101001100010011100010111000000111001010001011011100001110101101100110010110011101001011001010101011010001000000010001111000110010110000010100011101100011010110001000111010010111001100000010001110100010100111010001100010111001100111011010000100 0111000111110010101100101000010110100100011111101011001101111000000111111101011100111100100101100110011100111110000010010001110101110001110011100110101001101101011110000010010111001011000001000000101011110101011011100111110110000101000111100101011001101001010000101010011000001011011100000001010100010101000000111101001111110101010100010000000110000001111101111001101110101000101010111000010111000001 0011001011101111110000111000100110011000000110110111000001110010101111010111011010110001101111111110000100111101010000100110111010101001101011111110110010110110011010001010011111000011100110000000011010010001000000000111100100000111000001000101011010010110110011101110001000110011011010100000011101011100110100011010101100001100001110001000111010100011100010001001001011101100011010101001111101110001 1010101011101101010011101011010100001011101110011100011010011000101101011010000101000000101111001011100101111111111011100010001000000010001001101111110100010111100011000110001010000011100111000101110000110011110111001010000000111100100000011100111001000100111001010111101100111110101000100101011101101010101110110100111110000110101111001001001100011111000100000010010101010000100110100011011001110011 0001111011100110001000100111110000101010100110010001111010001100111010101011100100011100011110111100101101000100101101111011000101110010100010000111100000000011000001011000110001000101110110101000010110010001101011101001001111011000110101100110011001011001001001001011011111101101001000100111011011001110110110001011101011101000100001001110110110110100110111101110011001000110000000111111100111001101 0100111011101000100010101101101101001110110001001111000001111111110010000010010000101110111010001100100001011010110111001100100111000011111100110101000011110011000111100011101101111011110100000110111010000011111011110000000100101110010011110101101010011001010011110000010000011001111110000000110100111010011100111111111001010101000000000101111010110010000011000010010011100000101111001101001000100010 0010000100010111100101110100101000110010010000101000101000100100011110111100110110100101100111010101000011001011110010000010111111011000010111010111101111010011011101011101010110001101000101111100010111111111110000011011110000101010001000000101001110000011010111110011001000100001111100110110111010100100011011000001000111100110011101011101100010011000010100110001101111001011110111000001101111010101 0001101001100011101011000101011101000110000001101001000011011101101000001011010100011010001000011010111010010011001101111111110011010111101010111101001110010111100010111010010000101010100100011001011110000011011110101100100110000000000110101111011000101010100110000011111000110111100111000111011111001010000011111011010110000001010010110010110001100011110011100011011101010111000111111100000001100110 0011011100100101110100011010010101100010010010100001110000011111111110001001100111000010011001001101111111010110110101110001001011101100001100011000100101111111111101111110101001000111000100111001001001111100101001000001110001111111100100101100101100001010111000110111001010001111000001011110010111100110001010110010011101000110101011100100101110001000101010110011011001110100010011010000000000101010 0010001001010110111110101001011101001101010101101101100011011011101010100001001100101101100100101001100000110110011000001011010111110000101010101110111101011101101100000000101101111110010110001011000001101000111000111011010111100001000001111111100110100110100001011101000111010011011011010111001111110101100110110100111100111110110001001010110100110010000101011011101011111010011110000100101000110100 0011100100010010010000111100110101000001010111111000011010011011011010011110011010101110001011101111001101000001010001110001111010000000000111100111000001111001101010100111111011100110110010011100010011111100100011010111011101110101011100101011001010101101011111001000111101100010001100010000111110110110011101101000111111100011101010010110111100110110100101111100011111001011000000010001000100011111 1100001100110000110101101101100111011111010001110111011111110010110111101110110010000111110001111111110010011001101011001100110101100010000000111011001111111110110001100001111100110011001011000110000100111111100010111110011010100010010101111001000011010011010111010101011010111111011001100110011001111111101010111101011000011000001011000111100111001011001000000111100111011010101001011111100001001001 1001101000110100111000100001100011000011001100100011001110100011110101001011001110011101001101110010011100011100100000001110000000101000000000000100000101100010011110101111100100111000000000111111100111001101100010001000110000011101111111110011001101010010111001001011000111011100101000101100101000011010000110101101001110010100001011001100110001111100010101110000000111011011000011111110101001110110 1110010111101111011111100001111111100100100011100101011010101001000100011001011100111101111000001010110000010011011100000000010101001111101010010011110110100111001010010000000111100111110101010010011010110101000111000000100011111110000000110000111111001100010010101001110010111100010000000000001110010111000110001001001100110000101010100111000001100100100001110101100000001100101011011100010101001100 1110011010011010100010100011101101110101011110011101110111011101100100110001101101000011010001001100100111110110101111110010101101000100110100010111010001010110110001100011011001011010010110001000111101000111000011000010011010010001100110100001111110111110000000000010111011100010110011111011001001111110000010110011010101011001100111101000000110101010101100000011000100111110000011100001010010110010 0110011010000011000111110100000110110111001000101111001000010100011010001001000011100110001111010001100001100011111011001011010000010001001111101011111010011100010001001001111010101111011101111100100101111011001011000011011010001110100011001010111010010100000110000010101110001111100001111001100111001110001000010110101100010000100011011111111110011111010011111000000111110111011001101110001001001100 1001110110110001010010110100011111100001000101110000001000010000111010110001100011010001100000000101011010001001000011011001011101110110011011100110001111110110011101110111100101011000110011100000110101111001001111011010010000011001111110000010110010110011111110101001110000111010001010010011101010110111011101111101111000110001110100010100011100110110000110100010101001010011110001001001101001000000 1111011101101101101000010101001111100101010001101100100101001101111011001111110001111000100110110011101001001101110011011111101111001101100001000000000001001010000110110111011001100110100011000001111010011100000001001101011000001100101011110111100010011100111110111111000110110111000001000111000111000011001110000011010011101100000100001010101110001100010000100001111001000100100110101010011100000101 0010011110001111000100111110000110010100011010100010011010100101100000111100000100010011100011011001101101101011001101011101100011001100011011111100111010110010110010011000001101100110010100100111011101001011101110101110010011111000111001100100101000101110010111001000001100011010000110011110010001101111000001100100000100101011011111010001101001110111010010111100110010110101010010111110011011001110 0100110100000000011000010001111001000111011101100000101011001111011010101111111101100001110100100010010101100010001011100101101010001000101001011000111101111110010011000110010001000110001101110100001010101101000000111010111100110010000001010001001101001001111000001000010111011101101101001100111000101010010011101001001100000110010101111101000100010000110010000111101011001001010110101101001010111110 0000010111111010110110101110001001110101011110001001010010011100110001110100011010111011101001100000010111111010100011011101000011100010011110011001011101101101110000100011111101000000110010100011010000010101110000011010101110110101000000100100001101001110100101101010000001111011011100100001010000110111000101001110011110001111101100111100110010101100111000110000000001000011001011100011011010011001 0010111011100010100101111110000000000011101110101000000000110101000101001111001100101011100010101001000110000101101110100010100100100111100011010011010111011100001001010011100110101111100001010111110100101100111111000111101110111110000011001000001000010111100011100100100101001101111011010000101010100101110111010101000100101010011100011101001001111011100000111011101100111010101110111100111101110000 0011110000010001100101110000111111000101001110011101110010010011001000000001000011101111010110110011010111000111111001110110000001110110111011110110000101011101100111000010000001110010101000110011001111000100000000101111010011010111001010110011100111101011100011110101101000111000101101001000100101001111111000011111010100101111001011111010010001110011000000100010010111001000001000101111110101111000 0000101111111011110101011001100011010011110001001100011111111110100111111101100010111011001001110000001000111010100101111000001011101101000000000000100011001011000011101011000011000101010001001101001100001100101001110000000011001011001101100001101010001110100000010110111001111000011011100101000010010101010110101010001000010001111000110101101101001100001110101011011110111101111011111101000010001011 0100000010111111101111011101100110111011000000110001110100100111001010111000100101001000011110011100100111010111000001011000101001100000010000100000111010011110001000110010100000111110001001110000101100111000010100101111101011111011101110111010110001111011110000100011011010001111011110101010100000000010101010110100000010001001001010011010001111010001101110111001101100011100000100100110100101111000 0101010010011011010000010111000111101001111100101110000011001111101101011110000110101001101110101011010111001110100000010011000000000001100001110111010111100101101010101001011010110010010010010011110001111011010111100100000010010101111100001000101010110010110001101111001100010110100011111010111010100010110001000100101101001011111101111001110011000110100000101101010101011010000011000001110011000100 0011101010100100010011111001000101111111111110100111110001111100011101101110010110100010100111110001101100101010000111101101000101000000110101111010001110110001101110110000100111011001011111100010100000001110111010001000011101000111100110001001011000001000011111110001101100101110000110110110110000011100111001001010010001101101100010111110010100001100010111100000110100010101110010111011111001101011 1110000100011110010100010011110111000110111100100110001000110001100010000010111001001000111100010001010010100100100001011101100110111110111011101111111010111101010000001000100001110101110101101101010011011010011011001111000100100010010000110000001111100000010101010011010001101111001001000001101000011011000000001100101101001001111101011011011000100111111111101101000001111101001011110101011000000001 0010001110011011011001011010111000001110110110110110100011010111000100011101011111111010010011010000111011001101011110101101001110110111010110010011001100000011111100110101101001000101101111110110100111101101001110010010111011110110011101010110100011001000010100011000011100111011011010100111100010010100010011011110001010010110111000100011111100101001101111100111010111001001011010100100000101100111 0011111110000100000111000101101111101011011000010001101010000100110111001101010001110010010100011001000100110101111011001000111011101011010100010110100011011100100101101101001010010001001010010011100011101001010011011110010010100111001011000111101101000111100011111111101000000111010001110000001011001010000110111010000101010101000011100110010101100110000101110101110000011100110011010101011100100000 1100010001101110101010011010001011101001111000010000100100110110101101110010100111111100110001011011100110100001000001100001011110001011101111110010000011001101011011101111110010101100011010110000000001101010011000111011110000111000101011100100010101011111111011011000110011011011000111101101110010101010001000000000001110110001010111100000101100011000001010101000010000110100001011111000100001100100 1101111110110111110110101111000100010000110111011101111011001111100111011010101000110001010001000100110011001110000110011010001110101001111000100001001110000100101010111110010001001010010011010101110101011011101011111101011010011000110010111011101111000001001011010010110000111101001100111000001010000010111000110100100000111011000001111101000011011111011001101011110011100111011101011011001010101111 0001011010100010000111011001011111100110111011000110100000000010001100100100110100010100101111111001000011001000000111110110011110101010101110011011000110010010111001001001010000100101000001101000001101111101110100110100011110000011011100100010010000100001100101100100011110001000000011101111000011011110010000000111001111101000010111001110100111110011110110000100100001111010110000111101000110110110 1000110000001011000000010011101111000001110100001100111100101111000100111011011001111101010001001100110101000001001101110100010001010111100100000010010011010100010101011100010110000001010001100101111111111010001101000101101111101101110011101111000101101000101101110111111111000111110111101011100111100111001100110011010110110000000000011110110000111111001010011110011011110100000110111000101011000011 1000000101011001101010111001010010111000101101010101010100010000111010111011011011111100000001111010110001100010101100100110001001111010011011101000110001001000100010101111000010101111111001000101011110110011100111000101110011001100011000101100101010000100001111100000100011010101111110100011010000111010000111001010100100100111101101001110100100000001111000010001101000001111110111100101111000111011 0001001111010101011111111010110001111100011110111011111110100011110001000011100101110100111110001010100010010000000111000101101000111011010100001001110101101111110110100110101000100011111101001100010001110100110100111001001100100110011100011110000010110011000111011110111010010100000100000110111111010010001110110000100000100001011100000100110101000100001110000010011011001010101001110101110001010010 1111010011111111000001011110010101010000110000000100111011101011001001011001010111100010100000010010011111011011000100001001010100011110100101101001111101100100110000101100101110010001101111100010010010001100001101110001110100000110011001010100101101001010101100100100000110110110111010010010000010100100000001111110011010101000111011110100101000000001000000010010011011000111001100111001011101001011 1001000011000101110101001010011111000100001110001001000101010011011010000011000101000111100001001100001110000000010011100010011101101001110101000101111000010001111110100101010111011101001001011110011000001000100010110110000001101111100001011000001111111001100001011110000001011110101001001111010111001111011100111100111110100100101011100010110000000000001001010111000100011110111100011101010111110001 1100101110011010110010011101111011100100111111101011111100101000110010111100100010000111000000000001111000010000111101110010110101110110010000101110100100001100000101111000011001110100100000000111011101101111011111100111110101001110100011110100001001111001100100110001101001010100001111000111111110111011111001101010100110110100100111010110000101110001111101001001000100010011001001010001011100011001 1100001000100010100100111001100101010110011001101011110110001101000111010111111011111101100001101101011000011101001010110010001100101010101100011010101000010010110101111001110100001010000110100110101101101101000011001100000010001001111001000010110110101100001100011110101101011101111100001101111001100101100000001110100011100001001010000000000001110000111110111111101001010110111101000000101111100101 0001001111000000100111100110101001001010011101010000011100000000110100101110110110011100011011101101110011101000110101100000011111110110010101110011010011101100101001011011101111101011011000000011101100001101011001011101001001111110001000101000011010110111011100100001111000011000101111000101111100001101111101101101011100100100001110000000100001001001000111101001011100010101000110010011011000100000 0110011110100011011001010111101011101100100010101101010110100010110011101110000000011100111111111001100001000110111000000010101010000100010010100110011010100101010101000101010110101001111011100100100110001111010001000001101101110110011011101011001111111111001110000110011100101101000000010111100100100010000100011101100001100101010001011011000000000111110111010000000001111101110001011101011001011110 1101000101110101110011010011010010010010001010101000101110101000000011011111100011011001011110000010110010011010100011001000101000011010000001000000110101000001101110101000001111000000101110101000100011101001011000111001001101010010011110111001100001010110110010101011001000110110101100001010101010100011111011110110110011100010101000000101010100110111101011011011100010111100110111000111110011001011 0000101010110110011111100011011100100001011101111101010001111110010110000110001101110110110011010100110001011010011110000001101000101011101101000000010000101011001100000011110110001111010110001011100000011010100011100000111100000001111001101111010100001010101010011001000110001010000111011110000101010101100100001000111000000110000010111010010111111010011111010101011001000100111001000001011111110011 0000010111000001100001011111101101111100010001011001110011010001111001111110110010111000101110000001111110011011110001101100110011110000001100110101010110001101110100010110000001011110111011001111101010110010110100101110001000011110100110011110101001010111111101011110101010010100010110110000010001100100011110110101000110000111110010001001110010011001001000101010001001010111111010110101010111111110 0010011101111010101011011011001111110011101000010111000111010001101110110101000101100011010011101000000010110000000010011011000011110000000101001101011010010110100010101100110101110111101101011101111000110011010010110100001001001100011000001111110100011000111010011001001111111011000011000110110010110110100111101111010111100000111001010001001101100001011110010100000110100110001100101000100001001000 0100000011000001100010000000001111010101111011011101100111001011000100000000110101100000101100111011001101001000110001101001111010001101101000110100011110001100110000100001101001000110011110111111000011100001011011101001111110001100010011111100111110001101101100000011111100001101100010011110001111100001101000100000001001001110001011110110101010111001000001010100101001111000110100111111101011011000 0000011101100100111011011001001100100101101010001000100001001100001110001011010111000010101110011100001111101110100111010111101010101101101111110110101111010100000100010010111010110000110111000000111001100010101110110000110101011001110100000001101111111000011001111111010101011000101000101001001100101101011110111101100100110110111100010100101000000001110110110100100001000111101111010000001111001000 0101111001010011100001010100101000000000111011110011001100000110100100010101101110011011101110011011011000111100100111001011111000011000011100001001010000000110001110111000101000100110011100111011001011011010011001100101110101001100000111010110001100100110101010011110000101000010110100011101000001110001010110101111000001000001100011010001010111011001111101000100100100011001100000111100101111111110 1011010001001010111001000000001011010110010000111111101110000000100100101000010100011001110000011111010000110001001110011100000001110111010010110001100010101111100010111101010000101010101001110001010011001111111000011100011011111101100111111010010101111110001010001101000111011010000001111111010110010000001000001010110001000100000000110011011001101100001011010001111101111110001100100110101010011101 1010100111001100001000110010110001011000111100001111000111101001100101110010011110010101000111110000100011101010010011111001010100011001101111011011000011001001011001010111011001100110100101101111100100011011110100100011110100101111011101111011001110101111101111010001010010000100110000010100001010000011110001011110000001000111000100100010000010000100101111000100100011011111100010110001001010101001 0110111000011011001100000110101010000101111010011000011110110101010100011110100000000100111100110111101000100010110011001111000011110111111100000111111011100110110111111010110111010010100100100110010110011011111111001111010011001000000101111001101100001101110000101111011101111001101101000000111110001011011101110101011001101001110100100011000111110000110010001011111000101101111111100000110001110010
cTrader AlgocTrader

cTraderでスクリプトを作る【サンプル:AutoFibonacci】

12/24/2020 3/24/2021

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

cTraderでもスクリプトは作れる

MT4ではインジケーター、EAの他にスクリプトというプログラムを作成することができます。スクリプトは実行したら特定の処理を行い、すぐに停止するというタイプのプログラムです。

cTraderではインジケーターとcBotしか作ることができず、一見スクリプトは作れないかのように見えますが、同じ機能のものはcTraderでも簡単に作成できます。

 

cBotとして作成すればいい

cBotを新規作成して、処理内容をOnStart()内に書き込んで、最後にStop()を呼び出してあげればもうできあがりです。(実際はStop()を呼ばなくても、OnBar()やOnTick()が空っぽであれば自動で止まるようですが、一応Stop()で止めておいた方が安心でしょう。)

cBotとして作るため、外部パラメータを持たせることも可能です。MT4でも同じようにEAとして作ることでパラメータを持たせることはできますが、MT4の場合は実行の度にパラメータ画面が表示されてしまうため、ちょっとしたスクリプトでは使い勝手が悪いのです。

 

使い方

普通のcBotと同じです。チャート左側ツールバーのアイコンから選んであらかじめパラメータを設定して、チャート上に配置します。実行したいときは右下スクリプト(cBot)名の▶ボタンを押すだけです。

cTraderの場合は、あらかじめパラメータ設定までしたcBotをいくつもチャート上に配置しておき、必要に応じて起動させることができるため、スクリプト実行とも相性がいいです。

特にパラメータ付きスクリプトの使い勝手なら、MT4よりもcTraderの方が優れていると言えるのではないでしょうか。

 

 

実際に作ってみよう

サンプル:AutoFibonacci

せっかくなので、ある程度使えそうなスクリプトを一つ作ってみましょう。

実行するとチャート上に自動的にフィボナッチリトレースメントを作成してくれるスクリプトです。

フィボナッチリトレースメントには基準点となる最高値、最安値が必要なので、どの期間で最高値最安値を探すかはパラメータで設定できるようにしておきます。

[Parameter(DefaultValue = 25)]
public int Period { get; set; }

最初からあるParameter部分を上記のように変更するだけです。Defaultは好きな値を入れてください。

次にOnStart()内に処理部分を書いていきます。

// --- 対象期間のbarsを抽出して最高値、最安値のインデックスを求める
var bars = Bars.Skip(Bars.Count - Period).ToArray();
var highestIndex = bars.Select((bar, index) => Tuple.Create(index, bar.High)).OrderByDescending(t => t.Item2).First().Item1;
var lowestIndex = bars.Select((bar, index) => Tuple.Create(index, bar.Low)).OrderBy(t => t.Item2).First().Item1;

LINQという機能を使ってるため、知らないとわかりにくいかもしれません。

まず2行目では全部のBarから最初の部分をスキップさせてPeriod本だけのBarを取り出して、bars名前をつけた配列にしました。
3行目では最高値のbars内のインデックスを求めてます。barsからインデックスと高値の組み合わせを、高値の大きい順に並び替えて、一番最初の要素のインデックスを取り出してます。4行目も最安値のインデックスも同様に取り出しています。
LINQを知らず、よくわからなければ、ここはとりあえずそーゆーもんだと思っておいてください。

続いて、フィボナッチリトレースメントを描くための始点と終点を設定します。

// --- フィボナッチリトレースメントの始点と終点を決める
double y1, y2;
DateTime t1, t2;
if(highestIndex < lowestIndex) {
    y1 = bars[highestIndex].High;
    t1 = bars[highestIndex].OpenTime;
    y2 = bars[lowestIndex].Low;
    t2 = bars[lowestIndex].OpenTime;
} else {
    y1 = bars[lowestIndex].Low;
    t1 = bars[lowestIndex].OpenTime;
    y2 = bars[highestIndex].High;
    t2 = bars[highestIndex].OpenTime;
}

ここはわかりやすいですよね。最高値と最安値のどちらが先に来るかにより、始点と終点が入れ替わるため、場合分けして始点(t1,y1)と終点(t2,y2)を設定してます。

あとは描くだけ。

// --- フィボナッチリトレースメント描いて、表示レベルを調整し、編集可能にして終了
var ff = Chart.DrawFibonacciRetracement(Guid.NewGuid().ToString(), t1, y1, t2, y2, Color.Yellow);
var visibleLevels = new double[] { 0, 38.2, 50.0, 61.8, 100 };
foreach (var level in ff.FibonacciLevels) level.IsVisible = visibleLevels.Contains(level.PercentLevel);
ff.IsInteractive = true;
Stop();

2行目のDrawFibonacciRetracementで描く際の名前は他とかぶらないようにGuidを取得して文字列化して使ってます。とりあえずかぶらない文字列が欲しいときはGuid.NewGuid().ToString()と覚えてしまっていいです。色は適当に黄色にしてますが好きに変えてください。

描いた後は、3,4行目でレベル表示の調整をしてあります。デフォルトだとやたらと線が表示されてみにくいので。
ちょっとわかりにくいかもしれませんが、ChartFibonacciRetracementの持つFibonacciLevelsのうち、上記visibleLevels配列に値が含まれてるものだけ、IsVisibleをtrueにする、という処理をしています。(→参考:FibonacciLevel
見える線を変更したい場合はvisibleLevels内の数値を編集してください。(ここに指定できるのはあらかじめ設定してある数値に限ります。チャート上のフィボナッチリトレースメントを右クリックで確認できます。)

5行目は今描いたフィボナッチリトレースメントをマウスで編集可能にしています。この1行がないと、cBot停止と同時に描いたものが消えるため、見かけ上なにも起きません。

6行目でcBotを止めて終了です。

 

コード全体

using System;
using System.Linq;
using cAlgo.API;
using cAlgo.API.Indicators;
using cAlgo.API.Internals;
using cAlgo.Indicators;

namespace cAlgo.Robots
{
    [Robot(TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)]
    public class AutoFibonacci : Robot
    {
        [Parameter(DefaultValue = 25)]
        public int Period { get; set; }

        protected override void OnStart()
        {
            // --- 対象期間のbarsを抽出して最高値、最安値のインデックスを求める
            var bars = Bars.Skip(Bars.Count - Period).ToArray();
            var highestIndex = bars.Select((bar, index) => Tuple.Create(index, bar.High)).OrderByDescending(t => t.Item2).First().Item1;
            var lowestIndex = bars.Select((bar, index) => Tuple.Create(index, bar.Low)).OrderBy(t => t.Item2).First().Item1;

            // --- フィボナッチリトレースメントの始点と終点を決める
            double y1, y2;
            DateTime t1, t2;
            if(highestIndex < lowestIndex) {
                y1 = bars[highestIndex].High;
                t1 = bars[highestIndex].OpenTime;
                y2 = bars[lowestIndex].Low;
                t2 = bars[lowestIndex].OpenTime;
            } else {
                y1 = bars[lowestIndex].Low;
                t1 = bars[lowestIndex].OpenTime;
                y2 = bars[highestIndex].High;
                t2 = bars[highestIndex].OpenTime;
            }

            // --- フィボナッチリトレースメント描いて、表示レベルを調整し、編集可能にして終了
            var ff = Chart.DrawFibonacciRetracement(Guid.NewGuid().ToString(), t1, y1, t2, y2, Color.Yellow);
            var visibleLevels = new double[] { 0, 38.2, 50.0, 61.8, 100 };
            foreach (var level in ff.FibonacciLevels) level.IsVisible = visibleLevels.Contains(level.PercentLevel);
            ff.IsInteractive = true;
            Stop();
        }

        protected override void OnTick()
        {
            // Put your core logic here
        }

        protected override void OnStop()
        {
            // Put your deinitialization logic here
        }
    }
}

テンプレートで出力されてるOnTick()など余計な部分は消してもかまわないのですが、今後機能拡張することも考えて残しておきます。

一応algoファイルもあげておきます。

 

 

あとはご自由に

自分で作っておけば、思い立ったときに好きなように機能を変えることもできます。

例えばチャート上に見えてる期間で自動的にPeriodを設定するとか、フィボナッチエクスパンジョンも同時に書くとか、Stop()で止めずに、起動しっぱなしで自動的にリトレースメントを更新していくようにするとか。

自由に編集して、自分仕様のプログラムを作ってみてください。


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

新しいコメント

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

cTrader's Life

© 2025 ajinori