Hi All,
Can you please review my script below to submit/trigger a conditional order when the Option's current price (mark price) is 15% below the high price. The intention is to mimic a Trailing Stop Order. I want to go this scripting route because ThinkorSwim rejects an OCO order that contains a Stop Order and a Trailing Stop Order.
I want to attach the script as a Study (1 minute chart) in the Order Rules applet:
def highPrice = if high > high[1] then high else high[1];
plot signal = if (bid + ask)/2 <= (highPrice * 0.85) then 1 else 0;
Please note I want to use this for day trading. This is not for back testing.
Will the above script work, or can you suggest something better?
Thanks!
Can you please review my script below to submit/trigger a conditional order when the Option's current price (mark price) is 15% below the high price. The intention is to mimic a Trailing Stop Order. I want to go this scripting route because ThinkorSwim rejects an OCO order that contains a Stop Order and a Trailing Stop Order.
I want to attach the script as a Study (1 minute chart) in the Order Rules applet:
def highPrice = if high > high[1] then high else high[1];
plot signal = if (bid + ask)/2 <= (highPrice * 0.85) then 1 else 0;
Please note I want to use this for day trading. This is not for back testing.
Will the above script work, or can you suggest something better?
Thanks!