Tag Archives: Black-Scholes

Quants need to use Finance specific type models such as Black-Scholes with algo require streaming

Lots of ‘quants’ rely on the old reliable Black Scholes model for options pricing and forecasting. This question came about compairing it to a form of machine learning. Is it possible that machine learning will exceed or already has? It seems time only will tell in a few months as I will start researching in the cold hibernating months. Gee we got through this some how.

Here is a Quora question posted on my site:

https://www.quora.com/Why-do-quants-need-to-use-Finance-specific-type-models-such-as-Black-Scholes-and-others-rather-than-using-deep-learning-and-traditional-machine-learning-techniques

I also made another 38 mnute. Here is what I posted yesterday:

Demo of live crypto currency positions profit and loss algo trading

 

I just did a 38 minute on digging into how certain positions can be profitable or losing money, I go so deep here as I need to track a way to close out the positions for profit and loss measurement. The logs I generated are very good to see the life cycle of the position. You see see if position goes profitable and see how fast it can go negative. This is the advantage of using these type of logs. In fact, I may do a day webinar for my Elite members for this.

This Tuesday, I have this arrangement:

Webinar event: Build a baby automated trading system with algos require streaming

 

This is a very typical conversation I have with online strangers who want to control their own future. This will help those automated trading with altos require streaming.

A Twitter followed opened up with this conversation which created the idea to do this webinar topic.

I am thinking it may be better to pay someone to do the programming? I just don’t have the time. Do all algos require streaming from IQFEED or a third party service. I am looking at kairos have you heard of the program and any thoughts/ recommendations?

Ok I am very motivated . Sounds like python is the way to go. I have tried IBridgePy but didn’t get Far….My system is very simple .

Understanding your own coding is most predictable. I have many folks who lost thousands dues to bad programmers. This is what I have experienced among folks like yourself.

I am thinking it may be better to pay someone to do the programming? I just don’t have the time. Do all algos require streaming from IQFEED or a third party service. I am looking at kairos have you heard of the program and any thoughts/ recommendations?

Thanks. How long would you say it will take someone like myself to get a system up  and running and what services do you offer to get me to where I need to be?

It depends on your motivational level. It could take a couple of months with Python. If you try with a lower level like C++ or Java, it would be probably years but most people give up on it.

Here are some topics for the event

Understanding your own coding is most predictable. I have many folks who lost thousands dues to bad programmers. This is what I have experienced among folks like yourself.

  1. Here is what I will cover to build your ‘baby algo trading system’:
  2. 1. It depends on your asset class and broker of choice.
  3. 2. Sample way to download data with 3rd party solutions ranging from Excel to Java ion source source scanners.
  4. 3. How to use a Python package to do quick analysis using a popular technical analysis library
  5. 4. Analysis the results to assess trading order decisions
  6. 5. Which brokers with packages to execute orders

This will take place:

Note that this takes place on Tues Sep 4 dues to Labour Day!

 

You are invited to a Zoom webinar.
When: Sep 4, 2018 11:00 AM Eastern Time (US and Canada)
Topic: My WebinarWebinar event: Build a baby automated trading system with algos require streaming

Please click the link below to join the webinar:
https://zoom.us/j/309454798

Or iPhone one-tap :
US: +16465588656,,309454798# or +16699006833,,309454798#
Or Telephone:
Dial(for higher quality, dial a number based on your current location):
US: +1 646 558 8656 or +1 669 900 6833
Webinar ID: 309 454 798
International numbers available: https://zoom.us/u/xPHi0HZj

NOTE I now post my TRADING ALERTS into my personal FACEBOOK ACCOUNT and TWITTER. Don't worry as I don't post stupid cat videos or what I eat!

Black Scholes Python Code Demo with Greek Analysis for Call or Put option

Black Scholes Python Code Demo with Greek Analysis for Put or Call option

 

Earlier this week I focused a lot on the Black Scholes formula for potential options trading. As I posted some lessons for my Quant Elite members, I started to realize how diverse this equation can really be. In fact, I made an entire video with working source code available.

 

