This is part of a trading algo. How would you go about it?


(Hopefully this pic shows up)

So i’m trying to make an algo but it’s a little too advanced for what i know so far. If you see the excel cells in the pic each cell going across is the next month of options on a stock. The 3 cells going down are different options. What i’m telling it is each cell is valuing the time value between that one and the one before it. So it doesnt show August but its assume thats the first month. If we just look at the 15 line its saying that november is worth .02 more than aug…andDec22 is worth .30 more than JUN…So Dec22 is worth all of them added together back to wherever…Dec22 is worth .58 more than JAN… In the end then if any of the months line up less than my values it will autmatically buy the spread. Does anyone have any idea how something like this would look in a script?

I’d recommend writing this out in pseudo code first to get some idea of how you would accomplish it.

The hardest part of this program I believe would be how you are getting you input, is it coming from a file? A database? Entered manually?

After that the majority of your program should be basic algebra. If you have the numbers you just need to compare them and see if they are what you want.

1 Like

You can consider using matrices. And like @8-bit-gaming doing it by hand first is key.

1 Like