luisalro / miax-Candlesticks_InvestmentAlgorithm_Lab

Candlesticks algorithm trading strategy coded in R.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Introduction

When making trading decisions, we can utilize several different information sources on our technical analysis. One of these sources is OHLC (open, high, low, close) data. Candlestick charts can be plotted to extract patterns from OHLC data for any tradable instrument.

A candlestick pattern is a movement in prices shown graphically on a candlestick chart that some believe can predict a particular market movement.

alt text

Instructions

For each asset, each day, buy at the opening price and sell when the first of the following events occurs:

  • Assets go up 3 cents (stop profit)

  • The asset falls 10 cents (stop loss)

If none of the above occurs, sell at closing price.

Be careful, there will be positive and negative days at the same time, in these cases, we suppose that you play the stop loss first.

The capital that we invest in each asset, every day, must be € 30,000.

The commission for each purchase and sale will be 0.0003 * capital.

Deliverable

A R script that generates a dataframe with the following structure (for all assets) with the following indexes per row:

My Image

And plot the accumulated profit per asset. For example:

My Image

About

Candlesticks algorithm trading strategy coded in R.

License:MIT License


Languages

Language:R 100.0%