Check out my video here with source code you can download

 

I am on my very last video for the UC Davis course on learning futures and options trading. For me, this is a critical step to pick up the knowledge for building foundation on a new data analytic system that will be part of my trading system. As you can imagine, that is pretty critical for success.

 

As I have been posting all along my lessons learned on pair trading and options/futures foundation, I have one last step which is just as critical starting next week. This includes FX from a global macro-economic point of view. This is the last step to close out the circle on this entire trading system minus the execution.

 

In coming weeks, I will be teaching the first phase of this system as I finish up the infrastructure building blocks over the next month. This of course is available for all my Quant Elite members with LIVE lessons every Tuesday. Also source code has been made available as well which is in Python. In coming weeks, I will be teaching the first phase of this system as I finish up the infrastructure building blocks over the next month. This of course is available for all my Quant Elite members with LIVE lessons every Tuesday.

 

Get immediate access here

 

See full benefits here of this course for this

 

Important note: As I strongly hinted at this before, this strategy code may be removed in coming months.

 

Thanks for reading

Bryan

 

NOTE I now post my TRADING ALERTS into my personal FACEBOOK ACCOUNT and TWITTER. Don't worry as I don't post stupid cat videos or what I eat!

Black Scholes Python Code Demo with Greek Analysis for Put or Call option

Black Scholes Python Code Demo with Greek Analysis for Put or Call option

A quick simple demo that finally meets my goals

Download corrected source code BlackScholes

http://janroman.dhis.org/stud/I2014/BS2/BS_Daniel.pdf

Join my FREE newsletter to learn more about how options impact your automated trading

NOTE I now post my TRADING ALERTS into my personal FACEBOOK ACCOUNT and TWITTER. Don't worry as I don't post stupid cat videos or what I eat!

Black scholes continued with Delta effect

Black scholes continued with Delta effect

More critical tools to help your options trading execution decisions

Join my FREE newsletter to learn more about this options trading which will be automated 

Download images here: delta

Black Scholes formula is used widely to price financial assets basically derivatives. In our case for using options on futures. We focus on Delta fact where Delta measures change in premium with the change in futures price.

Diagrams can use to explain the Greek components without the actual formula. This is the Delta effect in the attached image. This is an important concept because once we hedging with options it is possible to adjust the number of options positions you hold to account for the effect Delta effect we have more than one. For example, if you hedge with the futures contract and you’re looking for a hedge ratio of one, then you try to match the futures position with the cash position. If you have 5000 bushels of corn, use one futures contract because it matches the optimal hedge but you may want to deviate from it. Try to get as close to one as possible. You pick one futures contract. If you choose an option edge instead of futures contract, option premium only move in tandem with with the underlying futures price if the Delta is one. If the futures price moves 10% the premium will move  10% if the delta is one. If the delta is 0.5 futures price may move 10% of the premium will only move 5%. When hedging with options you may get left behind if you have delta with a very low percent because the futures price can change the spot price changing, but the value of the option may not change. This is the premium.

If you take the reciprocal of the Delta, it is .5 then choose 2 option contracts for every futures contract. If you have 5000 bushels of corn we would have one futures contract since it is 5000 bushels and we would have 2 option contract. The Delta is also important for speculators because if you’re buying options, you’re predicting the price to rise or fall, if the prediction is correct but the premium does not change. You will be disappointed.   If you predict the price of gold will decrease this week and you buy a put option, at the end of the week the premium has hardly changed you will be disappointed. You are right about the price move but the premium did not change, the value of your option did not change. It would only happen if the Delta is very low. If you buy an option very low that was out of the money, you could see the market moving but the premium does not change you will not be able to profit from the move. This is why speculators are interested in the Delta. Hedgers  are interested in the Delta since the hedge position will be one over the Delta for every unit underlying spot.

Another way to show this is through a supply demand diagram in the attached images. This will show volume of options that are purchased by the buyers or  sold by the writers. Writers are offered  the supply curve while demand willingness to pay by the speculators. We have the volume of the futures contracts written plus we have the price of the premium on the other axis. The higher the premium holding everything else constant, the greater the number of contracts are willing to supply. The higher the premium the lower tha demand will be on behalf of speculators. Remember there is a diagram for a box on theoretical range For calls and puts premiums where you have minimum and maximum Price. Saw the maximum price for call was the futures price. This is the most irrational buyer will pay for call option is the futures price. As a result the demand curve will hit the supply curve at the futures price since no one will pay more than that. You will have an equilibrium point a point e. This equilibrium gives a premium of the market on the volume on a given day. We are now interested in the Delta which captures the change in the premium when the future Price changes.

Let’s say the future price increases, there is a maximum willingness to pay is the futures price. If the futures price rises the willingness to pay is higher so the intercept on the demand curve has to shift it up. The demand curve shifts to the right in a parallel fashion. At the same time the supply curve will change because the writers of the option are assessing the probability as to whether the option is in or out of the money. If it moves into the money, the writer starts to lose profit where the call option with a fixed strike price. As a future price increases. Given that it is a call option for the fixed strike price, as a future price increases while out of the money, the strike price will be above that the futures price for a call. As a future price moves closer to the money, the rational writers of the option well since the futures price increased, for any given premium they want to hire the normal rate. The probability of this option moving into the money is now increased. You will have a left rotation of the supply curve with the right shift in the demand curve. You’ll move from point E of the equilibrium premium P1 with E2. Higher future price will lead to a higher premium in the case will call option. The Delta will therefore be positive. The Delta will range in value from in value from 0 to 1 if positive

This diagram help so will show premium on a call option rises because there’s a shift in the shift in the demand curve and a rotation of the supply curve.

 

If the futures price falls, does the Delta become negative? This is not true for a call option since you just reversed course of the above example.   If it falls the demand curve will shift down or left, the supply curve will rotate to the right. The man curve will shift left since the futures price Will fall. The supply curve rotates right since it is out of the money, it will move further out of the money. The writers are willing to write more options or the Same out for a lower premium.   We will have a fall in the premium as the fall in the futures price. It will still be positive. With a call option for both positive going in the same direction.

 

Referred to the lambda effect diagram in The attached images

 

There’s also the volatility factor which is part of the Black scholes formula. This is associated with Lamda. You can estimate the volatility historically. Or you could use the formula to compute the implied volatility if you use the market premium into the formula. In the diagram you have the same situation with an out of the money call option, you have to supply demand curves which is exactly as in the previous example. Intercept on the demand curve hits the vertical axis at The futures price because that is the most out of buyer is willing to pay. Solid lines referred to the current situation with an equilibrium in the price P1. If There is an increase in volatility look in the example of crude oil. Volatility will rise if there is uncertainty in the marketplace. You start with the premium of P1 as volatility has increased.  If you have buyers of the call option which is out of the money, as volatility increases, volume of purchases of Q that the Demand curve will rotate to the right. This means that buyers are willing to pay more for a higher premium for the same volume. With a fixed-rate strike price no change in the future price, it will move a lot more. you have uncertainty in the marketplace, as a buyer you’re willing to pay for a higher premium because of the additional volatility as it moves into the money. The writer of the option will sell the call option for this level. If the premium is two dollars in and out of money option and if the volatility goes up, there is a greater probability that the option will move into the money they will increase the premium now. That is why the supply curve will rotate to the left while the demand curve rotates the right. There’s a new equilibrium of E2 from equilibrium eat one is a premium has increased.

As before when the volatility increases, the premium will increase as well. This is the economics of these increases.

 

The third important greek component is theta affect. Theta measures change in premium with the change in time to maturity. If you look at one strike price December February June options, you are looking at more distant months. The time of maturity increases. You observe a different theta. Look At the economics and attached diagram of a call option in the money. We have an initial equilibrium a point E as in previous examples. Supply meets demand. We Allow decrease The time of maturity. We do not change the volatility or the futures price. Supposed we start a week ago over the previous week, the future price has not changed orThe volatility has not changed. The only thing that has changed is we are closer to maturity or a decrease in time to maturity. As a result the premium will fall. We have to scrub options as a decaying asset. As the value erodes towards maturity. Reason is we have a rotation to the right in the supply curve  and they left rotation in the demand curve. For a given volume the demand curve rotate in a given Q. The option is for out of the money. If you are out of the money closer to maturity, you may have paid two dollars for the premium

