What I would like to achieve:
AAPL below $100 buy 10 contracts of [defined option] for $1.
My current attempt is via a saved 1st trigger 3-OCOs template w/custom studies.
4. third OCO
I'm still learning the thinkscript, but it seems like my values/functions just don't work in OCOs, i can't seem to nail down the logic on how to write it. Any guidance would be super helpful!
Would it just be best to use the API...?
- Enter a call/put position when a specific price condition is met on the underlying stock
- Create a OCO when position is opened
- If market price of contract is -10% of entry price, close the position
- If market price of contract is +10% of entry price, close 10% of position
- If position is still open, create a OCO
- If market price of contract is at entry price, close the position
- If market price of contract is at +30% of position, close 20% of position
- If position is still open
- create a trailing stop loss at -20% of current price
AAPL below $100 buy 10 contracts of [defined option] for $1.
- If value is $0.90 close position
- If value is $1.10 sell 1 contract
- If value is $1 close position
- If value is $1.3 sell 2 contracts
- Set a trailing stop loss for -20% of current value($1.3)
My current attempt is via a saved 1st trigger 3-OCOs template w/custom studies.
- Buy order w underlying price conditional
- first OCO
- stop limit at -10% of avg price, sell order of 100%
- stop limit +10% of avg price, sell order of -10%
- second OCO
- stop limit at average price, sell order of 100% w/custom study
- stop limit at +30%, sell order of 20% w/custom study
Code:
def quan = GetQuantity();
plot "e10" = quan > 0 and EntryPrice() * 1.1;
- trailing stop at -20% w/custom study
- sell order at breakeven (should be unreachable) w/custom study
Code:
def quan = GetQuantity();
plot "e10" = quan > 0 and EntryPrice() * 1.3;
I'm still learning the thinkscript, but it seems like my values/functions just don't work in OCOs, i can't seem to nail down the logic on how to write it. Any guidance would be super helpful!
Would it just be best to use the API...?