Introduction & Forex Laws

This section is about Ali's investment lessons.

Forex Laws

Lessons

Decision Tree

Basics of Automated Trading – Over time traders must hone their ability to notice patterns in displayed data through indicators & charts, then execute positions from this information accordingly. With automated trading, it’s essential for us to be able to understand what we want our code to look for before executing its defined strategy. Essentially, the end goal of a trading strategy is an integration of set conditions which make up a complete function.

Designing a strategy is based on a simple principle: when to open an order and when to close an order. Our goal is to identify the correct way to use the various data flows we have at our disposal to open and close orders at optimal levels. With trading, price action is the master data flow.

Important factors apply when determining a strategy’s structure. In order to account for the ever-changing fundamentals of data, these areas must be considered:

• Data flow is variable so fixed numbers cannot necessarily be used due to the constant fluctuation in price levels. Essentially, data is relative and there is no prescribed value. • Make the most of the readily available data; implementing code pertaining to previous and current candles as opposed to future candle pricing; this unique data cannot be derived yet. • Account for noise which produces false signals by arranging code with specific conditions.

By mapping out as many probabilities as possible, a matrix of conditions comes to life as a Decision Tree where a wide set of scenarios are accounted for in strategy logic. This achieves a Boolean Framework through a series of ‘True’ or ‘False’ functions.

Orders are opened or closed therefore when all defined criteria are met.

We want a strategy which flows as the market alternates in value, an approach which is too inelastic cannot synchronise with the market efficiently.

Planning Pt1

Considering Financial Management for Trading: Is my Capital Enough?

This question is to verify if our investment strategy is compatible with the capital at our disposal.

Putting this into context:

\$1,000 Total Balance 1% Order Size = 0.01 Lot – Pip Value of \$0.10(10 Cents) per pip.

Our next step is understanding if the market moves against us how much capital is at stake. If our position moves against us – 10pips, this would equate to -\$1, -100pips would equal -\$10 etc.

As we go along, we must identify what is the average drawdown and more specific areas like the max amount of orders we can allow the strategy to have open at a time. If for example a strategy can invoke a margin call due to over 60% of your capital being in negative equity or a broker does not allow for the necessary amount of orders at any given time for the strategy to work effectively, then the plan is incompatible.

The next step is establishing a profit goal, an average number of set pips or profit daily. This goal must be balanced with an achievable amount of pips and a well thought out approach of spreading out capital. A goal like 100pips a day can be hard to obtain especially in times of minimal volatility. With minimal lot orders it is unlikely to achieve a worthwhile return also.

An easier approach is setting a goal in \$ as this allows for an adjustment of pips in relation to order size. For example:

With a goal of \$100 per day with \$1,000 worth of trading capital. One can decide to lower the targeted amount of pips to 10pips, this would allow for an order size of 1 lot and a smaller goal of 10 pips to achieve \$100. The issue with this approach however is the amount of risk associated with it: 1 lot would equal a \$1,000 order which would involve risking all disposable capital – an unsustainable strategy.

What is the more suitable manner of trading would be spreading the \$1,000 of capital available over as many orders as possible with minimal risk:

• \$1000 at 1% per order for instance • 0.01 Lots at 1:100 Leverage= \$10. • \$1000/\$10 = 100 orders.

Each pip at this scale equates to 10 cents. If each of the 100 orders moves an average positive 1 pip, \$10 profit is achieved. If each of the 100 orders moves an average positive 10 pips, \$100 profit is achieved.

The final step would be establishing how many times one would close and re open a single order, once would require 10 pips per order while twice would only require 5 pips per order. These 100 orders develop to 200 orders and an extensive spread of positions.

With defining such specific parameters for strategies, risk becomes compartmentalized as the precise amount of necessary capital is maintained throughout the procedure. It is incredibly important to stick to the set plan, so the correct amount capital is always available; not more than necessary for the strategy to work so additional capital is shielded from risk, and not less than what’s required, otherwise things will not perform efficiently.

A key benefit of such defined conditions is the clear data output provided. This will allow a trader to scale up or down the necessary areas.

Due to the relative nature of the constituents of forex, fixed points in strategies can prove to be useful for optimising. In a closed order list, through identifying the average numbers of order over a timeframe (or also per pair) and the average of profit for the same category; the resulting figures can be used as a realistic goal to attain.

Other factors which can help to adjust a system can be checking the average amount of lots per time frame and balancing this with maximum drawdown in tester results.

This establishes an idea of the average amount of capital required to maintain a strategy. What happens next is a process of separating profits and current trading balance occurs, and one can scale with added capital accordingly. Furthermore, the segregated profits are separated from chance and therefore the risk of unaccounted-for scenarios is minimised. When the plan is in Motion:

It is crucial that a strategy remains in standard deviation, if a strategy can maintain an average in line with your profit targets there is no cause for concern. If we exceed the control limits by averaging lower than 34.1% then the approach must be redefined.

DT13

When there is profit within the range a regular pay-out can be structured or reinvesting profits which enables a trader to exceed their initial goals and continuously compound. The smoother the initial strategy the less the likelihood of moving away from the standard deviation of P/L.

Planning Pt2

Trend Laws: 1. It is impossible to catch the peak of every single trend, no system no matter how complex can capture the absolute highest/lowest price of any trend period. One can however use a range to establish an efficient approximation to develop a structure around. 2. The percentage of how close to the peak of a trend orders are opened and closed defines the average percentage gain per trend. E.g. Opening an order 25% away from the start and 25% away from the end will allow for a 50% profit gain from the trend length. 3. For a strategy to be useful, frequent small trends must be minimised. Swaps and commissions will deteriorate smaller gains and deem a strategy of higher risk.

To ensure a strategy works well; it is essential to plan based on how long trends last on average. If a trend lasts on average 10 days for example, then a strategy should have a profit goal every 10 days per pair per time frame.

Take note that before every trend reversal in this context, there is an average of 200 – 300 pips or so. An efficient strategy will determine the average number of pips per trend to base a strategy around.

In this GBP/USD chart we can see a blue value at the peak of each chart indicating the amount of pips in terms of distance from the prior peak. The red zig zag line depicts a smoother angle of these trends.

Here we have a case of much smaller trends identified by the zig zag indicator. A counter approach to Law #3 which would aid in realising gains from smaller trends, would be to use the assistance of an indicator like a tight MACD which allows us to gauge the start and end of trends with more precision.

Trends function as your units, you can therefore have varying orders on alternating trends. Depicted below we have a Green Trend Line which serves as a long-term trend. Zig Zag Trends like this filter out tighter movement and allow one to establish a better ‘guide trend.'

Complementing the Long-term green Zig Zag trend, we have the red zig zag trend line which is much more sensitive to price fluctuations, depicting shorter term trends. At mini intervals, the red zig zag line shows how trades can operate as hedges and brief day trades while riding the longer-term trend.

A significant factor to consider when analysing trends using Zig Zag indicators are, they function as statistical tools to measure the validity of a strategy. They are not feasible for real time trading.

Planning Pt3

Here we have two moving averages, one based on prior candle close high and the other at the low. The highlighted yellow shows when the two moving averages move in the same direction, micro trends can be caught. The issue however is the fact that consolidation can give false signals through the fluctuating moving averages. The overall trend at the time would therefore be missed.

The simple solution would be to accept the fact that some aspects of data are negligible and fine tuning can’t always fix the problem. An indicator usually operates in one simple capacity.

Forex incorporates similar fundamentals to super string theory where data presents itself like continuous layers of waves.

All we need are guide lines which captures the general direction of a trend while disregarding mini trend reversals. The above picture highlights the trend we want to capture in yellow, the picture to the left shows this with a light blue Guide moving average.

• A large drawback of the Guide is the long-term average of the indicator does not capture trend reversals quickly. • As shown below yes, the period of consolidation is avoided however, the indicator lags in alerting when to sell. • A massive market move can easily be missed as a result of this which is due to the lag; depicted below.

When we fine tune, we are essentially selecting a range of waves or a specific wave to build our strategy around.

We cannot catch every single signal possible we can only structure our strategy around what we select and optimise.

To ascertain our entries are optimal, a combination of stricter parameters for your indicators (moving averages in this case) and additional complementing indicators accomplish two significant things: Filtering short-term noise and establishing a vote direction strategy.

There are 2 indicators, but they share 2 moving averages. SMA set to period 1 with high candle price. The 2 light blue SMAs are set to period 2 - one high, the other is low.

Now you take a vote If all 3 go up, open a buy position, if all 3 go down close. To the right we have a similar picture but the dark blue SMA set to period 1 is now set to a low. This inverse schematic is used to orchestrate a selling strategy as opposed to a buying one.

Block-chain

Naturally when creating orders, the two principles to work around are of course when to open and when to close. The issue is trading must also account for imperfect scenarios, like orders not opening filled at targets and being stuck.

There are 2 sets of decisions which must be made; for group orders and for single orders. A significant component of group orders especially, is the narrow window in which group orders should be closed and the necessary long term outlook encouraged by group orders being executed.

E.g. if a strategy requires you to close all buy orders at a profitable point, that means 70% of buy orders would have had to have been positioned in the right place. This leaves minimal room for error and increases difficulty for a profitable method.

Furthermore, if order sizes are variable then a single order can hold back many other orders in the same strategy’s methodology.

A simple strategy to account for utilising the trend in our favour, is the block-chain method.

The Block-Chain method involves opening the largest order at the start of the trend and successive orders in the same direction as the trend continues. Making it simpler to close smaller orders at the end of the trend, while also reducing risk of false signals. E.g. At the start of an uptrend a larger buy order of 2% of our balance can be opened and 0.2% orders as the uptrend continues. This allows for an easier group close when the trend starts to show weakness due to the more substantial profit (which has an order size that makes up most of your positions) being made from the beginning.

- Depicted above, the Block-Chain method is shown in full including even imperfect order opens, despite this the approach still performs very well.

- The largest order is opened at the beginning of the trend with the blue circle.

- Subsequent smaller orders are opened at intervals with red circles even on false signals.

With Block-Chaining, group orders can be closed at a substantial profit (with up to even 50% of orders opened in less than ideal places) once the trend shows weakness. To stay within a controlled risk paradigm, it’s best to approach trends 1 at a time, having too many orders open over various trends increases risk and lessens flexibility.

Big Order > Small Order > Small Order > Small Order > Small Order > Small Order > Group Close.

In addition to only opening orders for 1 trend at a time; through implementing a decision tree of 5 key areas, most strategies can be structured at a market ready level for opening and closing orders. It’s essential that a system knows how to act in all cases.

Realistically a trader needs to accept the fact that at times certain orders will turn a loss now and again. No strategy can execute at 100%, one must know when to allow orders to close at a loss and make up for profits in latter trends. In the example below:

If we are opening orders based on the short MACD and using the long MACD as the discriminator to filter a certain type of order (buy/sell), the orders in the highlighted red circle above would not perform well. The efficient approach would be to accept these and designate risk management in our strategy to close these losses before they’re significant and move forward. Trading is statistical, with losses being inevitable the important thing to accomplish is winning more than losing. The latter trends even in the chart above make up for these losses. Closing at losses allows capital to be available for when more favourable trends do resume and in general maintains sustainable equity.

Farming

In previous lessons strategies have incorporated a plan which constitutes an almost passive way of obtaining profit; controlled orders + a decision tree to account for as many scenarios as possible. In order to establish a strategy with more specific targets, we can implement a strategy called Farming.

We treat each order as a seed we wait to harvest. This would function as follows:

In a case where we have five different forex pairs and we are trading with 0.1 lot orders on 1:100 leverage (each pip is a 1\$ profit), let’s say we have \$1,000 at our disposal - We can therefore afford to make 100 orders with a goal of \$100 per day.

We can use an indicator like the MACD to open extensive orders on 2 different time frames for these five pairs, this would equate to 10 orders in this example. With this method, we set a goal for each order to make a minimal profit of 1\$ for example and do not wait for the trend to end. We are seeding long trends and harvesting at a large scale over many orders. Like a farmer who would plant seeds over a wide field, we are planting the entire chart and not focusing much on the market trend as our orders are very well spread.

- We can even use this strategy in conjunction with other strategies by allowing the trend to continue longer, obeying your entry principles but setting the limit to a \$1 minimal profit so orders do not close at loss.

If we plant the seeds on higher time frames, we very rarely can go below the \$1 minimal profit limit.

In the example above, we have both a Long MACD and a Short MACD to point to a particular type of order with the MACD as the discriminator for better confirmation. If the Long MACD is up buy, vice versa we sell. The short MACD allows for opening orders at different intervals.

With farming, there is no need to wait for the shorter trends to finish once we see our profit target, (in this case \$1) we can collect our profit and move on. This can be combined with the Block-Chain method to improve results over time. This order is effective because it requires minimal input, random orders can be opened on every candle. The higher distribution of capital allows for lower risk and the minimal profit target enables quick and easy profits in succession.

Chain Reaction

The chain reaction is a move which requires significant distribution of capital to perform effectively. When executed correctly, this is a dynamic strategy involving multiple time frames and trend layers. A Chain Reaction strategy can be viewed as a hybrid of the Block-Chain method.

Imagine we are using the following time frames: H1, M30, M15:

Over each time frame we have 3 MACDS complementing each other; the concept we are applying has to do with the fact that each MACD is capturing a different trend size. We will then move forward by executing nine different order sizes implementing a golden ratio of sorts with corresponding parameters.

H1 Total Order Size = 2X M30 Total Order Size, M30 Total Order Size = 2 X M15 Total Order Size MACD 1 - longer trend, MACD 2 - mid trend, MACD 3 - shorter trend MACD 1 Order = 2X MACD 2 and 4X MACD 3 / H1 Total Order Size = Both M30 and M15 total or double that.

We can illustrate this as follows: Order size on MACD 1 = 1 lot Following trend on MACD 2 in total = max 0.5 lots and as a result, MACD 3 = 0.25 max lots. A rule to follow - if we open an order of 0.01 lot for MACD 3 and a subsequent order follows on MACD 2 = 0.02(or even if they open in timing inversely) we therefore cannot open more than a total 0.5 lot in order size for the MACD2 and 0.025 for MACD 3.

In context: 1 order in MACD 1 = 1 lot = 1 order 0.05 in MACD 2 = 0.5 lot at 0.02 lots each = 25 orders max 0.025 in MACD = mean 2 orders per 1 trend of MACD 2 = 50 orders max

Our structure above does the job of defining our allowance, however this does not necessarily require us to extend the full depths of our limits each time we are executing the strategy. Across time frames we must ensure we do not execute total orders more than half the longest time frame on the 2 lower ones. What we will see as the strategy performs is naturally, the shorter MACD on the lowest relative time frame closes faster than the time frame above it, and each higher time frame follows in a Chain Reacting order.

The higher time frames act as protection over the lower time frames in terms of order size and equity levels.

Orders can be closed in a variety of ways such as, setting higher goals for larger orders and smaller goals for the smaller orders via the Farming method taught previously. Allocating specific targets to a complex strategy would allow it to perform without raising complexity and potentially risk too.

When this strategy is performed it is essential that each pair is acting separately from one another over the closing stage, this allows for flexibility in equity and adjustments where necessary.

The Chain Reaction method applies a wide variety of distribution and frequency levels, so this can be accomplished with a small market risk when performed effectively.

Take note that, the bigger orders cannot be closed without closing the smallest orders first. Secondly, when a large order is closed, we cannot then open smaller orders on the same trend, we must wait for the next trend to ensue.

Above we have a chart showing the strategy in action with the red highlighted areas over the chart. The Longest MACD = Double the Middle MACD and the Shortest MACD = half the Middle MACD.

Event Horizon

Here we begin by picking a trend which is long enough for our capital, we have a simpler entry point through this strategy as no other components like trend length and complementing trends need to be considered at the beginning here.

If we refer to the chart above, what we are setting out to do is after opening our master order at the start of an MACD trend, instead of waiting for signals we set a pip distance in our strategy to open successive orders as the trend continues. L for largest order M for mid order and S for small order

By setting a pip distance we need not worry about the small discrepancies along the trend. With the general trend direction, the predefined distances will continuously open orders.

The beginning master order acts as the centre of the black hole and the S orders act as risk assessment orders of when to close. Orders will continuously be opened until the price hits a previous M where all orders should be closed. The centre of the black hole is larger than the following orders as it carries most of the risk while we continuously scale with smaller orders. Incredibly, with this approach we are using orders to complement our strategy as opposed to opening orders arbitrarily when the discriminator is open.

Being a more advanced strategy there are various benefits and drawbacks which come along with this type of execution. What is an advantage to us is longer trends are easy to find to open our initial master order and every successive order protects the next (each segment protects the prior segment in the hierarchy of orders). Essentially, As our profit potential increases, our risk actually decreases. With orders being our ‘indicators’ this is truly easy to implement as we simply target an amount we want to achieve and execute a black hole at trend. With the correct order sizes, our target can be achieved relatively simply.

There are issues to consider too: the fact of the matter is the trends we open must be longer term trends and therefore this is a higher time frame strategy. The initial order taking on the majority of the risk must be executed correctly. 8/10 trends should be a long enough trend for this strategical structure. It takes time for the market to reach an event horizon and subsequently be manipulated towards our strategy’s execution; we must entertain the waiting game till a trend is ‘sucked in’ to our black hole.