Welcome to the forums. Please use the ‘Insert PRT Code’ button when posting code in future poststo the forums as it makes it easier for others to read. I have tidied up your post for you. 🙂
Your code is short of some ENDIF’s and a THEN but also it is not possible to draw in the future. This will draw a vertical line every time 210000 bar occurs but not into the future: