GET /stories/api/?format=api
HTTP 200 OK
Allow: GET, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "count": 17,
    "next": "https://www.pagoolabs.com/stories/api/?format=api&page=2",
    "previous": null,
    "results": [
        {
            "url": "https://www.pagoolabs.com/stories/api/58/?format=api",
            "id": 58,
            "title": "Trading AUD.JPY Using Heikin Ashi on the Four Hour Timeframe",
            "slug": "trading-audjpy-using-heikin-ashi-on-the-four-hour-timeframe",
            "status": 2,
            "publication_date": "2018-01-08T05:11:16Z",
            "lead": "Here is a very simple forex trading system using the example of AUD.JPY and Heikin Ashi to determine entry signals. This is meant only as an exercise to aid in implementing your own system, with or without Heikin Ashi (HA).",
            "excerpt": "A forex trading system using the example of AUD.JPY and Heikin Ashi to determine entry signals.",
            "poster": "SeanManefield",
            "content": "---\r\nFirst let's take a look at the long term chart of AUDJPY, going back to before the 2008 financial crisis.\r\n![AUDJPY MN1](/media/uploads/2017/Forex_Setups/2017-11-27_AUDJPY_MN1.jpg \"AUDJPY MN1\"):C90\r\n\r\nThe first thing that stands out is the lack of any meaningful trend. All the price action has been contained within the extremes of the 2008 event. [In an earlier story](/stories/44/2017/10/24/trading-systems-part-2-timeframes-fundamentals-reversals-and-retracements/#shorter-timeframes) I discussed how to move to a shorter timeframe when no trend was clear on the current one.\r\n\r\nThe weekly is just as aimless, while the daily timeframe has been sideways throughout 2017 with distinct legs up and down. From mid September we saw a good run down on the daily but not enough for the 100 and 200 period moving averages to confirm any down trend.\r\n![AUDJPY D1](/media/uploads/2017/Forex_Setups/2017-11-27_AUDJPY_D1.jpg \"AUDJPY D1\"):C80\r\n\r\n\r\nIf we focus just on the daily chart and the leg down that started mid September 2017, marked **A** above, we could say that we have some evidence that a down trend is underway. Now, obviously, this is not enough evidence to short this daily AUDJPY, but it may be supporting evidence for a shorter timeframe. By the time the chart ends in early January 2018, it becomes clear there was no down trend, just a continuation of the sideways behavior noted above.\r\n\r\nHowever on October 24th the market stamped out a lower high and an HA reversal. As I have pointed out in earlier stories, reversals only make trading sense in the presence of a trend. On October 24th, we did not know the future so the question was, what were the consequences of using this information on a shorter timeframe, say the H4?\r\n\r\nThe supporting evidence is not strong enough to support a trade placed here but given that our earlier stories written around this time used the AUDJPY pair as an example, let's investigate further.\r\n\r\nTo be consistent we would have to close out any short trades still open in our *system* as soon as the daily HA reverses upward (turns green). That happened on November 30th. So we are looking to trade short in the period October 24th until November 30th inclusive.\r\n![AUDJPY H4](/media/uploads/2017/Forex_Setups/2017-11-27_AUDJPY_H4_HA.jpg \"AUDJPY H4\"):C100\r\n\r\nHere, as in the earlier stories, I am assuming a risk-return multiplier of four. This means we automatically close winning trades when they reach four times risk. Whichever method you use to calculate TP, it should emerge from the [simulation step](/stories/48/2017/10/24/trading-systems-part-6-simulations-on-systems/) where it is the optimum multiplier for a large number of simulations in your market of interest. In the cases I have examined using Heikin-Ashi reversals in a trending forex market, that key risk multiplier is a little less than four. I will continue using four below, but your optimal multiplier will depend on your precise strategy. Calculating the risk multiplier is discussed [here](/stories/48/2017/10/24/trading-systems-part-6-simulations-on-systems/).\r\n\r\nLooking at the H4 Heikin Ashi above, we can see the shorting period extracted from the daily. The first thing to note is that the period critically satisfies some of the basic down trend characteristics we have seen in a number of our earlier stories:\r\n\r\n* the MA100 has already crossed below the MA200, indicating a down trend\r\n* both MAs are sloping down\r\n* the longer timeframe, as mentioned above, is in a Heikin-Ashi down trend.\r\n\r\nLooking over all the Heikin Ashi reversals around the shorting period, we have 8 possible trade setups to consider. Not all of them will result in a trade:\r\n\r\nSetup number |   Trade Comments\r\n-------------| ----------------------------------------\r\n1 | Not opened - before the short period starts\r\n2 | Not opened - before the short period starts\r\n3 | Not opened - red bar is not after a retrace\r\n4 | Not opened - red bar is not after a retrace\r\n5 | Not opened - red bar is not after a retrace\r\n6 | Opened - results in a win of 4 x risk\r\n7 | Opened after #6 closes - loss after failing to trigger TP\r\n8 | Not opened - after the short period ends\r\n\r\nIf some of these comments are confusing, you might like to look back on [earlier stories where the basic trade setup filters](/stories/45/2017/10/24/trading-systems-part-3-signals/edit/#Rules-and-Filters) are covered. Remember that while #6 is open, no other trades can be simultaneously opened otherwise the trade risk will be greater than 2% of our funds.\r\n\r\nBecause the daily HA reversal does not finish until close of trading on November 30th, all open shorts should be closed at the open on December 1st. Following this rule, the final trade would be a gain of about 1.5 times risk rather than a loss but I will count it as a loss so as not to inflate the success of the strategy and also because until now I have always advocated holding until the SL or the TP has been triggered. I have not yet discussed any other reason to close early because, quite frankly, getting into the habit of closing open trades for any other reason is a killer of trading profits.\r\n\r\nAlthough the longer timeframe indicated a down trend, the H4 only allowed two trades to open, one win and one loss. However, and this is a key to successful trading, the win was greater than the loss. In this case the win was four times the only loss, resulting in the strategy winning three times your allocated risk. If you allocated 2% of your funds at risk to this strategy, you just made 6%. Not bad for five weeks.\r\n\r\nNowhere here do I advocate you follow such a naive Heikin Ashi reversal system. The point is to show you how to construct your own without relying on expensive, black-box Expert Advisors which often times simply drain your account.\r\n\r\nSo what happens after the daily reverses up, do we continue the strategy by trading longs on the H4? I leave that as an exercise for you. However, while you may be able to eke out a trading profit doing this, trading the AUDJPY at the H4 timeframe will remain hampered by the fact that this currency pair is not trending at longer timeframes.\r\n\r\nAs you can see, this systems approach depends on the trend and highlights the importance of correctly identifying which direction the market is trading. It is an important clue that successful trading requires putting more effort into trend analysis than jumping from one indicator to another. The Heikin Ashi signal used here is not a required indicator. You could almost use any other. All that is required is that you open each trade *consistently* and follow all the rules you have already established in the [simulation testing stage.](/stories/48/2017/10/24/trading-systems-part-6-simulations-on-systems/)\r\n\r\nCopyright (C) PagooLABS 2018. All Rights Reserved.\r\n\r\n\r\n*[SL]: stop loss\r\n*[TP]: target price\r\n*[OP]: open price\r\n*[HA]: Heikin Ashi\r\n*[H4]: Chart of the four hour timeframe",
            "image": null,
            "forums": "Not linked to a forum",
            "replies": 9
        },
        {
            "url": "https://www.pagoolabs.com/stories/api/57/?format=api",
            "id": 57,
            "title": "Examples of how to Manage Risk in a Forex Trade Using AUD.JPY and AUD.USD",
            "slug": "examples-of-how-to-manage-risk-in-a-forex-trade",
            "status": 2,
            "publication_date": "2017-11-27T23:56:40Z",
            "lead": "How to manage a forex trade so that the risk and the risk-reward of the trade is set in advance, using the examples of AUD.JPY and AUD.USD.",
            "excerpt": "Managing a Forex trade using the examples of AUD.JPY and AUD.USD that set the risk and the risk-reward of the trade in advance.",
            "poster": "SeanManefield",
            "content": "---\r\nOur [previous story](/stories/51/2017/11/27/trading-audjpy-in-a-heikin-ashi-forex-system/) on risk in forex markets went over the definitions of the <small><strong>base.quote</strong></small> currency ticker format and how the quote defines the currency the contract is valued in. In this story I will go through a couple of specific examples to show how to correctly value any forex contract and have it priced in the same currency you use for your accounts.\r\n\r\nTo begin, imagine you are a United States Dollar (USD) account holder and you want to value a contract to sell <small><strong>AUD.JPY</strong></small>. I am extending the work we went through in an earlier story on the [dollar risk of one futures contract](/stories/41/2017/10/24/the-basic-setup-part-4-risky-contracts/#Dollar-risk-of-one-contract) by adding the currency conversion rate and converting the quoted currency back to the account currency.\r\n\r\nWe will use the trade data indicated in the following H4 chart of the AUDJPY:\r\n![AUDJPY H4](/media/uploads/2017/Forex_Setups/2017-11-27_AUDJPY_H4_HA_zoom1.jpg \"AUDJPY 4H\"):C90\r\n\r\nHere is the trade from the highlighted setup, with the actual open price and stop loss:\r\n\r\n<a id=\"basic-setup-for-audjpy\">\r\n#### **Example 1. The Basic Setup for AUD.JPY**\r\n\r\n    Risk per AUD.JPY Contract for a Sample Trade\r\n        OP = 87.605                    Open Price in Yen\r\n        SL = 88.115                    Stop Loss in Yen\r\n        CS = 100,000                   Contract Size\r\n        CR = |OP - SL| x CS            &#165;Contract Risk (absolute value)\r\n           = |87.605 - 88.115| x 100K\r\n       &#165;CR = &#165;51,000                   Risk in Yen\r\n       $CR = &#165;51,000 x JPY.USD         Risk in USD\r\n\r\nThis last statement says that the risk in dollar terms is equal to the risk in yen multiplied by the cost of each yen. Because there is normally no traded <small><strong>JPY.USD</strong></small>, we have to *synthesize* it from:\r\n\r\n    JPY.USD = 1 / USD.JPY\r\n\r\nThis simply says if the market for <small><strong>USD.JPY</strong></small> is currently trading at 100 then 1000 Yen is worth exactly $10 when valued in US$:\r\n\r\n        $value = &#165;1,000 x (1 / 100)    Where 100 is the USD.JPY rate.\r\n               = $10                   In USD\r\n\r\nThese calculations are good enough here, but programmers will have to adjust the equations further by swapping the bid/ask rates:\r\n\r\n    JPY.USD(bid) = 1 / USD.JPY(ask)\r\n    JPY.USD(ask) = 1 / USD.JPY(bid)\r\n\r\nand applying each one correctly depending on whether the adjustment is for a buy (use the ask) or a sell (use the bid). That's a little too much detail for a non-programming article like this so let's just abstract away from the bid/ask for now to stay focused on the general idea.\r\n\r\nAt the time of the trade above from 2017-11-03 00:00 (written in [24 hour time](/stories/50/2017/11/09/where-does-the-day-begin-in-24-hour-trading/), the <small><strong>USD.JPY</strong></small> mid close price was 113.95. Using this to value the contract in US$, gives us:\r\n\r\n    JPY.USD = 1 / 113.95\r\n            = 0.0088\r\n        $CR = &#165;CR x JPY.USD             Risk in USD\r\n            = &#165;51,000 x 0.0088\r\n            = US$448.80                 Risk per contract in US$\r\n\r\nWhat if your account is based in a currency other than US$? In this example so far we have used the inverse of <small><strong>USD.JPY</strong></small> to convert the Yen profits and losses to US$. If you are in another currency, say <small><strong>XYZ</strong></small>, you have two choices. The simple method is to find a direct currency pair from Yen to your currency, such as <small><strong>EUR.JPY</strong></small>, and replace the <small><strong>JPY.USD</strong></small> in the formula above with 1/<small><strong>EUR.JPY</strong></small>. In general you are looking for either <small><strong>XYZ.JPY</strong></small> or <small><strong>JPY.XYZ</strong></small>. In the case of the latter, there is no need to invert it beforehand.\r\n\r\nThe second method, useful when no direct cross exists between Yen and your account currency XYZ, is to add an extra step above after calculating the US$ contract risk. This step converts the US$ amount into your local currency. Every currency in the world should have a forex pair linking its currency to the USD, either <small><strong>XYZ.USD</strong></small> or <small><strong>USD.XYZ</strong></small>. If it is the former than invert it to arrive at the rate that converts US$ values into your account currency: <small><strong>USD.XYZ</strong></small>.\r\n\r\n       &#165;CR = &#165;51,000                        Risk in Yen\r\n       $CR = &#165;51,000 x JPY.USD              Risk in USD\r\n        CR = $CR x USD.XYZ                  New: Risk in your XYZ currency\r\n\r\nYou now have the value of one contract in the same currency as your account. Just continue on below, but substitute your currency symbol for the $ sign.\r\n\r\nWe now have enough information to calculate the number of contracts to open.\r\n\r\nAn [earlier story](/stories/40/2017/10/24/the-basic-setup-part-3-risky-trades/) showed how to calculate the amount we could invest in a trade without risking more than 2% of our available risk capital. Assuming $100K to invest, we therefore have $2,000 available for this trade. Now finally we can calculate the number of contracts to buy:\r\n\r\n    Number of contracts = ($Funds at risk) / ($risk per contract)\r\n                        = 2000 / 448.80\r\n                        = 4 contracts\r\n       Cost of position = $1795.20    from: 4 contracts x $448.80\r\n\r\n\r\n<a id=\"basic-setup-for-audusd\">\r\n#### **Example 2. The Basic Setup for AUD.USD**\r\n\r\nIn this example, because <small><strong>AUD.USD</strong></small> is priced in US$, US account holders can view the entire setup as a normal US$ futures contract with a contract size of 100K. But non-US traders will need to convert the US$ contract risk back to their own account currency. Here we consider the case of a trader with Yen accounts, but you could just as easily substitute Euros or any other account currency.\r\n\r\n    Risk per AUDUSD Contract for a Sample Trade\r\n        OP = 0.76910                   Open Price in US$\r\n        SL = 0.77310                   Stop Loss in US$\r\n        CS = 100,000                   Contract Size\r\n       $CR = |OP - SL| x CS            $Contract Risk (absolute value)\r\n           = |0.76910 - 0.77310| x 100K\r\n       $CR = US$400                    Risk in USD\r\n       &#165;CR = US$400 x USD.JPY          Risk in Yen\r\n           = US$400 x 113.95\r\n           = &#165;45,580\r\n\r\nThe second last statement says that the risk in yen terms is equal to the risk in US$ multiplied by the cost of each US$ valued in yen. So in this case we have US$400 and each US$ costs &#165;113.95.\r\n\r\nNow assume the Japanese trader has &#165;10,000,000 worth of risk funds in a Yen account to invest, of which only 1% or &#165;100,000 can be invested in any one trade.\r\n\r\n    Calculate the Number of Contracts From Funds Held In Yen:\r\n    Number of contracts = &#165;Funds at risk / &#165;risk per contract\r\n                        = &#165;100,000 / &#165;45,580\r\n                        = 2 contracts\r\n       Cost of position = &#165;91,160    from 2 contracts x &#165;45,580\r\n\r\n\r\n#### **The Account Currency Conversion is Only Needed to Calculate Position Size **\r\n\r\nTo determine whether the trade hits the target or is stopped out, we only need the contract risk which is provided by the SL and open price. The RR multiplier provides a simple way of getting a TP. So we do not need to mess with quote or account currencies. However whenever we need to calculate the number of contracts in order to open a trade, we need to go through the calculations above.\r\n\r\nAnother way of doing this is to calculate the value of one pip per contract in the forex rate you are opening. Then multiply that by the number of pips at risk and calculate the number of contracts to be opened. It's the same formula, just executed in a slightly different order.\r\n\r\nIt is very important to know what you are doing if you want to limit your risk, hence the calculations above. However, you can save yourself a lot of hassle by using one of the many free online calculators. Just search on \"forex calculator\" when you need one. Here are two to get you started:\r\n\r\n**Forex Calculators:**\r\n\r\n- [IC Markets](https://www.icmarkets.com/advanced-trading-tools/forex-calculators/)\r\n- [OANDA](https://www.oanda.com/forex-trading/analysis/profit-calculator/)\r\n\r\n#### **Conclusion**\r\n\r\nI have explained the general format of a currency pair, <small><strong>Base.Quote</strong></small>, and how to assess it as units of the base priced in the quote currency. We walked through how to convert the risk from the quote currency into your local account currency. Finally we were able to calculate the number of contracts to open while at the same time limiting our risk to a small percentage of our risk funds.\r\n\r\nWith this background in forex contracts we are now ready to consider how we might go about building a simple forex system. That will be the subject of our next story. Stay tuned.\r\n\r\n\r\nCopyright (C) PagooLABS 2017. All Rights Reserved.",
            "image": null,
            "forums": [
                {
                    "url": "https://www.pagoolabs.com/forums/api/trading-education/?format=api",
                    "title": "Trading Education"
                }
            ],
            "replies": 3
        },
        {
            "url": "https://www.pagoolabs.com/stories/api/51/?format=api",
            "id": 51,
            "title": "How to Manage Risk in a Forex Trade",
            "slug": "trading-audjpy-in-a-heikin-ashi-forex-system",
            "status": 2,
            "publication_date": "2017-11-27T23:46:40Z",
            "lead": "How do we manage a Forex trade so that the risk is fixed and we know the risk-reward of the trade in advance?",
            "excerpt": "How to manage a Forex trade so that the risk is fixed and you know the risk-reward of the trade in advance. Trading AUDJPY in a Heikin Ashi Forex System.",
            "poster": "SeanManefield",
            "content": "---\r\n\r\nForex trading is only a little different to trading any other type of security. In this story I show you the main differences so you can apply a systems method to trading currencies. To illustrate, in the next story I will apply the method described below to <small><strong>AUD.JPY</strong></small>, the cross between the Australian Dollar and the Japanese Yen.\r\n\r\nForex trading is conducted in the relatively unregulated interbank market where individual banks conduct foreign currency business over the phone or via networked quote entry systems. These quotes are accumulated by several vendors and distributed back to the banks as well as via trading systems to worldwide forex traders. A very common platform for individual traders is Metatrader which is widely available for free once you've opened a trading or a demo account.\r\n\r\nIn an earlier story on [how to set up a trade in the futures market](/stories/41/2017/10/24/the-basic-setup-part-4-risky-contracts/), I showed the [different sizes for various futures contracts](/stories/41/2017/10/24/the-basic-setup-part-4-risky-contracts/#common-contract-sizes). To recap, forex contracts are typically 100,000 units of the base currency and the price for each unit of the base is displayed in units of the quote currency. Currencies are displayed here in the format:\r\n\r\n    BaseFX.QuoteFX\t\t\t\t\r\n    where:\r\n       BaseFX is the currency which is being bought or sold.\r\n       QuoteFX is the currency the contract is priced or quoted in.\r\n       The Quote currency is also called the Counter currency.\r\n\r\nFor example, we write <small><strong>AUD.JPY</strong></small> for the purchase of contracts of AUD valued in JPY or Japanese Yen. Other common ways you will see <small><strong>BaseFX.QuoteFX</strong></small> pairs displayed are <small><strong>AUDJPY</strong></small> and <small><strong>AUD/JPY</strong></small>.\r\n\r\nOften the joining dot or period is replaced with a division symbol or omitted altogether. In the text below I use a period to help make the relation clearer.\r\n\r\n<a id=\"common-contract-sizes\"></a>\r\n\r\nBASE.QUOTE   |   Contract Size   |   Priced In\r\n-------------|:-----------------:|---------------------\r\n   <small><strong>AUD.JPY</strong></small>   |   100K Australian Dollars   |   Japanese Yen\r\n   <small><strong>AUD.USD</strong></small>   |   100K Australian Dollars   |   US Dollars\r\n   <small><strong>USD.CAD</strong></small>   |   100K US Dollars |   Canadian Dollars\r\n   <small><strong>USD.JPY</strong></small>   |   100K US Dollars |   Japanese Yen\r\n   <small><strong>EUR.USD</strong></small>   |   100K Euros      |   US Dollars\r\n\r\nAlthough the *normal* contract size is 100,000 units (100K), many brokers allow fractional quantities served up in mini sized contracts of 10K or even 1K units.\r\n\r\n<a id=\"<a id=\"how-do-base-and-quote-currencies-work\"></a>\r\n#### How do Base and Quote Currencies Work\r\n\r\nWhat makes Forex a little confusing is that there are at least two currencies involved, and often a third - your **account currency**. Let's walk through them one at a time.\r\n\r\nThe **base currency** sounds like a price but it is actually a commodity you can buy or sell, like an apple. And just like an apple, this commodity has a price quoted, but in another currency called, naturally enough, the **quote currency**. Just as an apple costs, say $0.50c, a unit of AUD costs a given amount determined by the current market. For the <small><strong>AUD.JPY</strong></small> contract, at the time of writing, one AUD costs 84.50 Japanese Yen. It is priced in Yen because Yen is the *quote* currency that follows after the period.\r\n\r\nIf you have a trading account, it will be set up in at least one currency called the account currency. When you make a trade, your profits and losses usually accumulate in the quote currency and are converted via a separate transaction to your account currency.\r\n\r\nThat's different to the case where you set out to buy or sell a foreign currency for its own sake, either to purchase from or sell an item to a foreign entity. In this latter case you would take delivery of the foreign currency, the AUD. Your trading account may or may not allow delivery. In the same way, trading futures usually resolves as a cash transfer, not the delivery of wheat or pork bellies.\r\n\r\nSince your trading account is probably a margin account, to open a long position in <small><strong>AUD.JPY</strong></small>, you will be borrowing the Yen to sell in order to buy the AUD. You will pay interest on the Yen and receive interest on the AUD until you close the long position.\r\n\r\nThe <small><strong>AUD.USD</strong></small> contract, on the other hand, quotes the price of one unit of AUD in US Dollars. The current price of one AUD is US$0.7602. Notice the extra decimal places after the usual cents ($0.76**02**)? Each currency has a standard number of decimal places for every market price quote. These are called pips, from *Point In Percentage*. For the AUD four decimal places are displayed in every price quote. If the AUD increases from US$0.7600 to 0.7602 we say that it increased by two pips. That is, the AUD has become slightly more expensive to a US buyer, just as an increase in the price of an apple makes it more costly.\r\n\r\nQuote currencies that do not trade in the street with decimals, such as the Yen and formerly the Italian Lira, will probably only have two decimals places reserved to display pips. For example, the <small><strong>AUD.JPY</strong></small> is quoted as 84.50.\r\n\r\nDepending on your quote platform, you will probably see an extra 5th (and 3rd for Yen) decimal place quoted along with the above four because many vendors provide half pips and smaller. These are sometimes called *pipettes*, or more commonly just \"half a pip\", and written as 0.7602**5**.\r\n\r\nWe will need to go through these numbers in depth so that we can place a trade, but first let's look at the obvious question here:\r\n\r\n<a id=\"which-currency-is-the-quote\">\r\n##### **What Determines Which Currency is the Base and Which is the Quote?**\r\n\r\nWhy is the AUD contract expressed as <small><strong>AUD.USD</strong></small> but the Japanese and Canadian contracts written in terms of the non USA currency, <small><strong>USD.CAD</strong></small> and <small><strong>USD.JPY</strong></small>? Why is the Euro written as <small><strong>EUR.USD</strong></small> and not <small><strong>USD.EUR</strong></small>? Well the short answer is that you can write them any way you like providing there is a market and your broker supports those reverse contracts. However, most if not all quote vendors express the contracts in the same ratios I use here.\r\n\r\nBASE.QUOTE   |  Quoted in\r\n-------------|-------------\r\n   <small><strong>AUD.JPY</strong></small>   | Yen\r\n   <small><strong>AUD.USD</strong></small>   | US$\r\n   <small><strong>USD.CAD</strong></small>   | Canadian $\r\n   <small><strong>USD.JPY</strong></small>   | Yen\r\n   <small><strong>EUR.USD</strong></small>   | US$\r\n   <small><strong>EUR.CHF</strong></small>   | Swiss Francs\r\n   <small><strong>USD.CHF</strong></small>   | Swiss Francs\r\n   <small><strong>USD.MXN</strong></small>   | Mexican pesos\r\n   <small><strong>USD.CNH</strong></small>   | Chinese Renminbi or Yuan (offshore)\r\n\r\nThe long answer is murkier and almost lost in the history of forex markets. Given my four decades or more working with Forex, I describe my own beliefs on the origin of the currency ratios [here](/stories/56/2017/11/29/what-determines-which-currency-is-the-base-and-which-is-the-quote/), but I am by no means 100% certain. TL;DR I suggest it's because of the ratio of one currency to the other. If a currency back in the 1970s traded consistently under one US$, especially the Italian Lira or the Yen, it was designated the quote currency and vice versa. Today we just keep using the established contract tickers for historical reasons.\r\n\r\n\r\n<a id=\"significance-of-the-quote-currency\">\r\n#### **The Significance of the Quote Currency**\r\n\r\nThe quote currency is the currency of the trade. It is the amount paid or received for buying or selling one unit of the base currency. If you are based in the USA and the quote currency is also the USD, such as <small><strong>AUD.USD</strong></small>, then you can value the contract in the same way as any US futures or equity position. You will receive USD if a long postion rises in value or pay out USD from your account if the position falls.\r\n\r\nYou are simply buying or selling units of AUD like any other commodity. In the special case of USD as the quote currency for US accounts, currencies do not really enter into the calculations!\r\n\r\nYour local currency is your account currency, the currency in which you add up your profits and losses. It might or might not be the quote currency.\r\n\r\nNone of this matters if you are simply looking for signals on the chart because then you are only concerned with the open, stop and target prices and the RR multiplier between risk (OP - SL) and reward (TP - OP). However as soon as you want to open a position, you will need to know the number of contracts. That's when the calculations below come in handy.\r\n\r\nIf the quote currency is not your account currency then the trade will lead to a certain amount of foreign currency flowing into or leaving your account each day as the position is marked to market. Your broker may automatically convert those winnings or losses into your account currency for a fee, but the mechanism remains the same.\r\n\r\nWhen you calculate the trade setup, you must take into account the conversion of the amount at risk to your account currency so that you can compute the number of contracts to open. You will remember from the first series on [The Basic Setup](/stories/41/2017/10/24/the-basic-setup-part-4-risky-contracts/) that the value of the risk per contract is divided into funds at risk in order to calculate the position size:\r\n\r\n    Number of contracts = ($Funds at risk) / ($risk per contract)\r\n\r\nThe funds at risk are normally 1% to 2% of your risk capital.\r\n\r\nSince the funds at risk are in your account currency, you must convert the amount at risk in the trade into that same currency. This step was not required when you were [buying futures](/stories/41/2017/10/24/the-basic-setup-part-4-risky-contracts/#Dollar-risk-of-one-contract) because there I only discussed futures priced in your local currency. Here we have to convert the risk value back to your local currency. None of this arithmetic is hard but because of the multiple currencies it is no doubt tricky to get your head around. To help, I will do a couple of examples below.\r\n\r\nKeep in mind what I wrote above about how the currencies are quoted - we need to know which currency is used to value the contract whenever we discuss a forex pair. It is always the quote currency on the right hand side.\r\n\r\nI will take the example of <small><strong>AUD.JPY</strong></small> and consider our account currency to be the USD. This works just as well for anyone whose account currency is not JPY. Just replace the conversion from Yen to US$ with your Yen/local rate. I will show you how to do that below. For JPY account holders, this position is just like any other domestic Japanese security priced in Yen except it has a contract size of 100K. Yen account holders should refer below to the <small><strong>AUD.USD</strong></small> example 2.\r\n\r\nAUD account holders could take a short cut and use the inverse of the market price of <small><strong>AUD.JPY</strong></small> at OP and SL to calculate the risk in AUD.\r\n\r\n\r\nLet's look at those examples now in our next story [Examples of how to Manage Risk in a Forex Trade](/stories/57/2017/11/27/examples-of-how-to-manage-risk-in-a-forex-trade/).\r\n\r\n\r\n\r\nCopyright (C) PagooLABS 2017. All Rights Reserved.",
            "image": null,
            "forums": [
                {
                    "url": "https://www.pagoolabs.com/forums/api/trading-education/?format=api",
                    "title": "Trading Education"
                }
            ],
            "replies": 0
        },
        {
            "url": "https://www.pagoolabs.com/stories/api/54/?format=api",
            "id": 54,
            "title": "What Determines Which Currency is the Base and Which is the Quote?",
            "slug": "what-determines-which-currency-is-the-base-and-which-is-the-quote",
            "status": 2,
            "publication_date": "2017-11-27T04:10:34Z",
            "lead": "What do the Forex ticker symbols mean in foreign currency trading and how to understand Base Currency, Quote Currency and Account Currency.",
            "excerpt": "We explain what the Forex ticker symbols mean in foreign currency trading and how to understand Base Currency, Quote Currency and Account Currency",
            "poster": "SeanManefield",
            "content": "---\r\n\r\n<a id=\"base-vs-quote\">\r\n##### **Base vs Quote**\r\n\r\n\r\nForex contracts are expressed as a pair of foreign currencies such as <small><strong>AUD.JPY</strong></small> where the first currency is the Base currency and the second is the Quote currency. The base describes the commodity itself, just like oil, gold or Intel stock (INTC). The forex contract is priced in units of the quote currency.\r\n\r\nFor example, an ask price of 84.75 for <small><strong>AUD.JPY</strong></small> tells you that one Australian Dollar will cost you 84.75 Japanese Yen to buy.\r\n\r\nIf your accounts are in Euros or USD then neither the base nor the quote of <small><strong>AUD.JPY</strong></small> is the same as your account currency. Your account currency would be Euros or USD in this case. A trading account will normally stipulate which currency your trading is based in and realized wins and losses from trading <small><strong>AUD.JPY</strong></small> will need to be converted to it.\r\n\r\n![Typical Forex Contracts](/media/uploads/2017/Forex_Setups/Typical_FX_contracts.jpg \"Typical Forex Contracts\"):R28\r\n\r\n  BASE.QUOTE |  Quoted in:\r\n-------------|-----------\r\n   <small><strong>AUD.JPY</strong></small>   |  Yen\r\n   <small><strong>AUD.USD</strong></small>   |  US$\r\n   <small><strong>USD.CAD</strong></small>   |  Canadian $\r\n   <small><strong>USD.JPY</strong></small>   |  Yen\r\n   <small><strong>EUR.USD</strong></small>   |  US$\r\n   <small><strong>EUR.CHF</strong></small>   |  Swiss Francs\r\n   <small><strong>USD.CHF</strong></small>   |  Swiss Francs\r\n   <small><strong>USD.MXN</strong></small>   |  Mexican Pesos\r\n   <small><strong>USD.CNH</strong></small>   |  Chinese Renminbi or Yuan\r\n\r\nHave you ever wondered why the AUD contract is expressed as <small><strong>AUD.USD</strong></small> but the Japanese and Canadian contracts are defined in terms of the non USA currency, <small><strong>USD.CAD</strong></small> and <small><strong>USD.JPY</strong></small>? Why is the Euro written as <small><strong>EUR.USD</strong></small> and not <small><strong>USD.EUR</strong></small>?\r\n\r\nThe short answer is that you could write them any way you like providing there is a market and your broker supports those reverse contracts. However, most if not all quote vendors express the contracts in the same ratio we use here.\r\n\r\nThe long answer is that, except for the recent Euro, the reasons are many and fuzzily recalled. I have my version of the story to tell based on my own experience working with foreign currencies since the 1970s.\r\n\r\nBack in the dark ages, when researchers would enter data into mainframe computers using stacked decks of cards, there were many more European currencies than today. There were French and Belgian Francs, German DMarks, Italian Lira and many more. Some currency crosses were quoted in one fashion on one side of an international border but quoted in the reverse direction on the other side.\r\n\r\nThe preferred way to quote a currency for US traders or tourists should be just like the <small><strong>AUD.USD</strong></small>. When expressed this way, it gives the price of an Australian Dollar in the same way as the price of an apple: in the locally used US currency. On the other hand, it is less transparent for Australians who see a price quote that is slightly more confusing: how many US$ they get for one A$. That's like seeing how many apples you can buy for $1 instead of the price of one apple.\r\n\r\nBut the real problem was that currencies are rarely related by the same order of magnitude. So there might have been five Francs to the USD, three DMarks or 200 Yen but much more rarely 1.1 or 0.9 units of foreign currency. My memory is that the issue was resolved partially by aesthetics alone: it was never convenient to enter error prone numbers onto punched cards when the forex quote looked like a fractional 0.00512 US Dollars for one Japanese Yen.\r\n\r\nI remember handling currencies using both the normal and the reverse ratio but I and those around me mostly favored the quote where a digit other than zero was on the left hand side of the decimal point. It just felt better, and it was easier to check on the old printouts where decimals were hard to read. No doubt, the older traders around us felt the same way, although it was never discussed, as far as I can recall.\r\n\r\nUp until the early 1980s, one Australian Dollar cost more than one US Dollar. Other than the name, the two currencies developed independently of each other. There is no requirement for the two to trade at parity or any level other than what's determined in the market. The Australian Dollar derived from the Australian Pound (two dollars for every one Pound in 1966) which in turn had earlier derived from the British Pound. The British Pound in turn cost about US$5 through the 19th century until the turmoil of the First World War. Today each Pound costs roughly US$1.33 and is quoted as <small><strong>GBP.USD</strong></small>.\r\n\r\nThe Canadian Dollar traded around parity in the 1970s but closed out that decade around C$1.20 to US$1 so the quote was reversed to look like <small><strong>USD.CAD</strong></small>, with a quote something like 1.20. Had it been the other way around <small><strong>CAD.USD</strong></small> would have been 0.83, less aesthetically pleasing on the old printouts and terminals and slightly more error prone, although not as bad as the Yen or Italian Lira would have been.\r\n\r\nIf you follow all the currencies back to the 1970s you will notice a pattern where the currency with the greater number of units in comparison is usually placed on the right hand side as the quote currency. So the Yen is expressed as <small><strong>USD.JPY</strong></small> where there are today over 110 Yen to one USD.\r\n\r\nI believe we inherit today whichever pattern was common up to the 1970s when computer databases froze the prevailing ratios. This is true even for currencies like the AUD which have more since fallen below one US$. Modern computers with clear screens easily displaying the decimal point or comma mean we don't need to worry about those old punched card concerns anymore, but we do continue to use the ratios that were convenient in earlier times.\r\n\r\n<a id=\"what-about-the-euro\">\r\n\r\n##### **What About the Euro?**\r\n\r\nWhen the single currency was introduced the European Union insisted it had to be quoted <small><strong>EUR.USD</strong></small> and not the reverse. It could be that they hoped the USD would be worth less than the Euro, as a matter of pride perhaps, but I don't think so. For Europeans, the natural way of expressing the currency if you had a choice about it or, as in this case, if you were imposing the ratio by fiat, would be to set <small><strong>USD.EUR</strong></small> as the standard. That would mean European tourists and traders would approach a foreign exchange counter and purchase US$ priced in their local Euro currency, just as they would apples or anything else.\r\n\r\nIn the same way as Europeans express a desire to price oil in Euros, they would price USD in Euros. It would make the most sense and be easier for them to discern value. But they didn't.\r\n\r\nI believe the decision was poorly thought through. I think some Europeans saw the <small><strong>GBP.USD</strong></small> and compared that to their own French Francs (<small><strong>USD.FRF</strong></small>) or Deutsche Marks (<small><strong>USD.DEM</strong></small>) and decided they'd be the big boys on the block by insisting the Euro goes first in the ticker symbol, resulting in <small><strong>EUR.USD</strong></small>.\r\n\r\nHistory is littered with accidents rather than plans. Correct me with a better story in the comments if you have one. I am less interested in the official narrative than what the real intention was, if indeed there was one.\r\n\r\nSo that's where we are today - organically grown currency ratios for the most part with the Euro thrown in by fiat.\r\n\r\n\r\nCopyright (C) PagooLABS 2017. All Rights Reserved.",
            "image": null,
            "forums": [
                {
                    "url": "https://www.pagoolabs.com/forums/api/trading-education/?format=api",
                    "title": "Trading Education"
                }
            ],
            "replies": 1
        },
        {
            "url": "https://www.pagoolabs.com/stories/api/50/?format=api",
            "id": 50,
            "title": "Where Does the Day Begin in 24 Hour Forex and Futures Trading?",
            "slug": "where-does-the-day-begin-in-24-hour-trading",
            "status": 2,
            "publication_date": "2017-11-09T03:02:22Z",
            "lead": "How do you set a proper 24 hour timezone when trading forex and futures markets?",
            "excerpt": "Teaches how to set a 24 hour world timezone when trading international forex and futures markets.",
            "poster": "SeanManefield",
            "content": "---\r\n\r\nWhen you look up and the sun is directly overhead in the middle of the day, it is night time for the other half of planet Earth. And don't imagine that's irrelevant. If you trade in the USA eastern standard time, EST, more than half the world's people, including India and China, are on the opposite side of the globe.\r\n\r\nThis means that traders across the world would be looking at different candlestick bars on their charts because their day starts and ends at a different time. If the high is set in the last few minutes of New York trading, European traders would instead include that price in their *next* day's chart. [Pin bars](/stories/46/2017/10/24/trading-systems-part-4-examples-of-signals/#Pin-Bar-Signals) would not necessarily look like pin bars to all observers. Better for your trading would be to use the timezone for charting purposes that most other traders use. Then you would be conveniently alerted to the same signals professionals see.\r\n\r\n#### <a id=\"No-existing-timezones-are-suitable-for-charting\"></a>**No existing timezones are suitable for charting**\r\n\r\nSo [which timezone](https://www.timeanddate.com/time/map/) makes the most sense to use? I am going to argue none of the standard timezones are optimal for trading 24 hour markets. Instead I will show you a new timezone, one that is widely used by many professional traders. I call it the FX24 timezone, named after FX for the forex markets. You can choose it here on this site as your preferred way to view the publish times of posts. Some trading software, such as most versions of MetaTrader, have FX24 built in. Our charts here, for weekly and shorter timeframes, all show times in FX24.\r\n\r\nLike exiting an airplane after traveling east or west, adjusting to a new timezone takes some effort. But humans do it all the time and we're quite good at it. But first, let's look at what happens if you continue to use your local time to trade international markets.\r\n\r\nThe first thing you notice, depending on where your trading is based, is that the week does not start or end properly. In the USA, you will see the *Sunday afternoon session*, while in Australia, NZ and east Asia they will face a Saturday morning half day. Almost conveniently for Europe, the FX24 timezone comes within a few hours of their standard day that they are tempted to ignore it. Unfortunately their day is not close enough and they will not see the same candlestick bars that other traders see. Europeans will also have a few hours of Sunday night trading.\r\n\r\n#### <a id=\"Which-timeframes-are-affected\"></a>**Which timeframes are affected?**\r\n\r\nThe weekly and monthly timeframes will not be affected since for the weekly, all trading from Sunday until the next Saturday will be included in each bar. The bars will be the same worldwide until weekend trading starts sometime in the future. For timeframes less than one hour, such as the 15 minute, the same bars will print wherever you are located.\r\n\r\nThe one hour bars will also be the same for most of the world except for timezones that start on the half hour, such as India's. Depending on exactly when your timezone starts its day, the four hour timeframe may or may not look the same to other traders.\r\n\r\n#### <a id=\"same-bars-that-other-traders-use\"></a>**How to see the same bars that other traders use?**\r\n\r\n\r\nThe two major financial centers in the world are in London and New York, five hours apart. That's too far for a happy compromise since it's late night in London when New York finally closes. But this hints at a solution.\r\n\r\nBecause we are referring to a 24 hour day and we do not want to talk ambiguously about am or pm, we need to be familiar with the 24 hour clock, or military time. This clock does not reuse the first twelve hours for the second half of the day, so 1pm becomes 13:00 hours and 5pm becomes 17:00 hours.\r\n\r\nLet's review some USA close times. Equities on the NYSE close at 4pm (16:00) EST. [Futures start to close](http://www.cmegroup.com/trading-hours.html) from 16.30 EST with most closing by 16:45 EST. Except for equities, futures markets start to reopen after 5pm (17:00). The same is true for the interbank forex market where trading slows or stops in the last 15 minutes before 17:00 EST, then restarts after 17:00.\r\n\r\nTo make sense of the timezones we would like to follow the day that begins after the NY and Chicago (-1hr) commodity markets restart their trading session. The NYSE trades within that period, so starting the world trading day at 5pm (17:00) EST is the solution that most trading professionals use.\r\n\r\nAs an example, when trading stops just before 17:00 EST on any Monday, that is the end of the full 24 hour *trading Monday* which started 24 hours earlier on Sunday. So the Sunday afternoon session is really just the beginning of Monday trading and the candlestick for Monday includes all trades from 17:00 EST Sunday until the end of the FX24 day in NY at 17:00 Monday. Now, instead of six trading days in the week, we have the standard five: Monday to Friday. They just don't quite coincide with the same five days you are used to. However that's exactly the same for all people living east or west of you. Humans deal with that level of complexity all the time so we are not going to let this stop us from seeing proper charts.\r\n\r\nThe rest of the details here about UTC and DST adjustments are mostly helpful for programmers who need to implement FX24. Skip ahead unless you have a particular interest in the inner workings of timezones.\r\n\r\nTo make the trading day start at 17:00 EST, we need a timezone exactly 7 hours ahead of NY, where locally the time would be 12 midnight. That would be true whether daylight saving time (DST) is applicable or not because the NY markets close by 17:00 at all times of the year. If DST is not in operation, that would be the timezone two hours ahead of Greenwich Mean Time (GMT, also known as UTC), or UTC+2, since London is five hours ahead of NY. FX24 falls in and out of DST at exactly the same time as New York.\r\n\r\nUnfortunately, DST complicates things immensely because UTC does not change when DST comes into effect. Also, the USA and Europe do not enter or leave DST on the same date. For this reason, we cannot define FX24 as being UTC+x, where x would be a fixed number of hours. We would need to define two timezones, one with and one without a DST adjustment. The DST transition times would simply borrow from ESDT.\r\n\r\n#### <a id=\"FX24\"></a>**FX24 - the 24 Hour Timezone for Traders**\r\n\r\nThe easiest solution is just to define FX24 as seven hours ahead of the time on the east coast of the USA so that 5pm in NY is 12 midnight in the FX24 timezone.\r\n\r\nThe first thing to note is that this timezone does not coincide with *any* other single timezone. Instead, it moves between Moscow, Athens to Nairobi and back again, depending on the phase of DST in each country. This is strangely a good thing as it prevents any one timezone from chauvinistically beating its breast. No one country owns FX24, and it's equally inconvenient for all.\r\n\r\nSecondly, it's within two to three hours of London time, close enough for one of the world's financial centers to try to ignore it. But ignoring FX24 results in six daily bars for the week, all of them different from traders located elsewhere.\r\n\r\nIf you want to see the same charts other traders are working from you need to adjust your trading timezone to the day starting seven hours ahead of the time in New York.\r\n\r\nIn some cases, the FX24 timezone is built into your trading software, such as the widely used MetaTrader (not all versions). In other cases the software may allow you to choose a timezone, but that only works if the FX24 timezone is available as a programmed in choice. Otherwise you will need to make adjustments to a suitable proxy timezone that lines up with FX24 at least two times a year, depending on DST in NY and DST locally in the proxy. That's a major pain. When all else fails, you can put pressure on the software providers to make them aware of the problem and fix their software.\r\n\r\nAs global markets become more and more intertwined there is no longer any excuse for trading software not to provide the FX24 timezone. It's just New York time plus seven hours.\r\n\r\nIf you prefer to see times of stories and posts displayed in FX24 here on PagooLABS, then simply go into the configuration menu and make your selection for FX24. The configuration menu is the little wheel icon on the top menu. You will need to be logged in of course, otherwise you will see UTC times. You can also choose any timezone you prefer if FX24 is too uncomfortable to use at this stage.\r\n\r\nSwap over to FX24 and start enjoying the same charts other traders use!\r\n\r\n</br>\r\n</br>\r\n</br>\r\n</br>\r\n</br>\r\n\r\nCopyright (C) PagooLABS 2017. All Rights Reserved.",
            "image": "/media/uploads/2017/Fx24_6LbJ13M.jpg",
            "forums": [
                {
                    "url": "https://www.pagoolabs.com/forums/api/trading-education/?format=api",
                    "title": "Trading Education"
                }
            ],
            "replies": 2
        },
        {
            "url": "https://www.pagoolabs.com/stories/api/49/?format=api",
            "id": 49,
            "title": "Building an Oil Futures Trading System Using Heikin Ashi Candlesticks",
            "slug": "oil-futures-using-heikin-ashi",
            "status": 2,
            "publication_date": "2017-11-06T06:18:03Z",
            "lead": "I show how to convert the Heikin Ashi reversal method into a simple trading system to profit in the oil futures market.",
            "excerpt": "Teaches how to convert the Heikin Ashi reversal method into a simple trading system to profit in the oil futures market.",
            "poster": "SeanManefield",
            "content": "---\r\n\r\nOil has been consolidating since 2016 in the $40-$55 range after having fallen steeply from the $147 a barrel high set in 2008. At the end of last week it had just peeked above the previous consolidation high posted in early December 2016. On the longer timeframe *Bigger Picture* weekly chart below, oil is still in a downtrend, as indicated by the falling moving averages.\r\n\r\n![Weekly WTI Oil Chart](/media/uploads/2017/20171106_Oil/2017-11-06_Oil-W1.jpg \"Weekly WTI Oil Chart\"):C100!\r\n\r\nBased on the recent breakout above the trading range, either the downtrend is ending or a bigger upward correction is underway. We don't know which at this stage. And we do not have to know because we will not be trading against the weekly trend until any uptrend, if it exists, reveals itself in the market.\r\n\r\nOn the fundamental side, we have a steadily improving world economy, stronger than expected numbers coming out of the USA and a renewal of tensions with Iran. It's interesting to note that Iranian tensions were also flying high during the last peak in 2008. Of greater concern, some unexpected turmoil is emerging from [Saudi Arabia](https://news.yahoo.com/round-saudi-princes-businessmen-widens-travel-curbs-imposed-083251967--finance.html), a key oil producer. It's early days yet but it appears that any Saudi policy that might have existed of depressing oil prices to drive USA frackers out of business, has come to an end.\r\n\r\nEach of these developments is oil positive, but should we trade *against* the longer term falling prices?\r\n\r\nThe answer is to never trade against the trend. Instead I will pull back to a shorter timeframe that concentrates more chart space around these recent developments. I am going to drop down two standard timeframes from the weekly to explore the effects of applying [our simple system method](/stories/43/2017/10/24/trading-systems-part-1-introduction/) to the four hour (H4) chart. In this shorter timeframe, shown below, oil is showing a distinct uptrend, in line with recent fundamentals. We should be cautious here because the longer term chart is still considered a downtrend until at least the $63 high from May 2015 is taken out and the MAs trend up or cross.\r\n\r\nTo demonstrate this sample system in the oil market, I will be using the [Heikin Ashi reversal technique](/stories/46/2017/10/24/trading-systems-part-4-examples-of-signals/#HA-signals) (HA). However, as in our earlier stories, I am not wedded to any one signaling technique. Feel free to use MACD, crossing moving averages or your own favorite indicator if you wish. You can follow along with our discussion here as you apply your custom signals to the same charts. Everything presented here is done as simply as possible for learning purposes only. I encourage you to go out and apply these general techniques to developing your *own* system.\r\n\r\n\r\n#### <a id=\"The-H4-Oil-Chart\"></a>**The H4 Oil Chart **\r\n\r\nIn the earlier series on Systems I used a moving average cross of the MA(100) and MA(200) to mark the start of a trend. There are better trend methods but I will stick to the MA cross here both because I have [already explained how they work](/stories/43/2017/10/24/trading-systems-part-1-introduction#Moving-Averages) and because crosses are easy to demonstrate. Once a trend has started we will open a position whenever our [signal](/stories/45/2017/10/24/trading-systems-part-3-signals/) fires, as long as our system's [conditions or filters](/stories/45/2017/10/24/trading-systems-part-3-signals/#Rules-and-Filters) are met.\r\n\r\nTo signal our entry into a trade I will use the [Heikin Ashi reversal technique](/stories/46/2017/10/24/trading-systems-part-4-examples-of-signals#HA-signals) which we discussed in the earlier series. The HA method is an easy signal to show on a chart because of the changing color of the candles.\r\n\r\nThe HA bars are really just averages of today's and earlier prices so they smooth over the little period to period wiggles in the standard bars. As a result, they differ from the more standard candlesticks so, to help you become familiar with them, I present two charts below. The first has standard candlesticks and the second, which is marked up with setups, has the HA bars.\r\n\r\n![H4 WTI Oil Chart](/media/uploads/2017/20171106_Oil/2017-11-06_Oil1.jpg \"H4 WTI Oil Chart\"):C100!\r\n\r\n![H4 WTI Oil HA Chart](/media/uploads/2017/20171106_Oil/2017-11-06_Oil-HA1.jpg \"H4 WTI Oil HA Chart\"):C100!\r\n\r\nThe **signals emitted** when a HA bar changes color are marked on the above H4 Oil chart. I have filtered out HA reversals that did not come after a countertrend retracement of at least two bars. Also excluded are reversals where the retracement did not move back against the prevailing trend. We are only interested in HA signals where we can say the market appears to have *rejected* lower prices, so inside bars don't count. These signals are marked 1 to 7 on this first set of charts, shown above. They are further annotated with an **x** if the setup fails, a **✓** if it wins or a **?** if it's unclear for whatever reason.\r\n\r\nThe rules for calculating how much of your funds to allocate and the number of contracts to open were discussed in the series on [The Basic Setup](/stories/38/2017/10/24/basic-trade-setup-part-1-introduction/) and if you haven't yet read that series, now is a good time to have at least a quick look. The math is presented in tabular form [here](/stories/42/2017/10/24/the-basic-setup-part-5-manage-that-trade/#Profit-in-the-Sample-Gold-Trade) if you need a reference.\r\n\r\nI will keep this presentation simple by assuming we are allocating **1%** risk capital to this trade and expecting a risk-reward multiplier of four (**RR=4**). So any loss would be -1% and a win +4%. Scale up accordingly if you are an experienced trader risking 2%.\r\n\r\nWe will start mechanically trading our system at the time period where the [faster MA(100) crosses](/stories/43/2017/10/24/trading-systems-part-1-introduction#Moving-Averages) above the slower MA(200), or point A in the charts above.\r\n\r\nThe first thing to note is there was a string of losses until the end of the period shown on the chart. However, the beauty of the systems approach is about to reveal itself, so don't give up just yet!\r\n\r\nAlthough the first trade does not look like a confident setup, a system will require you to open it anyway. That's because you are following a mechanical program that you designed in the earlier [systems and simulation step](/stories/47/2017/10/24/trading-systems-part-5-systems/). In this case here, we have decided the trend is up after point A, the MA cross, and we are taking every signal (HA reversal) that follows the rules we have set ourselves.\r\n\r\nIn your case you may have different criteria for establishing the beginning of a trend and a different signaling method, such as MACD. In addition you will have [filters that ignore certain poor setups](/stories/45/2017/10/24/trading-systems-part-3-signals/#Rules-and-Filters). In our case, our filters will be:\r\n\r\n- the retrace must include at least 2 bars of the opposite color\r\n- the retrace must involve the market *falling* and not simply a sequence of inside bars\r\n- we must not expose ourselves to more than 1% risk in the trade, so once fully invested, we open no new positions until it's closed.\r\n\r\n#### <a id=\"Setup1\"></a>Setup #1\r\n\r\nUnfortunately for us, the setup #1 in the chart above meets those criteria so, weak or not, we open it. The consequence though is that until that first position is stopped out in the price fall down to setup #7, we conveniently miss the other failed setups. That is, we are already fully invested from setup #1 and we don't want to take on more than 1% risk in this trade. What looks like a string of losses becomes just one loss.\r\n\r\nBut was it really a loss? Let's look at the setup in detail:\r\n\r\n    Setup #1\r\n    SL = 49.70\t\t\t\tStop Loss\r\n    OP = 50.40\t\t\t\tOpen Price\r\n    Contract Risk = CR\r\n    CR = TP - SL\t\t\tContract Risk\r\n       = 50.40 - 49.70\r\n       = 0.70\t\t\t\tRisk per contract\r\n    Target Price = TP\r\n    TP = OP + RR x CR\t\twin of 4 x Risk\r\n       = 50.40 + 4 x 0.70\r\n       = 53.20\r\n\tHighest price (bid) before stopped:\r\n\tMax = 52.93\r\n\tCumulative win (-loss)\r\n\tWin = -1%\r\n\r\nThe trade climbed $2.53 from the open, falling just shy of the $2.80 we set as our TP based on a four times risk-reward. Depending on the price you opened in the market and your broker's bid-ask spread, these numbers could be a little different in your case. All our calculations here take into account a wide bid-ask spread, although wider ones exist. Don't worry yourself over those differences, just print your own charts and use the prices and the specific oil contract that is relevant to you. You may find though with the tighter bid-ask spreads you face that this trade actually hit the TP.\r\n\r\nIn this story, however, we want to be as sceptical as possible toward the system so we are marking it down as a failure. Had it worked, the system would require that we take the next three failed trades but we would approach setup #7 being 1% up instead of 1% down.\r\n\r\nYou will come across well-meaning advice criticizing you for not selling with so much profit already in the trade. The reality is you do not know the future and you do not know at any point whether the trade will work out favorably or not. You should already have determined the appropriate RR multiplier to use from the earlier systems simulation step.\r\n\r\nClearly, the lower you set RR the more likely you are to win. But you will still face losses of 1% for every failure and those losses have to be overcome for the system as a whole to win. Winning one setup with 1.5% but losing the next two at -1% each will steadily empty your account. Also, choosing an RR that keeps you out of other failed trades so that you only lose one instead of many, as we did here, is an advantage in itself.\r\n\r\nYour best approach is to calculate the relevant SL and the optimal RR to use for each trade and stick to them.\r\n\r\nIf you feel tempted to move your stops or target price during the trade, try it first in a demo account and watch your system fail. Don't try it with real money. Never forget you are competing in the market with a huge number of very competent and determined traders. It is their *job* to shake you out of your trade. You will only win by taking on risk and part of that risk is to hold on to your plan and stay in the trade even while the market is delivering you a drubbing. Ride that bucking bronco and don't get shaken off. No one likes to lose but here you need to put each trade aside and focus instead on whether the *system* wins, not the individual setup you open.\r\n\r\n#### <a id=\"Setup7\"></a>Setup #7\r\n\r\nAfter being stopped out the next signal emitted, as the Heikin Ashi bars reverse from red to green, is on the far right of the charts above, marked **7?**. So let's move to more recent charts to see how this and the following trades fared:\r\n\r\n\r\n![H4 WTI Oil Chart #2](/media/uploads/2017/20171106_Oil/2017-11-06_Oil2.jpg \"H4 WTI Oil Chart #2\"):C100!\r\n\r\n![H4 WTI Oil HA Chart #2](/media/uploads/2017/20171106_Oil/2017-11-06_Oil-HA2.jpg \"H4 WTI Oil HA Chart #2\"):C100!\r\n\r\nIn tabular form, here is the setup for the next signal at setup **7✓**:\r\n\r\n    Setup #7\r\n    SL = 49.31\t\t\t\tStop Loss\r\n    OP = 49.83\t\t\t\tOpen Price\r\n    CR = TP - SL\t\t\tContract Risk\r\n       = 0.52\t\t\t\tRisk per contract\r\n    TP = OP + RR x CR\t\tTP of 4 x Risk\r\n       = 49.83 + 4 x 0.52\r\n       = 51.91\r\n    Add a little for Bid-Ask at close:\r\n       = 51.95\r\n\tCumulative win (-loss)\r\n\tWin = 3%\t\t\t\t-1% + 4%\r\n\r\nAs you can see, the trade was successful and the target price is hit at the point indicated by the blue dotted line extending from the trade open bar. The system is now winning 3%, including the first loss.\r\n\r\nThe next series of HA reversals up to **11✓** do not meet our filtering criteria. They are either one bar reversals or the retracements are all inside bars. We insist on a minimum retracement of two bars, preferably a few more.\r\n\r\n#### <a id=\"Setup11\"></a>Setup #11\r\n\r\nHere's the setup for trade marked **11✓** which also wins:\r\n\r\n    Setup #7\r\n    SL = 50.88\t\t\t\tStop Loss\r\n    OP = 51.58\t\t\t\tOpen Price\r\n    CR = TP - SL\t\t\tContract Risk\r\n       = 0.70\t\t\t\tRisk per contract\r\n    TP = OP + RR x CR\t\tTP of 4 x Risk\r\n       = 51.58 + 4 x 0.70\r\n       = 54.38\r\n    Add a little for Bid-Ask at close:\r\n       = 54.42\r\n\tCumulative win\r\n\tWin = 7%\t\t\t\t3% + 4%\r\n\r\nSoon after this winning position closes, there is a little inside bar reversal which is filtered out in this system. Inside bars are widely known continuation patterns and another system might include them after testing, but it's filtered out here.\r\n\r\n#### <a id=\"Setup11\"></a>Setup #14\r\n\r\nThat brings us to the last setup on the charts, **14?**. I annotate it with a question mark to indicate that the trade has yet to complete.\r\n\r\n    Setup #7\r\n    SL = 53.95\t\t\t\tStop Loss\r\n    OP = 54.60\t\t\t\tOpen Price\r\n    CR = TP - SL\t\t\tContract Risk\r\n       = 0.65\t\t\t\tRisk per contract\r\n    TP = OP + RR x CR\t\tTP of 4 x Risk\r\n       = 54.60 + 4 x 0.65\r\n       = 57.20\r\n    Add a little for Bid-Ask at close:\r\n       = 57.25\r\n\tCumulative win\r\n\tWin = ?\t\t\t\t\t7% + ?\r\n\r\nThis has not yet closed so to be as sceptical as possible let's assume it's a loss. We are left with two wins and two losses but the wins are four times each loss, leaving us with a 6% (2 x 4 - 2 x 1) win for the system so far.\r\n\r\n#### Conclusion\r\n\r\nEven though the chart had a rocky start with a string of losing setups threateningly lined up, the system itself proved stronger than individual trades.\r\n\r\nMany novice traders make the mistake of opening a position like one of those above and then, if it fails, walking away entirely to play another instrument or trying another indicator. When they later revisit that market they are often dismayed to discover they had been right all along and prices had moved in the anticipated direction. With a string of such failures under their belt it is no wonder they often feel the world is against them. In fact they were staring success in the face, and they blinked.\r\n\r\nIn future stories I will continue to apply the systems approach to tricky situations where every trade does not necessarily win. In the real world of trading you have to approach losses as the cost of playing the game. Never imagine a win proves you are clever or a loss shows you are flawed. Wins and losses prove no such thing, but the work you put into designing and testing your system is everything. Just play the game of odds and become better at it than your opponents.\r\n\r\n![Update WTI Oil Chart](/media/uploads/2017/20171106_Oil/2017-11-06_Oil-HA3.png \"Update WTI Oil Chart\"):R40\r\n\r\n**`UPDATE: the final trade above did indeed go on to win on November 6th, after the weekend. The system thus wins 11% (3 x 4 - 1 x 1). The success of the system did not depend on winning the final trade, but it's certainly a pleasant bonus. Experienced traders who risk 2% per trade can walk away with over 20% of their risk portfolio in winnings. Congratulations.`**\r\n\r\n\r\n<br>\r\n<br>\r\n<br>\r\n<br>\r\n<br>\r\n\r\nCopyright (C) PagooLABS 2017. All Rights Reserved.\r\n\r\n*[SL]: stop loss\r\n*[TP]: target price\r\n*[OP]: open price\r\n*[CR]: Contract Risk\r\n*[CS]: contract size\r\n*[CO]: number of contracts opened\r\n*[forex]: Foreign Exchange including markets and trading\r\n*[signal]: a price pattern in the market triggering the opening of a position\r\n*[setup]: An instance of a signal ready for trading with values for the number of contracts and the Open, Stop and Target prices\r\n*[instrument]: A particular traded forex or futures contract such as gold or USDJPY\r\n*[instruments]: Particular traded forex or futures contracts such as gold or USDJPY\r\n*[indicator]: A calculated line, such as a Moving Average drawn on a chart, that is separate from the OHLC prices but often calculated from them\r\n*[indicators]: Calculated lines, such as Moving Averages drawn on a chart, that are separate from the OHLC prices but often calculated from them\r\n*[H4]: Chart of the four hour timeframe",
            "image": null,
            "forums": [
                {
                    "url": "https://www.pagoolabs.com/forums/api/setups/?format=api",
                    "title": "Setups"
                }
            ],
            "replies": 3
        },
        {
            "url": "https://www.pagoolabs.com/stories/api/48/?format=api",
            "id": 48,
            "title": "Getting the Right Target Price in a Forex or Futures System Using Simulations",
            "slug": "trading-systems-part-6-simulations-on-systems",
            "status": 2,
            "publication_date": "2017-10-24T03:56:39Z",
            "lead": "This sixth and final story in the series \"Introduction to Trading Systems\" tests systems to show how to develop an optimal risk/reward multiplier. This RR is used to calculate the target price in each setup.",
            "excerpt": "This sixth story in the series on Trading Systems tests systems to show how to develop an optimal risk/reward multiplier. This RR is used to calculate the target price in each setup.",
            "poster": "SeanManefield",
            "content": "---\r\n#### **Trading Systems Part 6 - Basic Manual Simulations in Forex and Futures**\r\n\r\nWe are going to apply the techniques discussed in the previous story to show how to simulate a particular market. What we are looking for is an optimal risk/reward multiplier, RR. In the real world, however, we more often find complications.\r\n\r\nI will be writing other stories on this topic because this is a major focus of our web site: **Pagoo** or *Playing A Game Of Odds*.\r\n\r\nHowever to begin, let's take an example where an optimal multiplier may not exist because we all want to remain sceptics about this whole approach. What do we do when our method does *not* work out easily?\r\n\r\nThe **first step** is to find a chart you want to trade where a trend reversal has recently taken place. This means you can enter early enough to profit from the remaining trend. As noted earlier, you may have a notion of why that trend reversal is occurring. As a result you may have reason to believe the new trend is tradable. By 'tradable' I simply mean that the target price of the first signal is achievable.\r\n\r\nFor our purposes, let's take the S&P 500 where the market has been in a longer term uptrend from 2009 but suffered through a period of correction from 2014 through 2016. As you can see from the chart below, at **point A** a trend reversal takes place, made evident by the faster 100 period moving average, MA(100), crossing above the MA(200). You are free to choose whichever relevant MA periods you prefer, or just use price action cycles, or use a regression line or whatever makes you confident the trend has changed. Crossing MAs is just an example I use here. Mistakes are allowed and you will see the outcome of those when you do your testing.\r\n\r\n![Uptrend in SPX futures](/media/uploads/2017/basic_system_trading/SPX-D1-UpT-20171012.png \"Uptrend in SPX futures\"):C90!\r\n\r\nWe can readily see the S&P is in a solid uptrend but we did not know that at point A. In fact, all we knew was that the S&P had been uptrending for many years and had recently gone through a correction. For all we knew, the correction might have become deeper. Once the MAs crossed, we acted *as if* the uptrend had resumed. That's all we needed to know.\r\n\r\n\r\n#### Pin bar example\r\n\r\nFor our first example of a system, let's use the pin bar signal. It's a popular candlestick pattern and many traders already make use of it.\r\n\r\nThe **second step** is to mark every hanging man candlestick on the chart. A hanging man candlestick pattern has a small head and a long lower tail. A bullish pin bar is just a hanging man with a prominent size and location to distinguish it, but that will be clearer as we work along. Each hanging man has been marked with a green arrow. Now let's filter out the candlesticks that do not meet our basic criteria for a pin bar:\r\n\r\n- Ignore hanging men outside the range of the MA cross: marked as red **'OR'**\r\n- Ignore hanging men which have **n**o **r**etrace with at least two previous red bars: **'NR'**\r\n- Mark the spikes which seem too extreme: **'S'**\r\n\r\n![Pin bars on S&P500 futures](/media/uploads/2017/basic_system_trading/SPX-D1-UpT-PBs-20171012.png \"Pin bars on S&P500 futures\"):C90\r\n\r\nThat leaves five candidates that qualify as signals. The spike is disqualified partly because it is not preceded by several down bars and partly because the target price may be so far above today's market that achieving that TP seems improbable - and probability is the name of the game. Pin bar #3 barely qualifies, but it does have two prior down days but is not as prominent as we would like. Pin bar #5 does not strictly qualify but is 'rejecting' the area below the MA(100), which gives it a measure of confluence.\r\n\r\nAlso note that if we lose the second trade we will be out of the market until we reenter for the third trade. During that period there was a big rally in our direction. There's an earlier engulfing pattern in the first week of December 2016 that we could add, but then we need to examine *all* engulfing patterns as entry candidates otherwise we would be selecting patterns based on hindsight. I will just keep this simple for now, but this is the sense in which I mean a pin bar signal is not *complete*.\r\n\r\nThe **third step** is iterative: starting at an RR multiplier of one, consider each trade in turn in the order it would occur in a live trade scenario. We will mechanically simulate what would transpire given our setup and the calculated TP. We will hold that position, opening no others, until it is either stopped out for a loss or triggers our TP for a win.\r\n\r\nTo show the mechanics, I indicate the risk of each trade in the table below, where the risk comes from the OP of the following time period less the SL given by the bottom of the pin bar. I always move the SL a few points beyond the bottom of the pin bar so that my stops would survive a challenge at the same price as the pin bar low. I will count any final open position as a loss because I want to be as sceptical as possible in the simulation and I have no other way to handle it until it's closed or the trend ends.\r\n\r\nThe starting conditions for this table are:\r\n\r\n- A maximum risk of 2%, assumed to be $100,000 here\r\n- A Risk Reward ratio of 1:1, or **RR=1**, so that the TP is 1 x Contract Risk\r\n- We are trading the ES mini S&P500 contract with a contract size or CS=50\r\n- The columns are just the setup parameters except for the final two result columns.\r\n\r\n  Trade#  |  OP       |  SL       |  Risk  |   CR   |  TP (1)   |  CO  |  Result  |  Win/Loss\r\n----------|-----------|-----------|--------|--------|-----------|------|----------|-----------\r\n    1     |  2078.60  |  2049.70  |  28.90 |  1445  |  2107.50  |   1  |  Win     | +1445\r\n    2     |  2133.30  |  2112.70  |  20.60 |  1030  |  2153.90  |   2  |  Win     | +2060\r\n    3     |  2281.80  |  2266.50  |  15.30 |   765  |  2297.10  |   2  |  Win     | +1530\r\n    4     |  2343.80  |  2320.80  |  23.00 |  1150  |  2366.80  |   1  |  Win     | +1150\r\n    5     |  2430.20  |  2416.20  |  14.00 |   700  |  2444.20  |   2  |  Win     | +1400\r\n\r\n    Total wins 5/5 $7585\r\n\r\nWe went over the risk limit by 3% on trade #2. A small amount is acceptable but in general avoid extra risk of more than 5%. Also note that we were able to open all trades because each trade reached its limit before the next signal was reached. It's unusual to get five wins in a row but that is a consequence of the strong trend and the fact that we only required an RR of one. A low RR means the market was more likely to reach the TP.\r\n\r\nThe **fourth step** is to repeat the simulation, raising the value of RR by a small step. Let's run the simulation again, this time with an **RR=2**.\r\n\r\n  Trade#  |  OP       |  SL       |  Risk  |   CR   |  TP (2)   |  CO  |  Result  |  Win/Loss\r\n----------|-----------|-----------|--------|--------|-----------|------|----------|-----------\r\n    1     |  2078.60  |  2049.70  |  28.90 |  1445  |  2136.40  |   1  |  Loss    | -1445\r\n    2     |  2133.30  |  2112.70  |  20.60 |  1030  |  2174.50  |   2  |  Win     | +4120\r\n    3     |  2281.80  |  2266.50  |  15.30 |   765  |  2312.40  |   2  |  Win     | +3360\r\n    4     |  2343.80  |  2320.80  |  23.00 |  1150  |  2389.80  |   1  |  Win     | +2300\r\n    5     |  2430.20  |  2416.20  |  14.00 |   700  |  2430.20  |   2  |  Win     | +2800\r\n\r\n    Total wins 4/5 $11,135\r\n\r\nEven though we were stopped out of one trade, we received double on the remaining four so our wins exceeded  the results of the first simulation. We can conclude for this market under these counditions that holding out for an RR of two times risk is more profitable.\r\n\r\nLet's run the simulation again, this time with an **RR=3**.\r\n\r\nTrade#  |  OP       |  SL       |  Risk  |   CR   |  TP (3)   |  CO  |  Result  |  Win/Loss\r\n--------|-----------|-----------|--------|--------|-----------|------|----------|-----------\r\n  1     |  2078.60  |  2049.70  |  28.90 |  1445  |  2165.30  |   1  |  Loss    | -1445\r\n  2     |  2133.30  |  2112.70  |  20.60 |  1030  |  2195.10  |   2  |  Loss    | -2060\r\n  3     |  2281.80  |  2266.50  |  15.30 |   765  |  2327.70  |   2  |  Win     | +4590\r\n  4     |  2343.80  |  2320.80  |  23.00 |  1150  |  2412.80  |   1  |  Win     | +3450\r\n  5     |  2430.20  |  2416.20  |  14.00 |   700  |  2472.20  |   2  |  Win     | +4200\r\n\r\n    Total wins 3/5 $8,735\r\n\r\n**Step five** is to compare our results. When we raise our TP to three times our risk, the total profit falls compared to the case with two times risk.\r\n\r\nBecause our wins fell compared to the previous round, we would normally turn to target that area 1 < RR < 3 and iterate in smaller steps to focus in on an optimal value of RR. This final **Step six** would result in an optimal RR.\r\n\r\nHowever, in this case, it's worth looking further since this market has been in a long term uptrend. In fact, the S&P 500 climbed over 25% in this same period and it seems that a win of only $11K out of $100K in funds is too low, even if we only risked 2%. Others who are 100% invested in the S&P stocks have made about 25%, but only if they close now. In contrast, we are fully cashed up. Still, 25% is better than 11% so let's see what is going on here.\r\n\r\nFirst, note that in the previous simulation with TP set to two times risk, we won four times receiving twice our risk for each. So in total we made roughly eight times our maximum risk (4 wins x 2 x $2K), except for slippage cause by rounding down. So let's try to see if taking a trade with an **RR=8** will win:\r\n\r\nTrade#  |  OP       |  SL       |  Risk  |   CR   |  TP (8)   |  CO  |  Result  |  Win/Loss\r\n--------|-----------|-----------|--------|--------|-----------|------|----------|-----------\r\n  1     |  2078.60  |  2049.70  |  28.90 |  1445  |  2309.80  |   1  |  Loss    | -1445\r\n  2     |  2133.30  |  2112.70  |  20.60 |  1030  |  2298.10  |   2  |  Loss    | -2060\r\n  3     |  2281.80  |  2266.50  |  15.30 |   765  |  2404.20  |   2  |  Win     | +12,240\r\n  4     |  2343.80  |  2320.80  |  23.00 |  1150  |  2527.80  |   1  |  skipped | 0%\r\n  5     |  2430.20  |  2416.20  |  14.00 |   700  |  2542.20  |   2  |  Win     | +11,200\r\n\r\n    Total wins 2/5 $19,935\r\n\r\nTrade #4 was skipped because we still had trade #3 open and one of our rules is not to go over 2% risk. Not only did one trade win at RR=8 but we managed to win two trades.\r\n\r\nAlmost $20,000 is a substantial profit for a $100,000 portfolio that never risked more than 2% per trade, although by trade #3 we were down potentially 6%. The system I have used above is one of the simplest. It uses a crossing MA to detect trend reversal and just one type of candlestick, the pin bar, as a trade signal. There's clearly huge potential for improvement.\r\n\r\nThe gains took place over 16 months and the trend is not yet finished. As it finishes you can expect to surrender some of that profit as what appear to be retracements turn out to become trend reversals that trigger stops.\r\n\r\nAt some point it will become clearer that the uptrend is over and either a period of consolidation or a downtrend ensues. At that stage you can stop opening positions on signals. Until then the system does need to book profits to pay for the coming losses, or you could stop now until the next uptrend starts. Whatever you do, you must be consistent so that you can evaluate your performance and make necessary adjustments for the next trend you trade.\r\n\r\nIf we look at the chart, something we can only do in hindsight, we can see a number of pin bars have not yet had their lows retested and the chart is currently trading at all time highs. That means that *any* RR multiple would work, as long as we closed our position now to lock in those profits. But how do we approach this problem before the trading takes place?\r\n\r\nIf we knew the path of prices from the outset with clairvoyence, but determined to only enter trades based on pin bar signals, pin bar #3 would be best because it has furthest to run without being stopped. Yet it is also possibly the weakest shaped pin bar on the chart: small, does not protude from surrounding bars, is in a tiny retrace, is far above the moving averages, and so on. A reasonable pin bar trader would reject it. A position opened on pin bar #3 and held until the last day of trading would yield almost 18x risk, or $27,390 here because of rounded down contract sizes ($765 x 2 contracts x 18). So the optimum RR for this leg of the bull market in the S&P would lie somewhere between RR=8 and RR=18.\r\n\r\nBut you cannot know about this single pin bar in advance. When you see RR numbers going over five, stop and examine the situation further. Your entire simulation cannot depend on one outlier.\r\n\r\nThis chart is typical of the S&P 500. It represents stocks that have risen consistently for a century. The growing companies that comprise the S&P together with general price inflation, cause the index to be in a solid  uptrend. There is no guarantee this will last but with all time highs being posted daily, it's unlikely to end anytime soon.\r\n\r\nThe current rapid rise we are witnessing is at the high end of its previous performance, comparable to the post Soviet Union bull market of the 1990s. This suggests that expecting an eightfold increase or more for a pin bar could be unrealistic for other periods. You need to go back further and run the same simulation in earlier time periods. This is the time to break out your programming talents, for those that have them. Even a spreadsheet would make short work of this data and the worksheets or programs could be reused on other markets and time periods.\r\n\r\nIf you don't have the time or inclination to program a simulation, print out the charts and user a ruler to  find where stops are triggered. Do rough calculations for the trade risk and TP levels and avoid laboring over decimal places unless necessary for the market in question. The advantage is you will have a permanent record for your files.\r\n\r\n#### Summary\r\n\r\nTo begin our exploration of systems, I have picked an easy chart, although it is absolutely current and has some tricky quirks. Most charts will not be so easy because very few markets at the present time trend so strongly without pause. When inflation picks up, commodity prices should resume their uptrend.\r\n\r\nWhen we turn to other markets that don't trend so strongly, we will see that there is often an optimum RR somewhere in the range one to five. It's up to you to find that optimum so that you can calculate the TP for the setup tool.\r\n\r\nIn the first series on \"The Basic Setup\" I showed you how to bring together all the key components of a trade setup except the target price, TP. We have now come full circle, calculating an optimal risk/reward multiplier, RR, and therefore a TP that completes all the elements you need in the basic setup. Now with the basic setup in place you should be able to apply it to your preferred signal method and estimate an RR as input into a system of trades.\r\n\r\nPerhaps what you discover by measuring the results of your system under different RR values will lead you to calibrate the approach you have been using up until now, or even to change to a different signal method. That's all part of learning and trading.\r\n\r\nNone of these methods or ratios are permanent fundamental constants of the universe in the way that mathematical pi is. In fact you can expect RR and some of the signal filters to change over time and between markets.\r\n\r\nHowever if you apply your time and energy to investigating the trend and measuring the performance of your system rather than constantly second guessing every trade and whether you should take profits or move to break even, I believe you will be far better psychologically equipped to make profits in futures and forex. Micro managing trades will cause you to make so many mistakes you will lose confidence in your ability to trade anything. Aside from excess leverage, there is probably no greater impediment to trading than poor psychology and implementing a system will help you see that.\r\n\r\nIn our future stories I will apply the methods detailed above to calculating the optimal RR for other markets. I will continue to pick tricky examples, such as ambiguous trends or markets consolidating, because that's where I believe there is the most to learn.\r\n\r\n<br>\r\n<br>\r\n<br>\r\n#### Disclaimers\r\n\r\nAlthough the PagooLABS site is educational and does not advocate any position in a futures or forex contract, it is important to present the following disclaimers as additional information. Trading these markets can be risky and you must be aware of the following:\r\n\r\n**U.S. Government Required Disclaimer**\r\nCommodity Futures Trading Commission Futures and Options trading has large potential rewards, but also large potential risk. You must be aware of the risks and be willing to accept them in order to invest in the futures and options markets. Don't trade with money you can't afford to lose. This is neither a solicitation nor an offer to Buy/Sell futures or options. No representation is being made that any account will or is likely to achieve profits or losses similar to those discussed on this web site. The past performance of any trading system or methodology is not necessarily indicative of future results.\r\n\r\n** CFTC RULE 4.41 **\r\n\"These results are based on simulated or hypothetical performance results that have certain inherent limitations. Unlike the results shown in an actual performance record, these results do not represent actual trading. Also, because these trades have not actually been executed, these results may have under-or over-compensated for the impact, if any, of certain market factors, such as lack of liquidity. Simulated or hypothetical trading programs in general are also subject to the fact that they are designed with the benefit of hindsight. No representation is being made that any account will or is likely to achieve profits or losses similar to these being shown.\"\r\n\r\n<br>\r\n<br>\r\n<br>\r\n\r\nCopyright (C) PagooLABS 2017. All Rights Reserved.\r\n\r\n*[pi]: ratio of a circle's circumference to its diameter\r\n*[HA]: Heikin Ashi\r\n*[MA]: Moving Average over a specified period - 100 periods for eg\r\n*[EMA]: Exponential Moving Average - has a long 'memory'\r\n*[OHLC]: Open, High, Low, Close: the 4 key values for any bar on a chart\r\n*[bull]: An uptrending or rising market\r\n*[bear]: A downtrending or falling market\r\n*[SL]: stop loss\r\n*[TP]: target price\r\n*[OP]: open price\r\n*[CR]: Contract Risk\r\n*[CS]: contract size\r\n*[CO]: number of contracts opened\r\n*[MR]: Maximum Risk\r\n*[USD]: United States Dollar\r\n*[AUD]: Australian Dollar\r\n*[Yen]: The Japanese currency\r\n*[Euro]: The European currency\r\n*[EURJPY]: The Euro - Yen cross currency: buying Euros priced in Yen\r\n*[forex]: Foreign Exchange including markets and trading\r\n*[signal]: a price pattern in the market triggering the opening of a position\r\n*[setup]: An instance of a signal ready for trading with values for the number of contracts and the Open, Stop and Target prices\r\n*[instrument]: A particular traded forex or futures contract such as gold or USDJPY\r\n*[instruments]: Particular traded forex or futures contracts such as gold or USDJPY\r\n*[underlined text]: Congratulations! You have successfully hovered over text\r\n*[indicator]: A calculated line, such as a Moving Average drawn on a chart, that is separate from the OHLC prices but often calculated from them\r\n*[indicators]: Calculated lines, such as Moving Averages drawn on a chart, that are separate from the OHLC prices but often calculated from them\r\n*[H4]: Chart of the four hour timeframe\r\n*[M5]: Chart of the five minute timeframe\r\n*[H1]: Chart of the one hour timeframe",
            "image": null,
            "forums": [
                {
                    "url": "https://www.pagoolabs.com/forums/api/trading-education/?format=api",
                    "title": "Trading Education"
                }
            ],
            "replies": 6
        },
        {
            "url": "https://www.pagoolabs.com/stories/api/47/?format=api",
            "id": 47,
            "title": "How to Build Your own Forex or Futures Trading System",
            "slug": "trading-systems-part-5-systems",
            "status": 2,
            "publication_date": "2017-10-24T03:53:29Z",
            "lead": "This fifth story in the series \"Introduction to Trading Systems\" brings together the setup, the trend, and signals, combining them into a simple trading system. The system we design here is only for teaching purposes and as we build it we explain how to substitute your own signals and trading style.",
            "excerpt": "This fifth story in the series on Trading Systems combines the setup, the trend, and signals into a simple trading system.",
            "poster": "SeanManefield",
            "content": "---\r\n#### **Trading Systems Part 5 - The Basic Steps for Forex and Futures**\r\n\r\nA system is a strategy to open a sequence of positions in an instrument based on the same or similar signals. As soon as a new signal triggers, the next position is opened as long as the previous one has been closed.\r\n\r\nThe system designer will determine in advance whether to trade in a trending or sideways environment. Within that environment, all signals are to be executed whenever they occur with little or no discetion according to predefined rules.\r\n\r\nThe main purpose of your system is to be profitable with historic data. In general, but not always, your system must be as *complete* as possible. A complete system is one that has you trading 100% of the trend and spending as little time as possible on the sidelines watching the prices trend in your direction. Profitability always trumps completeness.\r\n\r\nIn Part 3 and 4 we briefly explored signals. A signal is a price pattern that triggers the opening of a position. The signal may be any of the examples I used in part 4 of this series or it may be your own favorite signal. You choose the signals based on all the assembled evidence supporting the signal's usefulness and profitability. To open the position you turn to the setup tools from our earlier series on \"The Basic Setup\".\r\n\r\n\r\n##### **What is not a system**\r\n\r\nIt is not a system just because you open a position in reaction to a signal. Every signal could fail. It starts to become a system when you are prepared for that possibility with a strategy to deal with it. Withdrawing to lick your wounds or changing to a different market where you \"might have more luck\" is not a system. If you have correctly identified the trend, you need to be ready to unemotionally open on the next signal, confident from your testing that the system wins over time.\r\n\r\n##### **A Martingale - A dangerous system**\r\n\r\nA martingale is a strategy where the risk is doubled after each loss in the hopes of paying off the previous loss(es) and reaching a profit.\r\n\r\nIt's a dangerous system that will almost certainly lose all the funds in your account. All it takes is five losses in a row starting at 2% of your capital before you have lost 62% and are unable to make the next double. If you risk all that remains on a 6th signal and lose, you are wiped out. As I pointed out in \"A Simple Setup\", five losses or more in a row are common enough that you should never risk more than 2%.\r\n\r\nThe next table summarizes your balance after each consecutive loss:\r\n\r\nRound  | Risk  |  Cumulative Loss  |  Remaining funds\r\n-------|-------|-------------------|-----------------\r\n1      | 2%    |  2%               |  98%\r\n2      | 4%    |  6%               |  94%\r\n3      | 8%    |  14%              |  86%\r\n4      | 16%   |  30%              |  70%\r\n5      | 32%   |  62%              |  38%\r\n6      | 38%   |  100%             |  0%\r\n\r\nNotice how by the 4th loss you have risked 30% just to make 8% - assuming your normal risk/reward multiplier is 4 and your trade risk is 2%? That alone should keep you away from this train wreck. Even if you start with just 0.1% of your funds, a quick calculation will show that you will lose half your account after ten consecutive losses, with the next failed trade wiping you out.\r\n\r\nIt works wonderfully though if you have unlimited funds available to trading, which nobody has. Margin rules should prevent you carrying out this strategy before you are ruined, but you also will not be able to recover your original trade balance, as the doubling strategy had promised.\r\n\r\nIf you play a martingale regularly, you will sooner or later face ruin. It is *not a trading system*.\r\n\r\n\r\n#### Calculating the Target Price using Simulations\r\n\r\nWhen you place one trade on a particular instrument as we did in \"The Basic Setup\", you are free to choose a TP that seems achievable given the current price action. Perhaps you choose a nearby level or an overhead area of resistance. However when running a system without any discretion, the TP will be different for each trade and therefore the calculation of the TP must derive from elsewhere.\r\n\r\nThe easiest solution is to use a multiple of the risk of the trade, where the risk is OP-SL. For example, you could insist that all trades must achieve a double (or 2 x OP-SL) before being automatically closed out. This number is based on the **`risk/reward ratio`** (RRR) and clearly it matters. If the RRR is 1:2 then for every $1 risked, $2 is expected as the reward or win. In our simulations we are more interested in the **`risk reward multiplier`**, which is the inverse of RRR, and to refer to it I will be using the notation **RR**. In this case we might say the RR equals two (1:2 becomes 2/1, or 2).\r\n\r\nIf you set a value too high for the RR then many or all trades could fail as the SL gets triggered first rather than the faraway TP. If in turn it is set too low then the trade is more likely to win but the winnings may not be greater than losses from other failed trades. It is apparent that there is an optimal, Goldilocks level for the RR for each market and leg of the trend, not too high nor too low.\r\n\r\n![SPX Setup Example](/media/uploads/2017/basic_system_trading/Setup-EG-TP4x.png \"SPX Setup Example\"):R60\r\nFor example, as you can see in the adjacent chart, if we used an RR=4, we could calculate TP easily by adding four times the trade risk to the OP. The trade risk (TR) would be just the amount we would lose if the stops were triggered, or (OP-SL). Multiply that risk by four and add it to the open price and we would have the TP to use for the setup.\r\n\r\nFor each RR there is a total win or loss from the system when applied to a range of historic data on a particular market. This RR will be calculated by simulating the system using historic prices and trying different values for RR until an optimum is found. I will do an example in the next story.\r\n\r\nThe purpose of the simulation is to determine the optimal RR so we can calculate the TP in every setup. Of course, the RR is not some fundamental constant of the universe - we expect it to change over time and in different markets. However our simulations may show some RR levels are more stable than others. Or we may find minimum or maximum RR ratios for certain markets or trend situations. Either way, we will end up with an RR that we will automatically be applied to each setup in the sequence of trades that make up our system.\r\n\r\n#### Simulations\r\n\r\nThe rules for reacting to signals within a system are determined during design and testing. The testing will simulate the real world consequences of applying the signal to historic data.\r\n\r\nA simulation makes all the calculations you would in a real trade using real data *as if* you opened the position with your broker. Whether your simulated trade is stopped out for a loss or goes on to win at the TP depends on what happened in the real market with real historic data. You do not actually execute the trade with your broker, in fact your broker has nothing to do with your simulation. The simulation can be done with pen and paper or with a computer program if you have the skills. If you are so inclined, it's easiest to get started using a spreadsheet, however we will do it manually here.\r\n\r\nBut how to we get the RR for the market, timeframe and trend that we trade?\r\n\r\n![Simulation Flowchart](/media/uploads/2017/basic_system_trading/simulation-flowchart.png \"Simulation Flowchart\"):C80\r\n\r\nThe RR will be calculated by simulating the system using historic prices and trying different values for RR until an optimum is found. I will do an example further below.\r\n\r\nWe have a chicken and egg situation: we need to run a simulation of the system to calculate an RR value but the simulation requires an RR value to run. The solution is to run the simulation starting with a low *guesstimate* value and then rerun the simulation with progressively higher values and compare results. Each increment in the RR, or **step**, is a value we decide on. If an optimum is reached, we can use that value for RR and calculate TP for each setup.\r\n\r\nNormally you would start simulating with an RR of one, unless you have reason to believe your signal is so powerful that it wins most of the time. If that is the case, then you could start with RR=0.1. In order to win with such a low RR, you must win more than ten setups for every one you lose - not impossible but certainly cause for concern.\r\n\r\nNext, the RR value is raised by a certain amount called the step size. If you started with RR=1, the step size might be 0.5 or one because in the first run you want to locate the area that is most profitable by quickly testing across a wide range. Later on, you can always backtrack to zoom in with a smaller step size. It really helps if your testing is automated with a computer program otherwise it can become tediously repetitive.\r\n\r\nAs we run simulations over the historic data with progressively higher values of RR, we make a note of our profit or loss from the system. After we finish, we choose the RR that gave us the highest profit, if one exists.\r\n\r\nIn some cases we might discover that the system is a failure and no RR value yields a profit. We can discard those systems or send them back to the 'laboratory' for further testing. In other cases we might discover there is no optimum because the market is in a relentless trend. In such a case the best strategy would be to keep trying entries with no TP until we find one that does not get stopped out. This would be akin to buying the S&P in 1923 and not selling. Each attempt would cost us 2% of our capital but the first winner would beat all those losses.\r\n\r\nThe 1987 market crash, while huge at the time, is now just a distant wiggle in the charts and an excellent entry position. This is the famous equities buy and hold strategy, which was more popular in the 1990s than today. That's reasonable considering all recent positions from 1997 until 2009 have been stopped out by the dotcom crash and the 2008 credit crisis, unless they had an SL way below the market.\r\n\r\nWithin a system, any one signal might fail leaving you with a loss. But when you trade all valid signals during the course of the trend you are following a system. A successful system will win more than it loses, even if more trades resulted in a loss.\r\n\r\n#### Summary\r\n\r\nA system is a series of trades that our testing with historic data suggests will win over time. We need a method to establish an optimum risk/reward multiplier for the market we trade which we will calculate by simulating trades on the historic data and observing the outcome for different RR levels.\r\n\r\nIn the following stories in this series I will try to pick tricky examples to show what can go wrong in our testing. In some cases the market is in a strong trend, in other cases there is either a mild trend or you are tricked into thinking there is a trend when in fact there is none. The key here is experience. Each time you run a simulation on a new set of data you learn something new. We need to use these methods frequently so they become part of our trading tools.\r\n\r\nIn the next story in this series I will show you the mechanics of such a simulation.\r\n<br>\r\n<br>\r\n<br>\r\n<br>\r\n<br>\r\n\r\nCopyright (C) PagooLABS 2017. All Rights Reserved.\r\n\r\n\r\n*[HA]: Heikin Ashi\r\n*[MA]: Moving Average over a specified period - 100 periods for eg\r\n*[EMA]: Exponential Moving Average - has a long 'memory'\r\n*[OHLC]: Open, High, Low, Close: the 4 key values for any bar on a chart\r\n*[bull]: An uptrending or rising market\r\n*[bear]: A downtrending or falling market\r\n*[SL]: stop loss\r\n*[TP]: target price\r\n*[OP]: open price\r\n*[CR]: Contract Risk\r\n*[CS]: contract size\r\n*[CO]: number of contracts opened\r\n*[MR]: Maximum Risk\r\n*[USD]: United States Dollar\r\n*[AUD]: Australian Dollar\r\n*[Yen]: The Japanese currency\r\n*[Euro]: The European currency\r\n*[EURJPY]: The Euro - Yen cross currency: buying Euros priced in Yen\r\n*[forex]: Foreign Exchange including markets and trading\r\n*[signal]: a price pattern in the market triggering the opening of a position\r\n*[setup]: An instance of a signal ready for trading with values for the number of contracts and the Open, Stop and Target prices\r\n*[instrument]: A particular traded forex or futures contract such as gold or USDJPY\r\n*[instruments]: Particular traded forex or futures contracts such as gold or USDJPY\r\n*[underlined text]: Congratulations! You have successfully hovered over text\r\n*[indicator]: A calculated line, such as a Moving Average drawn on a chart, that is separate from the OHLC prices but often calculated from them\r\n*[indicators]: Calculated lines, such as Moving Averages drawn on a chart, that are separate from the OHLC prices but often calculated from them\r\n*[H4]: Chart of the four hour timeframe\r\n*[M5]: Chart of the five minute timeframe\r\n*[H1]: Chart of the one hour timeframe",
            "image": null,
            "forums": [
                {
                    "url": "https://www.pagoolabs.com/forums/api/trading-education/?format=api",
                    "title": "Trading Education"
                }
            ],
            "replies": 0
        },
        {
            "url": "https://www.pagoolabs.com/stories/api/46/?format=api",
            "id": 46,
            "title": "Examples of Signals in Forex and Futures Trading",
            "slug": "trading-systems-part-4-examples-of-signals",
            "status": 2,
            "publication_date": "2017-10-24T03:51:27Z",
            "lead": "This fourth story in the series \"Introduction to Trading Systems\" explores examples of simple signals: the MA cross, Pin Bars, Engulfing patterns and Heikin Ashi reversals.",
            "excerpt": "This fourth story in the series on Trading Systems explores examples of simple signals: the MA cross, Pin Bars, Engulfing patterns and Heikin Ashi reversals.",
            "poster": "SeanManefield",
            "content": "---\r\n#### **Trading Systems Part 4 - Examples of Signals**\r\n\r\nThe [previous story](/stories/45/2017/10/24/trading-systems-part-3-signals/) described the class of triggers we call signals. In this story we will explore some simple examples of signals. Most of these you will be familiar with and they help to clarify the terms we use in the next story on systems.\r\n\r\nAs examples, we will discuss the following types of signals:\r\n\r\n- MA cross\r\n- Pin bars\r\n- Engulfing patterns\r\n- Heikin Ashi reversals.\r\n\r\n<a id=\"Moving-Average-Cross-signals\"></a>\r\n#### Moving Average Cross signals\r\n\r\nAn MA cross signal occurs of course when two MAs cross. One MA has a longer periodicity than the other meaning that it will be slower to react to the latest prices while the MA with the shorter time period will react faster. If the previous trend had been a bear market then prices would generally be below the two MAs with the faster MA closer to the real market prices than the slow MA.\r\n\r\n![MAs above prices in downtrend](/media/uploads/2017/basic_system_trading/EJ-D1-MA-DN-20171013-2.png \"EURJPY MA Downtrend\"):C80\r\n\r\nIn a bull market, the opposite occurs with the slow MA below the faster, and *both* below the actual rising prices. The two charts of EURJPY show different phases of a cycle, with the first above showing a downtrend with the MAs lying above and to the right, and the following chart showing an uptrend with MAs underneath.\r\n\r\n![MAs below prices in uptrend](/media/uploads/2017/basic_system_trading/EJ-D1-MA-UP-20171013-0.png \"EURJPY MA Uptrend\"):C80\r\n\r\nFor the slow MA to be above the faster MA in a bear market but below in a bull market they must have **crossed** over at some point when the trend reversed. This is point A in the charts. This crossover point is frequently used as either a trend starting point or even as an entry signal for actual trading.\r\n![MA Cross on USDJPY](/media/uploads/2017/basic_system_trading/USDJPY-MA-Cross-20171017.png \"MA Cross on USDJPY\"):R40\r\n\r\nWe could use a second set of MAs with even shorter periods, such as MA20 and MA8, as our *signal* while reserving the longer 100 period MA as an indicator of *trend*. While admittedly simple, such a trading system could in fact work, depending on how you tested and implemented it. If there is an advantage to using a more complicated system, you should find that out in the testing.\r\n\r\nThe setup itself is made complicated by the long period of time that evolves while a cross is taking place and the fact that because we are dealing with averages, the low probably does not occur in the same period as the cross. Instead find the lowest price of all the bars leading up to the cross starting from the last downtrend. During the downtrend, prices were higher. At some point they must have flattened out before turning up to create the cross. Sometime in that period a lowest price must have been set. Use that low for the SL. Refer to the accompanying chart of the S&P futures.\r\n\r\n![MA Cross Setup on S&P500](/media/uploads/2017/basic_system_trading/SPX-D1-UpT-MACross-Setup-20171019.png \"MA Cross Setup on S&P500\"):R60\r\n\r\nEven if you witness a cross forming during the period, it may or may not actually appear on the charts depending on the closing price of the bar that day. You can never be sure the cross will complete until the close of trading. The open price should be the open of the very first bar *following* the cross although you're free to enact some intricate open policy that involves a confirmation pattern. That policy emerges later from your testing.\r\n\r\nWith the SL and OP set you can easily calculate the number of contracts to open (CO). The TP would usually be based on some multiple of the risk (OP-SL) and I will discuss that important topic in the story on [testing systems](/stories/48/2017/10/24/trading-systems-part-6-simulations-on-systems/). With the OP, SL, TP and CO we have all the elements required for the setup based on a particular signal.\r\n\r\nTo summarize the MA cross signal:\r\n\r\n- In an uptrend, when the faster MA crosses from below the slower MA to above, open a long position.\r\n- In a downtrend, when the faster MA crosses from above the slower MA to below, open a short position.\r\n\r\nBut MA crosses are just one class of signals out of many. Let's look at a few more.<a id=\"Pin-Bar-Signals\"></a>\r\n\r\n\r\n#### Pin Bar Signals\r\n\r\nPin bars belong to a set of simple candlestick patterns, such as doji, hanging man or shooting star. These are sometimes called pin bars when they exhibit certain extra characteristics such as position, shape and size that dominate surrounding bars. There are many other candlestick patterns and we plan to run a future story on some of these and how to use them in a system.\r\n\r\n![Pin bar in an uptrend](/media/uploads/2017/basic_system_trading/OK-PB-20171013.png \"Pin bar in an uptrend\"):R40\r\nA pin bar is a candlestick with a small body at one end and a much longer tail. The key idea is that a particular area has been tested by the long tail and rejected. The market probed down into the support area, triggered the stops and instead of continuing in that direction, bounced right back. The open trades that did not trigger are now considered to belong to *stronger hands*: traders who are less likely to be stopped out next time.\r\n\r\n![Pin bar](/media/uploads/2017/basic_system_trading/Pin_Bar.png \"Pin bar\"):R40\r\nBy shape alone, a pin bar is like a traditional hanging man or shooting star candlestick, although most practitioners only accept a subset of such candles as true pin bars. A *true* pin bar must usually dominate the surrounding pattern and either indicate a resumption of the trend after a retracement or be at the bottom or top of the range in a sideways market. You should strongly avoid accepting every hanging man or shooting star as a pin bar signal. Critically examine the charts to see how often this pattern fails to work as a signal when it is against the trend.\r\n\r\nThe setup is straightforward - the SL should be just beyond the tail of the bar, and the OP could be the open of the next bar. Or you could set a stop-limit order to trigger you into the trade when the market price moves above the top of the pin bar head (for a long trade).\r\n\r\nWith the SL and OP set you can easily calculate the number of contracts to open (CO). As with the MA cross, the TP would usually be based on some multiple of the risk.\r\n\r\nUsing only a pin bar is not a complete system because if the setup is stopped out, it is rarely followed by another pin bar to signal re-entry. However it can be combined with other entry signals such as the engulfing or outside bar pattern to provide a more complete system, and we turn to that now.<a id=\"Engulfing-pattern-signals\"></a>\r\n\r\n\r\n#### Engulfing pattern signals\r\n\r\nAn engulfing pattern or outside bar is a two bar pattern where the second bar reverses direction and has both a higher high and a lower low than the first. In other words, the second bar encloses or *engulfs* the first.\r\n\r\n![Example outside bar in uptrend](/media/uploads/2017/basic_system_trading/OB-EG-20171014.png \"Example outside bar in uptrend\"):R40\r\n\r\nIf you think about it, this is similar to a pin bar except it plays out over two periods instead of one. On the first day (or period) the market continued its retracement against the trend. On the second day the market opened lower in a bearish sentiment and attempted to go even lower before surrendering to the upward trend in a wave of buying that sent prices higher than the open of the previous day.\r\n\r\n![Outside Bar](/media/uploads/2017/basic_system_trading/Outside_bar.png \"Outside Bar\"):R40\r\nAs with the pin bar, there is the strong sense that the area below has been tested and rejected. But testing and rejecting really only makes sense when the market is probing *against* the real underlying trend. When prices are moving with the trend there are multiple examples of engulfing patterns that never lead to any price reversals.\r\n\r\nThe setup is similar to the case of the pin bar - the SL should be just beyond the tail of the larger outside bar, and the OP could be the open of the next bar or you could set a stop-limit order to trigger you into the trade when the market price moves above the top of the outside bar (for a long trade). The TP and CO are as discussed earlier for the other signals.\r\n\r\nAs with the pin bar, it needs to be combined with several other signals to be a complete system. Together with the pin bar you might be able to catch at least one of the entry points in a trend but whether it's enough to offset losses would depend on what your historical tests will show.\r\n\r\nTo make the engulfing pattern and pin bar more complete, you could also add the Piercing Line pattern (or Dark Cloud Cover) as well as a number of two bar reversals that don't quite qualify as engulfing patterns.\r\n\r\nIn 24 hour forex markets, gaps at the open are not possible unless they happened in the final minutes of trading. For this reason, outside bars are less prevalent than two bar reversals where both bars have a common low but the second has a higher high. You might like to use these in addition to engulfing patterns if you are trading in forex markets.\r\n\r\nCandlestick patterns are a huge field and there is much to explore. Fortunately there are many sites on the web that cover all these patterns.<a id=\"Heikin-Ashi-Candlesticks\"></a>\r\n\r\n#### Heikin Ashi Candlesticks\r\n\r\nHeikin-Ashi (HA) is a different candlestick design that smooths out the shortest term fluctuations in each bar. Because HA bars are a different shape than the standard candlesticks, the technique is not very popular with traders. However there are solutions to most of these problems. HA is presented here as an example of an uncommon technique. Below, side by side are the same two sections of the chart of the S&P futures contract. The chart with the normal candles is to the left and on the right is the same chart using Heikin Ashi candles.\r\n\r\n<div class=\"clear-floating-cols-above\"></div>\r\n![S&P 500 with Normal candlesticks](/media/uploads/2017/basic_system_trading/SPX-D1-Normal-Section-20171020.png \"S&P 500 with Normal candlesticks\"):L45\r\n![S&P 500 with HA candlesticks](/media/uploads/2017/basic_system_trading/SPX-D1-HA-Section-20171020.png \"S&P 500 with HA candlesticks\"):R45\r\n<div class=\"clear-floating-cols-above\"></div>\r\nAll candlesticks are composed of the Open, Close, High and Low or OHLC. Heikin Ashi (HA) candlesticks are made up of averages of these four key values: haClose, haOpen, haHigh, haLow. Because the averages for the haOpen, haHigh and haLow are further averages of earlier candlesticks, each HA has a 'memory' in much the same way as an exponential MA. Here are the formulae so that you can see how the memory kicks in:\r\n\r\n    Where t represents the current period, and t-1 the previous:\r\n        haClose = (Open[t] + High[t] + Low[t] + Close[t]) / 4\r\n        haOpen = (haOpen[t-1] + haClose[t-1]) / 2;\r\n        haHigh = maximum of High[t] and haOpen;\r\n        haLow = minimum of Low[t] and haOpen;\r\n\r\nSo the close is just the average of the current periods values but the others are all averages in some way of the earlier period, unless the current high is higher or the current low is lower than the average. It should come as little suprise that the HA reversals track an exponential MA cross of very short duration.  ![SPX daily chart](/media/uploads/2017/basic_system_trading/SPX-D1-20171012-EMAvsHA.png \"HA vs EMA4/2\"):R35 The short period, or fast MA, uses EMA(2) with HLCC/4 as the value used in each period (if this is confusing then just use the normal close value).\r\n\r\nWhere they cross is often the same time period where HA changes direction, so we can use the MA cross as a proxy for HA when it's not available. For the long period, or slow MA, use EMA(4). Remember the bars must close before you can know whether the MA crossed in that period or not. It's much easier to visualize these reversals with HA so you would only use MAs if HA is not available in your charting software.\r\n\r\nIn fact, many of these signals are not independent of one another because they are based on the same four market numbers contained in OHLC. There are only just so many ways you can slice and dice four numbers so you will often end up with the same result from otherwise different indicators.\r\n\r\nHere is an example of the EURJPY downtrend chart shown earlier in the section on MA crosses, but this time using Heikin Ashi bars. ![Heikin Ashi chart of EURJPY daily](/media/uploads/2017/basic_system_trading/EJ-D1-MA-DN-HA-20171013.png \"Heikin Ashi chart of EURJPY daily\"):R55 In these charts, HA is displayed in red whenever the haClose<haOpen, and in green otherwise. A great advantage over normal candlesticks is HA highlights the runs in one particular direction, smoothing out the minor fluctuations that distract you from the bigger picture.\r\n\r\nTo be sure, HA candlesticks cannot replace the normal charts, but they are a great addition when you flick quickly between both. If your software allows multiple open charts, and most do, just set up the normal chart in one window and the Heikin Ashi chart for the same instrument in another.<a id=\"HA-signals\"></a>\r\n\r\n\r\n#### HA signals\r\n\r\nOne signal that is readily apparent is to open whenever a bar changes from red to green if the trend is up. You must not already have an open position and you will need to **wait until the first green bar is complete** at the end of the period. Because the bar has changed color, there must have been a low set during the change, either on the new green bar or one of the immediately preceding red bars. Just below that is where you place your stop loss.\r\n\r\nThe setup then is similar to the case of the MA cross. With the SL determined, the OP should be the open of the first bar *after* the green reversal bar (red in a downtrend). The TP and CO are as discussed earlier for the other signals. See [The Basic Setup](/stories/38/2017/10/24/basic-trade-setup-part-1-introduction/) if you are unclear on any aspect of the setup tool.\r\n\r\n![Heikin Ashi chart of S&P500](/media/uploads/2017/basic_system_trading/SPX-D1-HA-rev-20171012-2.png \"Heikin Ashi chart of S&P500\"):C90\r\n\r\nAbove, in the Heikin Ashi chart of the S&P500 continuous futures contract, most of the HA reversals have been marked with a green check if they have not yet been stopped out, or a red cross if subsequent prices triggered the SL.\r\n\r\nEven in an uptrend it's possible to see that about half the reversals were successful and the other half failed. That's because the unsuccessful signals occur in areas of consolidation and involved much whipsawing causing many minor reversals. The successful signals on the other hand resulted in resumption of the trend and continued for some time before the next HA reversal down.\r\n\r\nIf you open a signal that eventually fails you will open the next signal, which should come after the series of bars that stopped out your trade. If that fails you will open the next, and so on. Eventually, unless the trend has changed, you will be in a position that has the lowest SL of all those earlier failed trades.\r\n\r\nYou can see this on the chart above in the troublesome area after point A. The first setup fails, triggered by the concerns over the UK Brexit vote. When the market resumes in the direction of the trend, a new HA signal is triggered, this time with a lower SL than the first setup. None of the bad HA setups that follow should impact the open position because its stop never gets triggered and one of the rules is to not open a second position.\r\n\r\nHowever if for some reason you did not enter on the first signal, the next occurs about six days later. It eventually fails, stopped out by the US 2016 election result. Before then however there are multiple signals to enter, all of which fail for the same reason, but none of which affect you because you already have an open position. The point is that many of the failed signals on a chart are irrelevant, you will be in the first one until that fails, if it does. If it wins it will of course need a TP to compensate for the losses.\r\n\r\nThe HA signal is complete in the sense that the trend cannot resume without you. It is not possible for the market to trade higher after a period of retracement without first signaling an HA reversal.\r\n\r\nWhat could go wrong is that the reversal bar could be very large and untradable, like the spike we talked about above for pin bars. In that case you will have to wait for a more reasonable sized correction. Large spikes usually, but not always, provide these later opportunities. In the meantime however, you could miss out on a substantial rally in line with the trend.\r\n\r\nAside from the huge reversal spikes, the only part of the trend that is not covered are the bars after the TP has been hit and before the next HA signal. If the next signal is higher than the TP, which can happen, then the trader will miss out on a portion of the trend.\r\n\r\nThe disadvantage of the HA is that it displays candlestick bars that are slightly different to the real bars - it is after all an averaging system. To correct this, use your software to show both charts, the normal one and the HA, side by side. Or better still, place one chart on top of the other and then flick between them so that you can see the signals and the original chart. In this series, whenever I can, I will try to place them side by side with the HA on the right. Also, the normal chart has the EMA4 (green) and EMA2 (gold) moving averages so that you can compare the signals with the HA chart.\r\n\r\nThis section has not done justice to Heikin Ashi which has its own set of candlestick patterns differing from the traditional ones. Candlestick tails (shadows) or their absence take on new meaning. If you are interested, there are many books and sites on the web that discuss this technique further.\r\n\r\n#### Custom Signals\r\n\r\nThese examples above illustrate how to create a setup around any custom signal. All that is required is a clear, unambiguous trigger to open a position starting at a particular time period with some condition specifying the open price. To open the position you use the setup tools from our earlier series on \"The Basic Setup\". Looking around the area the signal occurs, you should be able to identify the most appropriate SL level. The setup tools describe the number of contracts and your own simulation described in a later story determine the TP.\r\n\r\n#### Summary\r\n\r\nHere we discussed what qualifies as a signal and showed several different signals based on MAs, candlestick patterns and Heikin Ashi charts.\r\n\r\nNote, these are all simple signaling systems: there is nothing complex about a pin bar or crossing moving average. Taken by themselves they could lose more than they would win. However when combined into a system they become powerful trading tools.\r\n\r\nIn other stories and posts I may use different signals just to show how widely the system method can be applied. While it does not depend on any one signal strategy, every system needs at least one signal strategy in order to trigger opening a long or short position.\r\n\r\nThe problem with signals is that sometimes they fail and the setup is stopped out. By itself, all we can say is the signal was successful or unsuccessful. However if losses are accumulating in the account then you are faced with the very real prospect of being wiped out. We need the bigger picture to see if all the positions we have opened as a result of signals are winning or likely to win.\r\n\r\nNow we turn to [building our first system](/stories/47/2017/10/24/trading-systems-part-5-systems/). With all the building blocks in place - trend, setup and signal - it is just a matter of assembling them in the right order into a system.\r\n<br>\r\n<br>\r\n<br>\r\n<br>\r\n<br>\r\n\r\nCopyright (C) PagooLABS 2017. All Rights Reserved.\r\n\r\n\r\n*[HA]: Heikin Ashi\r\n*[EMA]: Exponential Moving Average - has a long 'memory'\r\n*[OHLC]: Open, High, Low, Close: the 4 key values for any bar on a chart\r\n*[bull]: An uptrending or rising market\r\n*[bear]: A downtrending or falling market\r\n*[SL]: stop loss\r\n*[TP]: target price\r\n*[OP]: open price\r\n*[CR]: Contract Risk\r\n*[CS]: contract size\r\n*[CO]: number of contracts opened\r\n*[MR]: Maximum Risk\r\n*[USD]: United States Dollar\r\n*[AUD]: Australian Dollar\r\n*[Yen]: The Japanese currency\r\n*[Euro]: The European currency\r\n*[EURJPY]: The Euro - Yen cross currency: buying Euros priced in Yen\r\n*[forex]: Foreign Exchange including markets and trading\r\n*[instrument]: A particular traded forex or futures contract such as gold or USDJPY\r\n*[instruments]: Particular traded forex or futures contracts such as gold or USDJPY\r\n*[indicator]: A calculated line, such as a Moving Average drawn on a chart, that is separate from the OHLC prices but often calculated from them\r\n*[indicators]: Calculated lines, such as Moving Averages drawn on a chart, that are separate from the OHLC prices but often calculated from them\r\n*[H4]: Chart of the four hour timeframe\r\n*[M5]: Chart of the five minute timeframe\r\n*[H1]: Chart of the one hour timeframe",
            "image": null,
            "forums": [
                {
                    "url": "https://www.pagoolabs.com/forums/api/trading-education/?format=api",
                    "title": "Trading Education"
                }
            ],
            "replies": 0
        },
        {
            "url": "https://www.pagoolabs.com/stories/api/45/?format=api",
            "id": 45,
            "title": "Important Things to Know About Forex and Futures Trading Signals",
            "slug": "trading-systems-part-3-signals",
            "status": 2,
            "publication_date": "2017-10-24T03:49:44Z",
            "lead": "This third story in the series \"Introduction to Trading Systems\" explains a signal, the trigger alerting us to open a position in an instrument.",
            "excerpt": "This third story in the series on Trading Systems explains a signal, the trigger alerting us to open a position in an instrument.",
            "poster": "SeanManefield",
            "content": "---\r\n#### **Trading Systems Part 3 - Signals**\r\n\r\nA signal is a price pattern trigger that opens a position. It might be a crossing moving average, a candlestick pattern such as a pin bar, or one of a host of other available indicators.\r\n\r\nA Signal then is a general *class* of market events that act like triggers. A Setup is a particular *instance* of a signal and includes all the trade data necessary to open that position.\r\n\r\nThe difference between signal and setup is much like the *concept* of dog versus a *real* dog. In your head you can imagine a dog and there is no chance of confusing one with a horse. But in the real world, dogs come in all shapes and sizes from cute little puppies to Great Danes. We still readily recognize a particular animal as a dog when it exhibits familiar dog-like qualities.\r\n\r\nIn the same way, signals are a class of triggers while setups are the real-world instance of those signals and provide the actual OP, SL, TP and CO you need to make a trade. You can use the terms interchangeably if you like which might result in some minor confusion, as long as you don't confuse either with a horse. When we talk about a signal, we imagine a reversal or some other specific trigger pattern. When we talk about a setup, we describe the particular SL and OP that surround that reversal, as can be seen in the annotated chart of the S&P below which uses a Heikin Ashi signal.\r\n\r\n![Signals vs Setup](/media/uploads/2017/basic_system_trading/SPX-D1-HA-rev-EG-signal-vs-setup-20171012.png \"Signals vs Setup\"):c95!\r\n\r\n\r\n** Open Only with the Trend **\r\n\r\nSo far we have discussed trend which I have argued will determine the direction of our trades. Since we only trade with the trend, we should ignore signals that trigger in the opposite direction. In a bull market we only open long. Since a computer program should in principle be able to flag opportunities on a chart, a signal must include all the rules you have decided to check before opening a trade. For example, if you only open pin bars in the direction of the trend then a pin bar at the top of a swing high is not a signal in an uptrend.\r\n\r\nWithin the trend we can use the setup tool to construct an OP, SL, TP and CS for *any* candlestick bar. Although I do not advocate your trying this, it explains why we discussed the setup first. The setup can be used anywhere, although probably not profitably. Since each bar has a low and a close, the low could be used as the SL and the OP would use the close of this bar or the open of the next. The number of contracts derives from risk (OP-SL). All we need to finish the setup is an optimal TP.\r\n\r\n** Support and Resistance **\r\n\r\nIf we applied such a strategy to every bar on the chart we could expect a disaster. There are too many whipsaw regions where stops would be constantly triggered. This naturally leads us to exclude most bars as open candidates for signals and instead concentrate on the small subset of bars where probability favors our trade.\r\n\r\n![Rejection & Support with a Pin Bar](/media/uploads/2017/basic_system_trading/Pin_Bar.png \"Rejection & Support with a Pin Bar\"):R40\r\nThe key to a good signal is that an area has been tested by the market and rejected. That's where we want to place our stops. The market may come back to test that area again and there is no guarantee our stops will hold. But that's also true everywhere on the chart. The one thing we know about an area of rejection is that it was tested at least once and the level held. Enough other traders entered in the direction of the trend before those levels were breached and that is an important defense of our trade in the future, raising the probability, however slightly, that our trade setup will succeed.\r\n\r\nAny pattern that tests and rejects an area of support is a *candidate* for a signal. Whether it's an acceptable candidate or not remains to be seen. Eventually you will decide on a small class of identifiable patterns that you will use as signals, all other patterns will be considered normal bars. Identifying areas of support (or resistance in a bear market) and how your signal exposes them will be your mission.\r\n\r\n** A Retracement Ending **\r\n\r\n![Retrace before Pin Bar](/media/uploads/2017/basic_system_trading/PB-OK-retrace.png \"Retrace before Pin Bar\"):L20\r\nWe might reasonably impose the extra condition that some kind of retracement occurred before the candidate signal. After reviewing all the historic data we might exclude from our signals any patterns that were not preceded by at least two periods of trading against the trend. This is a filter that *you* will decide for your own favorite signal. Trigger patterns that are not *prominent* in some way have not yet tested and rejected an area. The SL level you use must have a higher probability of surviving a retest than any normal bar.\r\n![No retrace before pin bar](/media/uploads/2017/basic_system_trading/PB-No-retrace.png \"No Retrace before Pin Bar\"):R40\r\n\r\n** Avoid Spikes **\r\n\r\nSometimes the stop loss level is so far away from the open price that the corresponding TP will lie somewhere far in the opposite direction. Reaching such a target price might seem improbable to an experienced trader. This might occur if our prospective SL is a large spike caused by some dramatic news that hit the market, in which case it may be better to wait for the next retracement to enter.\r\n\r\nIn the same  way, avoid markets when major unexpected events are under way such as a war starting, the UK Brexit vote, or the USA 2016 election. Clearly there's nothing you can do to avoid these events if you are already in a trade and the unexpected is happening. But you should avoid plunging into a trade to take advantage of the volatility. Your stops will be highly vulnerable and the days following would be a much better trading environment.\r\n\r\n** No Waiting: Open According to your Trading Rules **\r\n\r\nDepending on your signal, you must open at the start of trading of the very next period OR wherever you tested in your simulations. If you wait for a better price you stand to miss out on the trade all together and all your testing results for the signal and system no longer apply. \r\n\r\nFor example, some setups fail and more of the trades that failed may have fallen to a 'better price' at the open than those that were successful, leaving you with positions in a greater proportion of losers. When this is true, your real trading results will underperform your tests results.\r\n\r\n** Only One Position at a Time **\r\n\r\nSince we do not want our total risk in this position to exceed 2%, never open a new trade when one is already open, except in other uncorrelated markets. If your trade is winning, other traders will be on the same ride as you. New signals occurring in the market at that time will be ignored by successful traders because they know not to amplify their risks with more than 2% of their risk capital, or whatever percentage they allocate to an open trade. That means you will be opening a trade where other traders are less likely to join in to help propel the price in your direction.\r\n\r\n![No Multiple Positions](/media/uploads/2017/basic_system_trading/SPX-D1-HA-rev-Single-Positions-20171012-2.png \"No Multiple Positions\"):R50\r\nThis is also true if there had earlier been a clear signal that you missed for some reason. The other traders whom you would like to join you in this trade are already in that earlier one. There are no secrets in the markets - if you can see a signal worth trading then so can many others. What may look like a pin bar to you could look like an engulfing pattern to another trader using a shorter timeframe. If the price moves up then another trader's MAs will cross. Momentum will also change, triggering even more traders to join the trade. So other traders may be following different signals to you but they may still be triggered to open in the same general area as your signal.\r\n\r\nTread carefully once you have open trades and always check the correlations between the markets you choose. If two markets are 100% correlated then you cannot have simultaneous positions in both markets. It would be as if you were trading the same instrument but with double the risk. For this reason, avoid trading in correlated markets until you have exited the other position. If you are unsure about correlation in general or whether two markets are highly correlated then it's best to just trade one market at any one time.\r\n\r\n<a id=\"Rules-and-Filters\"></a>** Rules and Filters **\r\n\r\nA signal then is a set of rules about when to enter a trade. On the one hand there are the mechanical rules that I discuss below, such as a pin bar must occur or an MA must cross. These are mechanical because they involve no discretion and arise straight from a pattern of market prices on the chart. On the other hand there are filtering conditions we might apply before we open a trade. For example:\r\n\r\n- the trade must be in the direction of the trend\r\n- avoid candles with huge spikes\r\n- a retrace should be of a certain percentage of the previous runup\r\n- the retrace should occur at some key level such as a **`fibonacci`** or support/resistance area\r\n- never open a trade if you are already open in this or a correlated market.\r\n\r\nYou might apply filters such as these after testing and observing their effects on the total profit of the system, as I discuss later. However, you the reader have a lot of fertile territory to improve on what we lay out here. Many filtering conditions will depend on the precise trigger you are using.\r\n\r\nA common set of filters are the momentum oscillators such as RSI and MACD. Filters tend to keep you out of trades, which is their purpose. However watch out in your testing to see if they add to or reduce your total wins. Helping you avoid bad trades is good, but keeping you out of good trades that win multiples of what you lose in bad trades is toxic.\r\n\r\n** Signal Coverage **\r\n\r\nFor a signal to be acceptable it must be immediately recognizable as the pattern you are seeking. Testing should already have confirmed that similar signals are profitable and it should have relatively complete coverage of the trend. \r\n\r\nBy *complete coverage* I mean that the signal will allow us to participate in the full run of the trend. If stopped out, we should receive another chance to enter via a subsequent signal. Buying at the bottom and selling at the top would of course be full coverage, if only such a thing were consistently possible. Missing the entire trend altogether would be zero coverage. We should prefer a signal that has better coverage because it's more likely to keep us in open positions during more of the trend.\r\n\r\nMoving average crosses and Heikin Ashi reversals are two examples having almost complete coverage, while pin bars depend on how often they occur in the relevant section of the trend.\r\n\r\n#### Summary\r\n\r\nThere are many different kinds of signals and traders have their own favorites. Since this is an education site, we are agnostic here about which signal you use. In the descriptions below, I will deliberately use the simplest signal I can find. My purpose is to describe *how* to go about building a system, not to advocate for any particular signal.\r\n\r\nIn other stories and posts I may use different signals just to show how widely the system method can be applied. A system does not require any one signal strategy but it does need a trigger in order to open positions. For this reason, you will have to select a signal method you are comfortable with.\r\n\r\nIt may well be that it does not matter in general what signal strategy you decide upon. What may be more important overall is how you apply it. I will discuss this further in the story about Systems.\r\n\r\nIn the [next story](/stories/46/2017/10/24/trading-systems-part-4-examples-of-signals/) I will discuss several common and not so common signal strategies: the MA cross, pin bars, engulfing patterns and the Heikin Ashi reversal. These are all just examples and you are encouraged to use whatever signal method you have been using to date.\r\n<br>\r\n<br>\r\n<br>\r\n<br>\r\n<br>\r\n\r\nCopyright (C) PagooLABS 2017. All Rights Reserved.\r\n\r\n\r\n*[HA]: Heikin Ashi\r\n*[MA]: Moving Average over a specified period - 100 periods for eg\r\n*[EMA]: Exponential Moving Average - has a long 'memory'\r\n*[OHLC]: Open, High, Low, Close: the 4 key values for any bar on a chart\r\n*[bull]: An uptrending or rising market\r\n*[bear]: A downtrending or falling market\r\n*[SL]: stop loss\r\n*[TP]: target price\r\n*[OP]: open price\r\n*[CR]: Contract Risk\r\n*[CS]: contract size\r\n*[CO]: number of contracts opened\r\n*[MR]: Maximum Risk\r\n*[USD]: United States Dollar\r\n*[AUD]: Australian Dollar\r\n*[Yen]: The Japanese currency\r\n*[Euro]: The European currency\r\n*[EURJPY]: The Euro - Yen cross currency: buying Euros priced in Yen\r\n*[forex]: Foreign Exchange including markets and trading\r\n*[signal]: a price pattern in the market triggering the opening of a position\r\n*[setup]: An instance of a signal ready for trading with values for the number of contracts and the Open, Stop and Target prices\r\n*[instrument]: A particular traded forex or futures contract such as gold or USDJPY\r\n*[instruments]: Particular traded forex or futures contracts such as gold or USDJPY\r\n*[underlined text]: Congratulations! You have successfully hovered over text\r\n*[indicator]: A calculated line, such as a Moving Average drawn on a chart, that is separate from the OHLC prices but often calculated from them\r\n*[indicators]: Calculated lines, such as Moving Averages drawn on a chart, that are separate from the OHLC prices but often calculated from them\r\n*[H4]: Chart of the four hour timeframe\r\n*[M5]: Chart of the five minute timeframe\r\n*[H1]: Chart of the one hour timeframe",
            "image": null,
            "forums": [
                {
                    "url": "https://www.pagoolabs.com/forums/api/trading-education/?format=api",
                    "title": "Trading Education"
                }
            ],
            "replies": 0
        }
    ]
}