But you’re not willing to pay the same premium so time is on your side but it is out of the money. An event that may push this into the money, you are willing to pay less for the option a week later. If you know it could move into the money, as the week goes by the probability of it being in the money his less. So for any given Q, you’re willing to pay a lower price on the premium.

For the writer of the option, you will have to reduce the premium. You’re willing to sell it at a lower premium because time is marching down for less time to maturity. The lower the probability of that moving into money. This is good for you as a writer as you don’t wanted to move into the money. Both the writer and the buyer willingness is lower to execute a trade at a lower price.

 

Referred to value of Delta attached image

For speculatorThe Delta will indicate the premium will change. There’s a trade off when the out of money option is really cheap since you’re not paying much for it. The Delta will be low. As a price may change the premium will not change. If you have a deep out of the money option then the Delta will be close to zero. These will have a low probability of moving into the money. Even if the price does change it will not be enough to put it into the money. As it moves into the money the Delta will range between zero to .5. When it is at the money, the Delta is a .5. When an option at the money given the efficiency,  is a 50-50 chance that It could move in the money. So if the futures price increases by $10 then the premium rise by five dollars. It is one half of the change in price. Once you moved into the money, Delta will exceed .5 and if you’re deep in the money it will be close to one. You can use the Delta as a probability that an option will stay in the money. If it stays out of the money in the Delta zero, it is a zero probability that it will stay in the money.

 

If you buy an option today and it has a certain delta of .5, does it remain constant? It will change where the gamma affect records the Delta. It will change daily but if it is in the money the change is relatively small. It gets really interesting when it is at the money where you’ll see the wide swings. You will see more variation of the money.

 

NOTE I now post my TRADING ALERTS into my personal FACEBOOK ACCOUNT and TWITTER. Don't worry as I don't post stupid cat videos or what I eat!

Difference between Black Scholes vs GARCH?

Difference between Black Scholes vs GARCH?

Question from someone via my newsletter:

I have developed and implemented a method for computing volatility using  black&scholes with (strike, maturity, call prices, interest rate and constant return on asset), i have simulated data, my question concerning data : in general strike and maturity have a vector with 8 rows, so how can i use historical data to apply them for my method? for example concerning garch model we can compute the volatility using return of historical data then we estimate the parameter of model by maximum likelihood function.
this is the formula of volatility : sigma = sqrt( (dc/dt -(r-q)(c-k*dc/dk) /  k^2/2 d^2c/dk^2)
what is the difference between volatility of black scholes and volatility of Garch Model? is it the same result?
I am no math expert nor do I ever claim to be, I use Black Scholes to calculate an instrument’s implied volatility. I have not played a whole with GARCH at this point but appears to be something very different. Even in Matlab, they are both very different so check out their help for each.
Black Schole for IV:
http://www.mathworks.com/help/finance/blsprice.html
GARCH for forecasting as explained here:
http://www.mathworks.com/help/econ/cvm.forecast.html
Hope this helps
From Dr Paul Cottrell
BSM is an option pricing model utilizing a constant volatility methodology in its purest form. Practitioners use a moving window of volatility to update the BSM. A certain method to forecast out volatility is using a varying array of GARCH types. My books on forecasting and risk management cover this topic. In short, GARCH types are to forecast out volatility based on previous volatility. When solving for volatility for BSM, one gets the implied volatility to match to the current option price. IF you do not know the current option price one would have to use the “current” volatility or some average thereof.
NOTE I now post my TRADING ALERTS into my personal FACEBOOK ACCOUNT and TWITTER. Don't worry as I don't post stupid cat videos or what I eat!

Here all the possible derivatives from Black Scholes derivatives for options trading

Here all the possible derivatives from Black Scholes derivatives for options trading

From a newsletter subscriber:

Anyway, when we met last time you indicated you were interested in a reference on options trading.  I found this website below that covers the derivation of the Black-Scholes equation.

http://en.wikipedia.org/wiki/Black%E2%80%93Scholes_equation

Join my FREE newsletter to learn more about options trading 

 

 

NOTE I now post my TRADING ALERTS into my personal FACEBOOK ACCOUNT and TWITTER. Don't worry as I don't post stupid cat videos or what I eat!

Can Matlab Coder to C++ work with GARCH or Black Scholes application with Econometrics toolbox?

Can Matlab Coder to C++ work with GARCH or Black Scholes application with Econometrics toolbox?
Question:
Do you know if we can compile an application using functions in the econometric toolbox? For example a GARCH or Black Scholes application?

Answer:
Are you referring to Matlab Coder? If so, only a subset of Matlab functions are supported but typically 
not including GARCH or Black Scholes. If you are deploying with Builder NE, all Matlab functions are
 supposedly supported.

Join my FREE newsletter if you want to learn how to apply Matlab to your trading
NOTE I now post my TRADING ALERTS into my personal FACEBOOK ACCOUNT and TWITTER. Don't worry as I don't post stupid cat videos or what I eat!

simple Matlab code for Black Scholes: d1 = (log(S / X) + (b + v ^ 2 / 2) * T) / (v * T^0.5);

 

I have simple Matlab code for Black Scholes:

 

b=r;    d1 = (log(S / X) + (b + v ^ 2 / 2) * T) / (v * T^0.5);    d2 = d1 – v * T^0.5;

I question:

v * T^0.5)

