Monday, September 24, 2018

+$330, flat WTI RBOB pair

Exec Time Spread Side Qty Pos Effect Symbol Exp Strike Type Price Net Price Order Type Crack
9/24/2018 12:55 FUTURE BUY 1 TO CLOSE /CLX8 18-Nov FUTURE 72.15 72.15 MKT
9/24/2018 12:55 FUTURE SELL -1 TO CLOSE /RBX8 18-Nov FUTURE 2.0401 2.0403 LMT

The entry was posted live here and @tfo_medved.

Long X8 Simple Crack Spread

Exec Time Spread Side Qty Pos Effect Symbol Exp Strike Type Price Net Price Order Type Crack
9/24/2018 9:18 FUTURE SELL -1 TO OPEN /CLX8 18-Nov FUTURE 72.28 72.28 MKT
9/24/2018 9:18 FUTURE BUY 1 TO OPEN /RBX8 18-Nov FUTURE 2.035 2.035 LMT

Friday, September 21, 2018

Thursday, September 20, 2018

$160, flat gas oil pair

Exec Time Spread Side Qty Pos Effect Symbol Exp Strike Type Price Net Price Order Type Crack
9/20/2018 22:53 FUTURE BUY 1 TO CLOSE /CLX8 18-Nov FUTURE 70.21 70.21 MKT
9/20/2018 22:53 FUTURE SELL -1 TO CLOSE /RBX8 18-Nov FUTURE 2.0025 2.0025 LMT

The entry was posted here.

Wednesday, September 19, 2018

Simple Crack Spread : long gas short oil

 How to calculate and trade Simple Crack Spread using RBOB and WTI Futures. 

Exec Time Spread Side Qty Pos Effect Symbol Exp Strike Type Price Net Price Order Type Crack_Spread
9/19/2018 11:08 FUTURE SELL -1 TO OPEN /CLX8 18-Nov FUTURE 70.58 70.58 MKT
9/19/2018 11:08 FUTURE BUY 1 TO OPEN /RBX8 18-Nov FUTURE 2.007 2.007 LMT

Wednesday, September 5, 2018

silver continued

Because of the recent dive, there was only $5 of extrinsic value left in Dec_2018 15 Put. The position was rolled far out in exchange for $85.

Exec Time Spread Side Qty Pos Effect Symbol Exp Strike Type Price Net Price Order Type
9/5/2018 10:22 STOCK BUY 100 TO OPEN SLV ETF 13.33 13.33 LMT
9/5/2018 10:22 SINGLE SELL -1 TO OPEN SLV 17-Jan-20 15 CALL 0.85 0.85 LMT
9/5/2018 10:21 SINGLE BUY 1 TO CLOSE SLV 31-Dec-18 15 PUT 1.71 1.71 LMT

Thursday, August 30, 2018

-$600, Day Trading Algorithm

8/14/2018 4
8/15/2018 -15.75
8/16/2018 3.25
8/20/2018 -3.25
8/21/2018 -5.75
8/24/2018 4.75
8/27/2018 4.25
8/28/2018 0.5
8/30/2018 -3.5
Total: -11.5

Starting  March, Medved's proprietary algorithm made 95 /ES points. 

Friday, August 24, 2018

-$6,280 #soybean

according to the plan. The lesson here is - don't increase the size of a losing position.

Soybean Naked Put

New Entry

Exec Time Spread Side Qty Pos Effect Symbol Exp Strike Type Price Net Price Order Type
8/24/2018 9:38 SINGLE SELL -1 TO OPEN /ZSX8 1/50 NOV 18 /OZSX8 800 PUT 8.125 8.125 LMT
My old position will be closed later today ; the expected loss is ~ $6,000.

+$107 , Bonds macro trade

/ZBU8 153 naked call goes to heaven.
The entry was posted here.

Wednesday, August 22, 2018

Statistical Mechanics of Algorithmic Day Trading SP500, Part V: Leverage Using The Kelly Criterion

