Problem of automatically formulating trading rules

Assignment Help Macroeconomics
Reference no: EM131925440

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.

Reference no: EM131925440

Questions Cloud

Dividend yield and the capital gains yield : What was the dividend yield and the capital gains yield?
Research the given areas connected to career management : Using the United States of Labor website and research the following areas connected to career management: 1. Career Benchmarks.
Explain why every american should known the given history : Explain why every American should known this history and propose how knowing specific parts of this history could help mend race relations in the United States.
Why did the civil rights movement change social landscape : How and why did the Civil Rights Movement in the 1960's change the social, cultural, and political landscape for African Americans?
Problem of automatically formulating trading rules : The assignment for this topic is going to look at the problem of automatically formulating trading rules using one of the new techniques PSO, DE or ANN
Relationship between operational and clinical perspective : When you consider patient flow, do you think there is a need for a close relationship between the operational and clinical perspectives? Why or why not?
Reimbursement for a particular good or service : Who should make the decision about whether to provide coverage and reimbursement for a particular good or service?
What motivated the united states to procure california : What motivated the United States to procure California? What was the historical context of the California statehood debate?
Internet search for the keirsey temperament sorter : Internet search for the Keirsey Temperament Sorter questionnaire and find a site that appears to have a reputable self-assessment questionnaire.

Reviews

Write a Review

Macroeconomics Questions & Answers

  Inflation targeting be a good policy

Why might it be difficult for the Fed to formally adopt inflation targeting?  Would inflation targeting be a good policy for the Fed in the present economic environment

  In using the taylor rule

In using the Taylor Rule as a guideline for monetary policy, what are the pros and cons of using forecasted values of inflation and output rather than observed values of these variables?

  Describe the present economic crisis situation in europe

Describe the present economic crisis situation in Europe.  Why has it been so difficult for the Europeans to find a solution to this problem?   Comment on what implications the crisis may have for the rest of the world if Europeans are not able to ag..

  Long-term federal government budget problems

Question:. Explain why there are long-term Federal government budget problems. Explain why the base-line forecast of the CBO is misleading.

  Derive and compare demand curve

Question based on Derive and compare demand curve,  Derive Ambrose's demand function for peanuts. How does it compare with Johnny's demand curve for peanuts?

  Problem based on utility function

Problem based on  Utility Function - Problem,  Answer and explain the following using a diagram which is completely labeled.

  Laffer curve : tax rate and tax revenue

Question based on Laffer Curve : Tax Rate and Tax Revenue,  Do raising tax rates necessarily raise tax revenue? What factors affect how tax revenue changes when tax rates change?

  Problem - income elasticity of demand

Problem - Income Elasticity of Demand,  Interpret the following Income Elasticities of Demand (YED) values for the following and state if the good is normal or inferior; YED= +0.5 and YED= -2.5

  Positive balance of payment

Question Positive Balance of Payment: "Things will look good for the US if we could just get to where we are consistently running a positive Balance of Payments."

  Effect of recession on the investment curve

Comment on the effect of a recession on the investment curve (only) and on the level of savings, investment, and the equilibrium real interest rate in the financial crisis that hits United States first starting in fall 2007.

  Affect of falling domestic investment on trade surplus and

How will a fall in domestic investment affect the trade surplus and net capital outflows in the domestic economy, the trade deficit and capital inflows in the rest of the world.

  Crises in the banking sector and bank run

Banking crises crisis decreases depositors' confidence in the banking system. What would be the effect of a rumor about a banking crisis on checkable deposits in such a country?

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd