I would like to use a script to create a closing order for an option based on the %P/L relative to the number of days that the trade has been open and the original DTE when the trade was placed. The function would go something like this:
Percent Profit * Initial DTE / Days Elapsed = X
Execute order if condition X >= Y, where Y is some arbitrary value set by the user.
I am an absolute newbie at ThinkScript and have basic knowledge of scripting in general. As I was looking through some of the documentation in the Learning Center, I couldn't figure out which Date and Time functions would allow me to accomplish this. Any suggestions or guidance is greatly appreciated.
Percent Profit * Initial DTE / Days Elapsed = X
Execute order if condition X >= Y, where Y is some arbitrary value set by the user.
I am an absolute newbie at ThinkScript and have basic knowledge of scripting in general. As I was looking through some of the documentation in the Learning Center, I couldn't figure out which Date and Time functions would allow me to accomplish this. Any suggestions or guidance is greatly appreciated.