I will start this post by reminding that trading with leverage carries significant risk.    Day traders use leverage to win big, however, usually they lose big and end up in misery  To avoid this fate please read"Why Day Traders Lose Money".

This post is about the algorithmic use of leverage in day trading. The goal is to optimize growth of the trading capital.  The related problem is  tossing a favorable coin (binominal game). The known solution to favorable binomial games is The Kelly criterion.   Kelly's solution involves a mathematical idealization that the capital can be dived infinitely, i.e. an infinitesimally small bet is possible which is not the case in real trading. In this post, an example of how Kelly can be used to control trading SP500 Emini futures is provided.

Part  II  of Statistical Mechanics of Algorithmic Day Trading describes a generic algorithm for trading SP500 which ensures a positive expectation of  return. Averaged over years 2007 to 2017 this algorithm has win ratio w = 0.38 and payout p= 2.7.  Kelly is given by k = w-(1-w)/p = 0.15. Thus, for the optimal grows of the trading capital, the bot has to risk f, 0.15, fraction of the capital. Recall that the bot uses 1/4 of daily Standard Deviation of SP500 as the stop loss. Accordingly, to start trading one Emini contract it is necessary to have $280= 1/4*1.25%*SP500*50 as the minimal bet and $280/k=$1800  as the initial trading capital at the beginning of 2007.  The actual capital used to start the simulation was  $5000 which is about  3x of the precalculated starting capital. The two goals were achieved by this increase:  1) to decrease the volatility of the trading capital; 2) to allow up to 66% loss of the capital while maintaining f < k. Now the algorithm is really simple:

if  (f < k/6)  number of contracts =  number of contracts* 2;
if (f >  k/2)  number of contracts =  number of contracts / 2;

 The result of the trading from the long side ($5,000 to $5,000,000 in about two years) is shown below.

The presented here results are a theoretical study which was conducted out of curiosity. The algorithms described here are for entertainment only.

Sunday, August 19, 2018

Mathematics of "Why Day Traders Lose Money"

Mathematical statistics explains three major reasons behind the frustrating reality that nearly all day traders lose money.

1. Instead of "cut your losses early and let your winners run" a trader usually is inclined to "take the profit early and let the losers run". This type of behavior is dictated by emotions while statistical analysis showed that taking profit early leads to a negative expectation. Let the losers run in day trading is a recipe of "how to lose your deposit quick".

2. The second reason has to deal with the mathematical fact that for a trader who has a limited capital having a strategy with a positive expectation is a necessary condition to win but it is not a sufficient one. Proper position sizing is required to be a profitable trader.

Let us describe the problem in simple terms.  As I posted earlier, day trading can be approximated by a toss of a biased coin. Now imagine that a trader has $1000 and he/her knows a strategy equal to a coin biased as follows -  2/3  heads and 1/3 tails. If this trader every time goes all in on heads than, at some point, all wins and the initial $1000 will be lost.  There is a limit to how big fraction of the capital this trader can bet on a single toss to avoid the ruin and there is an optimal bet which allows this trader to grow the capital with the fastest rate. The mathematical solution to this problem is known as the Kelly criterion.  For the coin used in the example above, the Kelly gives  2/3-1/3=1/3 as the optimal fraction of the capital to bet. This solution involves a mathematical idealization that the capital can be dived as many times as it requires and an infinitesimally small bet is possible. Unfortunately, unless a trader has enough money to start with say 100 emini contracts, the Kelly criterion can't be used directly by a small-scale day trader.  However, this criterion still can be used to prevent a day trading strategy from running into a ruin.
To summarize, the problem of the optimal bet in the leveraged trading on time frames with the quasi-normal distribution of the return (day or shorter time frames) is still, at least to me, an open question.
I will try to look into this problem.

3. The third reason is the cost of trading which includes trading fees and a slippage. Due to the very nature of day trading many wins and losses eventually just cancel each other while as time passes by the cost of trading steadily adds to the loss.  For this reason, many quant strategies that look good on paper do not deliver in real life. Here one has to :
  a) daytrade using only liquid trading instruments;
  b) choose a broker with a better fee structure;
  c) use the realistic cost of trading in calculating the expected return of a trading model.

Friday, August 17, 2018

Statistical Mechanics of Algorithmic Day Trading SP500, Part III: Take Profit & White Swans


The probability distribution of SP500 daily return was calculated and posted in Part I. The calculations showed that the Efficient Market Hypothesis is a good approximation, i.e. most of the time the daily return of SPX index is a variable with close to zero expectation which equates day trading to gambling against a house. The house has the statistical advantage due to the trading fees. In Part II, it was shown that both for longs and shorts a positive expectation can be achieved using  "cut your losses early and let your winners run" approach. 

On algorithmic level this approach was formulated as follows:

1. Every trading day: if no position open SPX position at the close of the trading session;
2. Next day: if return < StopLoss than close the position.

When the only parameter in this algorithm (StopLoss) is optimized the algorithm is expected to outperform the total return of SP500 (see Part II). Here we modified the algorithm by introducing the TakeProfit variable.

Statistical Mechanics of Algorithmic Day Trading SP500, Part II : Generic Algorithm of Day Trading

“Number rules the universe.”

In Part I, the probability distribution (density) of SP500 daily return was calculated. It was shown that a directional day trade is not much different from a toss of a fair coin - 0.47 shorts, 0.53 longs. At best a directional daytrader has a close to zero expected value of return. It can be said that the ensemble of the directional daytraders exists only to generate trading fees while their wins and losses eventually cancel each other.

To make day trading profitable one needs to shift the probability distribution to have a positive expected value of return.  The figure below demonstrates how the proverbial "cut your losses early and let your winners run" can be tested in a quantitative fashion. I believe that this is how instead of fear of uncertainty one acquires a conviction.

Statistical Mechanics of Algorithmic Day Trading SP500, Part I : Probability Distribution of The Daily Return

      “Number rules the universe.”― Pythagoras

SP500 market is characterized by both deep liquidity and high daily volumes. The popular instruments for trading SP500 index are SPY, SPX and Emini (/ES) futures.   At current prices of SP500 a daily move in Emini futures can easily exceed $1000 while, for example, ThinkOrSwim trading platform requires only ~ $6000 as the initial margin. Consequently, a SP500 daytrader is attracted by the idea to get rich fast like a moth to a flame; more than 90% of retail traders end up losing money. It is reasonable to ask thenWhy do people trade at all?- and is it possible to make money by day trading SP500. The answer to the first question is not an easy one as it involves many facets of our life. I believe that to a large degree it is related to being in a poor financial situation.

To answer the second question I used the statistics of one regular trading session of SP500 index. The probability distribution of the daily return of SP500 was presented in the first part of this publication. It was shown that day trading of SP500 is similar to a coin toss with even payout and with a small favor for betting from the long side. In the second part, a generic methodology of algorithmic day trading for a retail investor will be derived based on the calculated statistics. 

#WTI #RBOB Simple #Crack Spread Pair #Trade

 How to calculate and trade Simple Crack Spread using RBOB and WTI Futures. 

Friday, June 22, 2018
Scaled in @17.4; tis a berry painful trade. I Feel Like I'm Taking Crazy Pills

Exec Time Spread Side Qty Pos Effect Symbol Exp Strike Type Price Net Price Order Type Crack
6/22/2018 11:31 FUTURE SELL -1 TO OPEN /CLQ8 18-Aug FUTURE 68.06 68.06 MKT
6/22/2018 11:31 FUTURE BUY 1 TO OPEN /RBQ8 18-Aug FUTURE 2.0355 2.0355 MKT

Wednesday, June 20, 2018

The U.S.  gasoline price decreased.  Let us wait for a summer spike in gasoline price and try to do some scalping at the same time.

Scaled in @18.71

Exec Time Spread Side Qty Pos Effect Symbol Exp Strike Type Price Net Price Order Type Crack_Spread
6/20/2018 12:18 FUTURE SELL -1 TO OPEN /CLQ8 18-Aug FUTURE 65.51 65.51 MKT
6/20/2018 12:18 FUTURE BUY 1 TO OPEN /RBQ8 18-Aug FUTURE 2.0053 2.0053 LMT

