Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Macroeconomics Expert

Assignment -

The assignment for this topic is going to look at the problem of automatically formulating trading rules using one of the new techniques introduced in the lecture: PSO, DE or ANN (or others of your own choice but check with me first). The choice of technique is up to you, as is the exact form of the problem you choose. The approaches covered in the lecture looked at:

  • Predicting the high price (HP) and low price (LP) for the coming day, based upon various key factors from previous days such as opening price, closing price, high price, low price, volume, Relative Strength Index (RSI), and Exponential Moving Average (EMA). These likely values for HP and LP can then be built into trading rules which will automatically buy or sell assets at what should be the optimum point (although this aspect is out-with the scope of this assignment).
  • Optimising the parameters for pre-existing trading rules, in particular the long, short and signal values for MACD.

You can investigate either of these or some other aspect of algorithmic trading of your own choice (but best check with me first)

As with forecasting and prediction, you will be working with time series data, so the size of the window needs to be considered (this will depend upon the characteristics of the data you are using).

Some Useful Resources

A useful package to assist in doing this is quantmod - designed to support the rapid development and evaluation of trading models. Amongst other things it makes getting hold of data very straightforward and also provides functions for the opening and closing prices, high and low values, volume etc. - just take a look at some of the examples.

Another value package is TTR, which again provides a myriad of function for building trading rules, but in particular ones for RSI and EMA. If you use quantmod then TTR will be installed by default as quantmod depends on it.

NOTE: A couple of hints...

When using the quantmod package the data is in a time series structure called "xts". You can check this as follows (for example):

> getSymbols("GOOG",src="yahoo")

> str(GOOG) # this will give you the structure

> head(GOOG) #will give you the first few lines of the data

This means it has to be extracted for use within the fitness function. There are several ways to doing this but one fairly simple one is to use the coredata() function.

So if we wanted to extract the opening prices:

> OP <- coredata(GOOG$GOOG.Open)

If you check this using

> str(OP)

> head(OP)

You will see that this is a still a two dimensional vector with several rows and one column (check this using dim(), nrow() and ncol()) so we need to extract this further using [,1] . Or in one step:

> OP <- coredata(GOOG$GOOG.Open)[,1]

Which gives a simple dimensionless vector. Hope that helps. I suspect there may be a simpler way of doing this so don't hesitate to let me know!

Also, one of the other things you might find is that the volume values are too high for the GP to handle without losing accuracy so you could try scaling these down by several orders of magnitude.

Assignment Requirements

You need to write a report (around 10 pages) covering:

  • Background to the problem - a short review of the new approach you are going to employ and an overview of related work in the area drawn from key published papers.
  • Your choice of data - what did you choose to work with. As usual, summary plots would be welcome.
  • Details of the approach taken and any specific decisions about the representation, fitness function etc. along with details about any key parameters.
  • Presentation of and comments on the solutions achieved: How well do they fit the training data. What fitness values were achieved?
  • The performance of the model. How does this perform over unseen data and what level of profit would it yield?
  • Comparison against other approaches. The choice of what you compare with is yours. At least try a random solution and look at the performance obtained. If you wish you may also consider other approaches (e.g. a GA or GP or other technique of your choosing)
  • Please also include the R code, either as an appendix or in a separate file.

My plan is to use improved strategies for trading stocks that will help to decide whether to buy or sell. This will be done with a trading algorithm based on the Particle Swarm Optimisation (PSO) technique.

Macroeconomics, Economics

  • Category:- Macroeconomics
  • Reference No.:- M92764101

Have any Question?


Related Questions in Macroeconomics

Question according to your textbook in the aggregate supply

Question: According to your textbook in the Aggregate Supply (AS) theory an increase in output leads to an increase in the price level. What is the assumed causality? Explain why this should be considered flawed? The res ...

1explain four types of unemployment2explain the advantages

1. Explain four types of unemployment 2. Explain the advantages and disadvantages of:(a) A flexible exchange rate regime (b) A fixed exchange rate regime 3. Suppose the Reserve Bank of Australia increases the interest ra ...

Question a firm invents and obtains a patent for a new

Question: A firm invents and obtains a patent for a new strong, biodegradable fabric that is used to makegrocery bags. The demand function for these bags is Q = 800 - p. The firm's cost function isC(Q) = 100 + 100Q + 0.5 ...

Question - consider a community consisting of three voters

Question - Consider a community consisting of three voters, Al, Bob and Cathy. The Marginal Benefit function for each person is, for lighthouse service G is; MBa = 40 - 4G for Al, MBb = 20 - 2G for Bob, and MBc = 10 - G ...

Question are shareholders residual claimants in a publicly

Question: Are shareholders residual claimants in a publicly traded corporation? Why or why not? In some industries, like hospitals, for-profit producers compete with nonprofit ones. Who is the residual claimant in a nonp ...

Question - sitting on an airplane you are chatting with the

Question - Sitting on an airplane, you are chatting with the person sitting next to you. That person asks you some questions about time series and macroeconometrics. What do you say? Here are some questions: 1. What is t ...

Question firms producing different products have some

Question: Firms producing different products have (some) ability to set prices for their products. What are some factors which allow firms to attain these monopoly profits (sometimes called monopoly power or monopoly ren ...

Question according to the definition a perfectly

Question: According to the definition, a perfectly competitive firm cannot affect the market price by any changing only its own output. Producer No. 27 in problem 2 decides to experiment by producing only 8 units. a. Wha ...

Question - consider a market with 100 consumers each

Question - Consider a market with 100 consumers. Each consumer would like to buy at most one unit and is willing to pay up to 10$. There is an incumbent firm that already operates in the market and a potential entrant fi ...

Question - a firm has two variable factors and a production

Question - A firm has two variable factors and a production function, f(x 1 , x 2 ) = x 1 ½ x 2 ¼ . The price of its output is 4. Factor 1 receives a wage of w 1 and factor 2 receives a wage of w 2 . (a) Write an equatio ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As