I know how to define OCO Sell order with Limit (upper, Target Profit price) and Stop Loss (lower limit) using ToS UI. They serve me well in my OnDemand and Paper trading, as before the trading day begins I walk through my current opened positions and add manually OCOs for each stock.
However, I'd like to automate OCO definition in ThinkScript, as most of the days I have multiple stocks opened. Setting of the OCOs for multiple opened position before every new trading day becomes tedious routine that I'd like to automate.
What I need for the start is the ThinkScript code/syntax for the OCO sell order in my case. I looked around but did not find what I needed. I tried ChatCPT but it gave me the code that editor complains about with "No Such Constant: OrderType.LIMIT_SELL"...etc.
Thank you for your help!
MS
However, I'd like to automate OCO definition in ThinkScript, as most of the days I have multiple stocks opened. Setting of the OCOs for multiple opened position before every new trading day becomes tedious routine that I'd like to automate.
What I need for the start is the ThinkScript code/syntax for the OCO sell order in my case. I looked around but did not find what I needed. I tried ChatCPT but it gave me the code that editor complains about with "No Such Constant: OrderType.LIMIT_SELL"...etc.
Thank you for your help!
MS