Monday, June 18, 2018

Scaled out @20.27 for $100 ;  the basis is @20.87 now.

Exec TimeSpreadSideQtyPos EffectSymbolExpStrikeTypePriceNet PriceOrder TypeCrack_spread
6/18/2018 10:23
6/18/2018 10:23

Friday, June 15, 2018

Scaled in @20.17.

Exec Time Spread Side Qty Pos Effect Symbol Exp Strike Type Price Net Price Order Type Crack_Spread
6/15/2018 10:46 FUTURE BUY 1 TO OPEN /RBQ8 18-Aug FUTURE 2.0338 2.0338 MKT
6/15/2018 10:46 FUTURE SELL -1 TO OPEN /CLQ8 18-Aug FUTURE 65.25 65.25 MKT

Thursday, June 14, 2018

In line with my expectation, Q8 Crack spread is cheaper today. Having a long position here is a good idea as at summer seasons this pair is prone to sudden spikes.

Exec Time Spread Side Qty Pos Effect Symbol Exp Strike Type Price Net Price Order Type Crack_Spread
6/14/2018 11:05 FUTURE BUY 1 TO OPEN /RBQ8 18-Aug FUTURE 2.079 2.079 MKT
6/14/2018 11:05 FUTURE SELL -1 TO OPEN /CLQ8 18-Aug FUTURE 66.35 66.35 MKT

Why do I buy cheap OTM puts?

SLV credit puts spreads is the core of my Income Portfolio. A typical spread is -1 16 Put hedged with +1 13 Put.  Almost always  I have a feeling that cheap OTM puts are a useless waste of money. I have to suppress this emotion because back in 2008 SLV printed $8.5. If a financial crisis like in 2008 will happen again and the SLV price will drop say to $10 the baseline for me will shift $3 down but the income strategy will keep yielding interest. It turns out that Mark Spitznagel has a similar approach to risk hedging.

Small-scale Trading That Works Similar to Income from Real Estate Investing

Part I: Upstream against Currency Devaluation

For all practical purposes, 1964 marks the last year when regular quarters minted in the USA were suitable for value storing by a regular person. 54 years later, in 2018, 1964 Washington silver quarter costs about $3. Isn't it an interesting and dangerous question - to whom  11/12 of the original value was transferred? 
Another important observation is that those- before 1964- folks were paid interest without losing the real value. A modern investor has to operate in the monetary environment constructed to deplete the principal value of a cash account by virtue of the hidden currency devaluation. Let us estimate the rate of USD devaluation using the value of 1964 Washington silver quarter -  (1-x) ^54=1/12.  The answer is x = 0.045. It means that - 

No matter what they say in their official reports, the calculation showed that the value of $1 decreases with the rate of ~4.5% per year.

Now, the formula to calculate the real return on a cash account reads:

Real ROI = (1 - Tax Rate/100) x ROI - Currency Devaluation Rate,

where ROI stands for the return on investment. Say if your tax rate is 25% than Real ROI for the cash account becomes positive if you make > 6% per year.

Part II:  Residential Real Estate Investing. 

Middle-class individuals often choose to invest in real estate as a way to receive interest without losing the real value. For example, currently a 1400 square feet, 2 bedrooms, 2 1/2 bath condo in Miami-Dade, Florida costs ~$200,000. If rented out, such a property generates cash flow of  $1300 rent per month, minus management fee of about  $200-300 per month, and minus property tax which is about $2,000 per year. Altogether it is about 5% ROI per year.

Real ROI = (1 - Tax Rate/100) x (ROI - Depreciation Rate), 

Let us use IRS allowed number, 3.636%, for the depreciation rate. In this case, if your tax rate is 25% than Real ROI in the described above residential property is ~1% per year.  For investors in Miami-Dade residential properties, it means that in 2018 all future rental incomes are nearly priced in the current price. Well, at least the wealth is protected from the silent erosion by $ devaluation. Real Estate Investing in Miami-Dade was way more attractive back in 2010-4 when the same condo yielded between 6 and 4%.

Part III:  Small-scale Stock Investing.

 SP500, Historical data.
Real estate investing is a capital-intensive business while according to some recent publications in media outlets,  many people in the USA have no $500 of free cash. Now let us think of a person who wants to accumulate wealth by small-scale savings while collecting interest. Since this individual has to beat $ devaluation (see Part I), small-scale investing in stocks of a dividend-paying company looks like a natural choice here. This choice, however, creates an additional risk cause a lot of companies tend to lose business and at some point, nearly all of them will go bankrupt.
Thus it is better for our small investor to buy a dividend-paying index fund.  For example, in 2018 before tax SPY pays ~1.8% of interest.  Similar to real estate investing, the chronical problem here is the overstretched valuation of the attractive companies which typically goes hand in hand with debt expansion cycles. A debt expansion cycle is usually followed by a prolonged period of bad ROI. From 1970 to 1980 SP500 dropped from ~$700 to $300 while, for example, WTI oil skyrocketed from $20 to ~$120. It is difficult to predict when and at what price the next top in SP500 will happen, but the phenomenon of lost decades is amply demonstrated by the historical chart of SP500 index.

Part IV:  Small-scale commodity investing.

Commodity investing is another way to fight currency devaluation. Beware that the entry point has to be close enough to the lows of a commodity cycle. Typically a long period of oversupply and of depressed prices is followed by a period when the demand becomes larger than mining supply. The price will stay depressed until the overground stocks are depleted. Usually, there is enough time to gather information and make an investment decision. 

At the beginning of 21st century, the rise of digital photography had eliminated about half of the industrial demand for silver. After it, the investment demand was oversaturated in the bubble of 2011. The price of silver was depressed since then. With the widespread adoption of electronic gadgets the situation has changed and in 2017 for the first time in many years, the total demand for silver is larger than mining supply. Silver ETF, SLV, is an ideal choice for a small-scale commodity investing. Interest can be collected by selling out of the money calls against SLV stocks (SLV has liquid options). At the same time, this approach allows profiting from price appreciation in the rising phase of the mining cycle. That easily beats currency devaluation. Here is an example of value investing in SLV stocks using just $3600.

"In 2018 Uranium supply is getting short, Uranium demand is growing while the number of the active mines is dropping worldwide. When the overground stocks of Uranium will go, the price will explode. Here one can get a solid return on the investment while participating in the liquid market.  Indeed, for the next several years, aggressive trading strategies like stock replacement by debit call spread may yield a spectacular return ...."

Stocks of Uranium ETF, URA, is suitable for small-scale value investing in Uranium market. Again, Call options can be used here to collect interest. Unlike SLV, URA is not a pure commodity ETF. As a collection of mining stocks, this ETF pays quite significant dividends.  

#Ponzi #Crypto vs #Uranium

The recent post, "#Uranium is going to beat #crypto returns", may sound a little bit provocative, but let us check the realities of these two very different mining worlds.

The blockchain technology is not that young anymore, but no economically significant applications were reported yet.
At present, it is not obvious how to get rid of the inherent slowness and expensiveness of a blockchain transaction. Meanwhile, people are experiencing crypto-mania and it is an acute form of mania. The reason is that the opportunity of an abnormal gain has a strong emotional response in the reptilian part of the human brain. This reptilian brain has all chemical means to stop commonsense. When a critical mass of free lunch believers is achieved, it becomes a self-propelling mania, because human beings have the basic instinct to act in a herd. No one is going to ask who is the patsy, that ultimate bagholder on the other side of the trade. While the answer is pretty obvious, people don't mind to buy some hilarious  #ICO.  For example, PonziCoin does exist in the crypto universe.  I dare to predict that the eventual return on this ICO will be minus 100%. Ponzi is a common trait of ICOs. Hence minus 100% return is going to be the universal constant in the ICO world.

