Label to display current price of debit spread


Category:
0
0

Hi Pete,

I want to know if it’s possible to create a “Chart Label” that will display the current/active net price of an option contract, let’s say I have a Spread on, and I want to quickly see in the label, what the current Mark/Net Price of the spread is. I assume you will have to pull this from the Working orders tab under Activity and Positions on TOS?

Let me know if the question make sense.

Thanks

Marked as spam
Posted by (Questions: 5, Answers: 16)
Asked on January 29, 2019 2:45 pm
178 views
0

Pete, I really appreciate your time in working this one out for me. You are extremely generous with your time and knowledge, and I just want to say that it’s greatly appreciated. The Label works just as I wanted!
Have a great day!

( at February 4, 2019 11:18 am)
0
Private answer

This data is not available to the thinkscript language.

Update: After hashing out more details in the comment section of my original answer we have arrived at a final specification. The question title has been updated to reflect the context. The code below will display a chart label in the upper left corner of the chart which will show the current mark price of a debit spread. (that's one long call and one short call that results in a net debit to your account when purchased). User inputs are included and you must enter the OPRA code for each option contract in the debit spread.

input longCall = ".SPY190315C271";
input shortCall = ".SPY190315C281";
def shortCallMark = close(shortCall, pricetype = "Mark");
def longCallMark = close(longCall, pricetype = "Mark");
def diff = longCallMark - shortCallMark;
AddLabel(yes, Concat("Debit Spread: ", diff), Color.WHITE);

Marked as spam
Posted by (Questions: 37, Answers: 4118)
Answered on January 30, 2019 10:33 am
0

Thanks for your answer.

( at January 30, 2019 10:40 am)
0

Pete, what about using the Theo price of a given strike price (vertical spread specifically strike price) Does thinkscript allow access to this data?

Thanks

( at January 31, 2019 4:47 am)
0

The only way this can be achieved is to require the user to manually enter the OPRA code for each option in the spread.

( at February 1, 2019 10:03 am)
0

If I only have to enter the OPRA code once during the duration of the trade, and it will appear as a label in the chart, then that’s fine. I can assume I would need both codes for each leg, in the example of a Spread?

Question, I know how to find the code, but wanted to know if there is an easier way to capture it, i.e. It will be good that at the time of selecting my strikes for my spread, before hitting confirm and send, I could see it in the order entry summary. Let me know your thoughts and the code for the label.

Thanks again!

( at February 1, 2019 12:53 pm)
0

Ok, so we have refined the specifications to include user inputs to place the OPRA codes. How many legs? What sort of spread are we dealing with here? Straddle? Strangle? Credit spread? Debit spread? something more exotic?

Easiest way to get the OPRA code. Right click the row for the option you want to include. From the menu that pops up select Copy . The actually contain the OPRA code you will be copying.

( at February 2, 2019 10:07 am)
0

Nothing exotic Pete, I keep it simple, mechanical and boring…lol for this use case it will be Debit Spreads 10 wide on SPX. Always on weeklies for Intraday only.

Thanks for your suggestion to capture the OPRA code.

( at February 2, 2019 11:53 am)
0

I have updated the question title and my answer to reflect the final specification of a debit spread.

( at February 4, 2019 9:45 am)
0
Pete, this label has been great for me, so thanks for the time and suggestions. In working with this label for several months, I realize I could enhance it to include a second label that denotes the actual Mark price difference (actual profit). Today the code is tracking the value of the spread, and I would like to track the value of the trade, in other words. i.e. spreadValue - debitPaid = tradeValue So I will provide the debit paid amount as Input, and will expect to see two labels side by side, first one being the original (spreadValue) and the new one being (tradeValue).
( at July 4, 2019 5:20 am)
0
New requests should be submitted as a new question in the Q&A forum.
( at July 4, 2019 9:22 am)