Is this not supposed to be

 

d1=(log(S/X)+(r+v^2/2)*T)/(v*sqrt(T));

d2=d1-v*sqrt(T);

 

Who can set me straight?

NOTE I now post my TRADING ALERTS into my personal FACEBOOK ACCOUNT and TWITTER. Don't worry as I don't post stupid cat videos or what I eat!

Some history on the Option pricing with Black-Scholes for quants

Some history on the Option pricing with Black-Scholes for quants

Some highlights from this quick and dirty article:

If there was no inventory at hand, a market maker knew that they should hedge their position using the underlying asset. Nelson describes this concept already in 1904. Later the concept is generalised and extended by Thorp from ‘at the money hedge’ to ‘off the money hedging’, essentially formulating the concept of ?-hedging.

Thorp went on to make a small fortune by discovering risk neutral probabilities and putting the concept to practice in the Las Vegas casinos. He also went on to discover the formula now know as the Black-Scholes equation. Thorp formulated the equation, but didn’t have a derivation at first. It was Black and Scholes who added the dynamic hedging concept used to make a portfolio of a derivative and its underlying asset risk free, allowing for the derivation of the equation.

Later Bachelier (1900), Einstein (1905) and finally Wiener (1923) developed a rigorous theory and the mathematics to describe Brownian Motion. The resulting theory is essential for the derivation of the Black and Scholes formula, which uses Brownian Motion to model asset prices as stochastic differential equations. To work with these equations we need Ito calculus. Ito (1951) showed how given a stochastic differential equation for some independent random variable, one can derive the stochastic differential equation of a function of that variable.

Some quant algo highlights:

Can we find a choice of ? that eliminates all the dX terms? Yes, choose:

[6]?

Something amazing happens using this choice of ?, the ?-term also disappears! Implying that
we no longer face the difficult task of coming up with a number for stock return (?).

. We are left with a risk free portfolio, since the equation no longer contains a dX term.

Quite nice explanation. Get more info on this great article at:

http://www.linkedin.com/news?viewArticle=&articleID=223779876&gid=90917&type=member&item=32151191&articleURL=http://financialagile.com/reflections/10-teachings/31-option-pricing-with-black-scholes&urlhash=LU9G&goback=.gde_90917_member_32151191

NOTE I now post my TRADING ALERTS into my personal FACEBOOK ACCOUNT and TWITTER. Don't worry as I don't post stupid cat videos or what I eat!