thetabrent
New member
Hello All...long time coder but brand new to ThinkScript 
After doing some research and playing around a bunch, it's unclear if it's even possible to do what I want, so I thought I'd post here and let the experts offer their thoughts!
Here's what I want to do:
I'm using a variation of the iron condor, and the strategy involves selling options and continuously checking the mark price of an option, and taking action if the increase in value mark exceeds 4x the premium collected. It's easy enough to do this manually by looking in the mark column on the Monitor screen, but I'd love to find a way to put that number (current mark/premium) on the screen to make it much easier to manage.
As an example, let's say I'm trading SPY and the market price is 620, and I'm selling a CALL at 630 and receiving a premium of $0.05. What I want the study to do is divide the current mark by the original premium, and put that number on the screen. As SPY rises, that CALL option becomes more and more valuable; in this example, it might be that SPY rises to 625, and mark on the option goes up to $0.20; I'd want to put "4x" on the screen (since the original premium of $.05 multiplied by 4 = $.20).
Is this even possible?
From what I understand, it is not possible to iterate through open positions in ThinkScript. However this strategy is extremely low volume (usually just the two sides of the iron condor plus stop losses), so it is acceptable (though not desirable!) to manually code both the premiums collected and the strike prices of the CALL and PUT each day before running the script. Is this workable?
My thought would be that maybe if we start with the GetOptionATM and then GetNextITMOpen,, we can find the option (the one we sold) by checking the strike price against what is manually coded in? But I hope there an easier way!?
And then maybe use something like this to get the current mark for that option?
input priceType = PriceType.MARK; plot MarkPrice = close(priceType = priceType);
Obviously we would have to do this twice, once for the call side and once for the put side.
Hope that makes sense...please ask if there's more info I can provide here!
thanks so much for your help...
-Brent
After doing some research and playing around a bunch, it's unclear if it's even possible to do what I want, so I thought I'd post here and let the experts offer their thoughts!
Here's what I want to do:
I'm using a variation of the iron condor, and the strategy involves selling options and continuously checking the mark price of an option, and taking action if the increase in value mark exceeds 4x the premium collected. It's easy enough to do this manually by looking in the mark column on the Monitor screen, but I'd love to find a way to put that number (current mark/premium) on the screen to make it much easier to manage.
As an example, let's say I'm trading SPY and the market price is 620, and I'm selling a CALL at 630 and receiving a premium of $0.05. What I want the study to do is divide the current mark by the original premium, and put that number on the screen. As SPY rises, that CALL option becomes more and more valuable; in this example, it might be that SPY rises to 625, and mark on the option goes up to $0.20; I'd want to put "4x" on the screen (since the original premium of $.05 multiplied by 4 = $.20).
Is this even possible?
From what I understand, it is not possible to iterate through open positions in ThinkScript. However this strategy is extremely low volume (usually just the two sides of the iron condor plus stop losses), so it is acceptable (though not desirable!) to manually code both the premiums collected and the strike prices of the CALL and PUT each day before running the script. Is this workable?
My thought would be that maybe if we start with the GetOptionATM and then GetNextITMOpen,, we can find the option (the one we sold) by checking the strike price against what is manually coded in? But I hope there an easier way!?
And then maybe use something like this to get the current mark for that option?
input priceType = PriceType.MARK; plot MarkPrice = close(priceType = priceType);
Obviously we would have to do this twice, once for the call side and once for the put side.
Hope that makes sense...please ask if there's more info I can provide here!
thanks so much for your help...
-Brent
Last edited by a moderator: