Thursday, May 30, 2019

Guerilla Robotic Process Automation (RPA)

The automation of business processes with the help of "robotic" tools is perceived as a way for increasing operational speed and lowering errors while simultaneously reducing costs. However, the introduction of RPA tools may be hampered by convoluted approval process and security issues. In result, introduction of a robot can take forever. No wonder, some groups inside a company may decide to handle the automatization challenge individually. Python often becomes the tool of choice. With extensive general purpose functionality and simple syntax, creating scripts in Python is relatively easy and fast. Especially in comparison to the time needed for the implementation of company-sponsored system solutions. Even if such homebrew scripts may not be perfect from the beginning, they can be modified fast, without the pain connected with getting a dozen approvals.
One may correctly say, there is a huge, uncontrolled risk connected with such guerilla automatization. 

But the company may easily offer solutions that assure the security without stopping the bottom-up automatization movement. The first step is hosting all scripts in a central repository. It is important to limit rules connected with such hosting. The repository should be presented as a way for sharing knowledge between sometimes remote groups inside the company. Additionally, the code in the repository allows its review by a central team tasked with assuring stability and security. When some issues are identified, script authors may be contacted with a suggestion of changes.

In this way, the company takes advantage of the employee's desire to make the work easier and their creativity, instead of slowing the process to a crawl.

Wednesday, January 14, 2015

Will the official URE price for 2014 fall to 162 PLN?

At the end of March each year, URE (the Polish Energy Regulatory Office), publishes an average electricity energy selling  price for the previous year.

This official URE price may be used be the renewable energy generators, when selling the electricity they produce in the following year (April-March) to the obliged buyers (local Distribution Network Operators or OSD). In a way they have a guaranteed energy price for a given year.

While for the renewable energy generator, the official electricity price may remove one of the variables from its volatile business, it also means additional costs for the obliged network operators.

For example, Energa - the OSD covering northern part of Poland where significant renewable energy sources (RES) are located, said it spent more than 100 mln PLN (23 mln EUR) on additional costs related to the energy purchases from the renewable sources.

No wonder, the publication of official URE price is closely watched by both renewable energy producers and obliged network operators.

The URE price is calculated using reports from the sellers of the electricity submitted to the ARE (Energy Market Agency). For collecting and analyzing the reports requires time, URE is able to announce the official electricity energy price in the previous year, at the end of the first quarter of following year.

Since all the electricity needs to be traded on the Polish Power Exchange (TGE / POLPX) I was wondering whether it is possible to "predict" the official URE price using the market data.

Markets for electricity are quite a complex beasts, characterized by many different segments and instruments, high volatility and in the meantime - various seasonabilities.

For example, the DAM (Day Ahead Market) prices in Poland oscillated between 82 and 452 PLN (19-105 EUR), with the mean of 184 PLN (43 EUR) in 2014:

BTW: The average electricity price was above the official URE price from 2013, used since April 1st, 2014. When ones calculates the prices for the three last quarters of 2014, the average DAM price is even higher - 191 PLN (44 EUR) or 5% above the official URE price.

A simple model based on the market electricity prices I created at the end of 2014, gave a tight fit with the announced official URE prices for 2011, 2012 and 2013.

It also delivered a little surprising "prediction" that the official URE price for 2014 may be 162 PLN (37 EUR) or  -12,1% below the average DAM. 

Tab. URE official price "prediction" model

We will find out whether this result is close to the actual at the end of Q1.

Tuesday, December 23, 2014

When marginal price of a call goes to zero

Having an unlimited mobile plan is a very nice thing - you do not need to worry you will pay more than you expect for using your smartphone.

Also, at some point (often quite early in a month), successive calls become free.

Or to be precise - the marginal price of a call goes to zero.

Still, I was wondering, how much of the unlimited am I actually using.

Monday, September 29, 2014

How to consistenly lose the money on the stock market?

I have recently written about back-testing some fundamental investment strategy using GieldowyRadar stock scanner for the Polish stock market.

The results of the back-test were quite impressive (even if one should not believe in them too much), but can we do the opposite? Can we create a strategy that consistently loses money?

YES, we can! :)

Sunday, September 28, 2014

Does your asset manager have a substantial stake in the fund he manages?

I first wrote about the Eurogeddon investment fund - the one betting on the collapse of the European Union - in February 2012. Now it is -62% down.


I was nonplussed by the simulations presented by the fund marketing team.

The execution strategy employed also seemed too much aggressive to me, especially taking into consideration the nature of the bet.

Nassim Taleb in his "Antifragile" book, stresses the importance of the convexity (i.e. a favorable assymetry) of the trades.

Convexity doesn't make you an automatic winner, but limits your loses and increases potential profits, when situation turns in your favor.

Otherwise, you risk turning your portfolio into a zombie with virtually no chance of raising up:

Many money / asset managers are not better in investing than monkeys, but usually they charge pretty step fees for their services.

Is there anything that can be done about it?

One possibility is to make asset managers to invest substantial part of their net worth into the funds they manage.

I am pretty sure they would be a little bit more careful with the investments they make... And it would not neccessarily diminsh the returns.

Saturday, September 27, 2014

KGHM: hedging copper with the seagull

The 14H1 KGHM report mentions a copper hedging strategy called the Seagull.

Basically, it hedges part of the revenues (40,5k tons in H2 vs. 283k tons produced in H1, or less than 15%) against copper prices falling below $7,500 / ton.

Since the copper price was approx. $6,800 / ton on Friday, the Seagull was in the air:

(assumes no premiums)
Notes: see post about visualizing option strategies

Friday, September 26, 2014

Back-testing value investing

I have been recently playing with a fundamental stock scanner designed for the Polish market - GieldowyRadar.

This scanner offers a number of predefined strategies based on some gurus stock selection criteria and allows to back-test them over 7 years.

The best back-test results are currently produced by "the Warren Buffett" strategy.

The average annual return of this strategy is 29.3% vs. -1.85% for WIG index.

The strategy takes into consideration indebtness, EBIT profitability, cash/free cash flow ratio, return on equity and market capitalization.

The scanner makes possible to back-test your own strategies. Unfortunatelly, some more complex conditions - including some used in the pre-programmed guru strategies - are currently not available.

Still, I was wondering whether it is possible to beat the best guru strategy using the limited scanner's back-test functionality while keeping the criteria fundamentally reasonable.

The answer is - YES! :)

"Buy Cheap" strategy: 1014% over 7 years

Thursday, September 25, 2014

Commodity prices and KGHM stock price

The stock price of KGHM is falling since the late August.

The KGHM moves follow changes in prices of copper and silver - two key KGHM products.

Source: stooq

Predicting commodity prices may be tricky, so let's focus instead on their past behavior in Q2 and - nearly finished - Q3.

Even though the prices of both copper and silver have decreased from the begining of Q3 till now, the average price of them actually increased - by 3% in case of copper and by 1,1% for silver.

Since KGHM reports its results in PLN, we should also take currency into consideration.

Because USD has strenghted in Q3, in PLN terms, copper price increased by 6.3% and silver by 4,4%.

black - Q2 prices and average
red - Q3 prices and average

                  Q2        Q3     Q3/Q2%
copper USD  309.0300  317.8600 0.03000000
copper PLN  938.0078  997.6208 0.06355287
silver USD 1965.0969 1987.2661 0.01128151
silver PLN 5965.5656 6232.2229 0.04469943

One additional element that may influence the KGHM Q3 results scheduled for publication in November, is the recently started Sierra Gorda mine production.

The effect of Sierra Gorda will be marginal in Q3, but should increase in the following quaters - posittivelly affecting both production and average cost levels.

Sunday, June 29, 2014

What the UK grid status data tells us about the renewable energy sources?

Thanks to the data available at the UK National Grid Status website, we are able to watch the evolution of the wind power generation in the United Kingdom from May 2009.

Over the last three years, the peak wind generation exceeded 20% of the total country electricity demand.

Even that this is lower than over 50% in Denmark, this number still looks impressive. However...

Saturday, June 21, 2014

A first look at the potential arbitrage opportunities in the electricity market

As previously observed, electricity markets can be strange at times.

Especially when there are two (or more) separate markets dealing with virtually the same article.

Usually such situation leads to arbitrage opportunities.

In case of electricity, we often have the separation of the Day Ahead Market (DAM) - when one declares amount of electricity he will provide or consume - and balancing market - when differences between DAM declarations are settled.

When you are a Renewable Energy Producer (RES), and forecasting your energy generation is not perfect, you face two possible scenarios:

  1. production excess - you have produced more than you declared (sold on the DAM)
  2. production deficit - you have produced less than you declared (sold on the DAM)
Let's focus on the later - production deficit.

Regulations differ, but usually when you are short (in deficit), you must buy the amount of the "missing" energy (forecasted amount declared/sold on the DAM minus the actual production). Unless you are able to do it on the Intraday Market (IDM), you must settled on the balancing market.

Normally the deficit prices are higher than the DAM prices, meaning that you pay for the errors in your production forecast.

For example, in Romania, the average difference between DAM and deficit prices was minus 98 RON / MWh (approx. minus 23 EUR / MWh) over the October 2013 - May 2014 period (some preliminary data used).

However, on rare occasions (<5% of the cases), deficit prices were lower than DAM prices.

Fig. Distribution of the differences between DAM and deficit prices in Romania, 2013-10 - 2014-05

Hence, selling as much energy as possible (for example your whole installed capacity) on the DAM, for the moments when DAM price is expected to be higher than deficit price would bring you a profit (on average 21 RON / MWh).

A "tiny" problem remains though. How to predict when DAM>deficit? :)

Fig. Differences between DAM and deficit prices by the hour

Fig. Average differences between DAM and deficit by months and hours
Note: all values negative, best -39 RON