As for #Uranium, there is no reason to think that the uranium cycle is different from any other commodity cycle for that matter.  In 2018 U supply is getting short, demand is growing while the number of active mines is dropping worldwide. When the overground stocks will go, the price will explode. Here one can get a solid return on investment while participating in the liquid market.  Indeed, for the next several years, aggressive trading strategies like stock replacement by debit call spread may yield abnormal returns and beat the darlings of the crypto world.

Why do people trade at all?

 It is often repeated that more than 90% of retail traders end up losing money. However, at least in the USA, trading remains quite a popular occupation. So why do people trade at all? My experience of chatting on investment blogs says that a trader usually presents him/herself as a rather rich person who trades simply because it is entertaining except that sometimes it is boring to win all the times.

Real life encounters with traders tell quite a different story.

1. In our local park, my kids easily make tons of new friends. That's how I came to know a weekend daddy.  This old man first lost his business; next, his wife ran away with a significant chunk of his wealth and to a younger man. The guy told me that he trades his retirement account cause he doesn't feel secure about coming years and that his trading was inspired by "a bald guy on CNBC".  Shortly I learned that this nice person with huge black circles under the eyes trades FANG stocks and that he understands only simple trading from the long side. The year was 2016  and he was a happy trader who had recovered all his losses caused by the nosedive of Apple stocks back in 2015.

2. Every other Saturday at 7:30 AM I play beach volleyball with other people from our physics and chemistry departments.   Here I talked with a Ph.D. whose wife and kid stay in India while in the  USA he shares a room with another guy from India. This young person invested ~$1000 in shares of crypto-mining companies and now is reduced to HODL. In his 30's this man who already published ~20 papers is desperately looking for an additional income as his salary is not enough to fulfill basic needs.

I know in person several other guys who can be classified as 1 or 2 or something in between.

My conclusion is that people trade mainly because their financial situation is an unstable one. Indeed   "Almost half of US families can't afford basics like rent and food; some 66% of jobs in the US pay less than $20 an hour."

No wonder that a trader in financially weak position often buys a dream of a miraculous return on a small investment while giving up a part of his/her real wealth. For example, it can be  Facebook shares or bitcoins.  In this case, Wall Street works as a wealth transfer machine where > 90% of retail traders end up losing money.

I think before getting involved with risky trading styles one should try small-scale income trading that works similar to cash flow from real estate assets.

anatomy of silver gold pair trade

Gold is a monetary metal, i. e. gold is money. Gold can be used as a safe storage of value when fiat currencies are being devalued day by day. Also, rising gold price usually means that faith in banking and governmental institutions is falling and investors are looking for safe haven. Gold has few industrial uses.
Silver is used both as a monetary and industrial asset. Consequently, there is the strong silver-gold correlation.  However, because silver also has many industrial uses it is affected by the business cycle. 
A trader can try to profit form the interplay of monetary and industrial factors. From historical perspective Silver/Gold ratio is rather high,  i.e ~ 80 : 

One /SI contract is a digital equivalent of 5,000 oz of silver. At the moment it can be hedged with ~ 62 oz of gold. 

One /GC contract is a digital equivalent of 100 oz of gold.  60 delta /GC call against  /SI contract gives a fully hedged position than.

Naturally, a contrarian wants to short gold and long silver here but let us think some fundamentals first. 

#WTI #RBOB simple crack spread #trade explained & trade example

In the oil industry cracking is the process whereby crude oil is separated into refined products.

In trading "Crack Spread" is the difference between the cost of the oil products such as heating oil, gasoline and the cost of oil from which these products were cracked.

"Crack Spread" is not really for retail trading because of liquidity and capital issues. However, a retail trader can trade "Simple Crack Spread” using pretty liquid /CL and /RB futures. 

/CL contract is for 1000 barrels of WTI oil and is priced in $USD/barrel; /RB contract is for 1000 barrels of RBOB gasoline and is priced in $USD/gallon. 

To price "Simple Crack Spread"  between 1000 barrels of RBOB and 1000 barrels of WTI in $USD/barrel one has to use the following   formula: