Laying out a rational framework for developing your trading system by dissecting trading logic, step by step. I’m sure you’ve heard before that trading is all about developing your system and sticking to it. Indeed, following a specific, well thought out and logical scheme is instrumental to avoid falling in the trap of making rushed emotional decisions in the middle of the heat, which most times leads to disastrous results. A solid system also allows traders to be methodical, which is a prerequisite for learning through repetition. Following a method allows internalizing the thought process, making certain aspects of trading second nature. This frees up traders' mental capacity, which can be devoted to creative processes instead. With practice comes mastery. With mastery comes knowledge. With knowledge comes strength.—Marvel's Iron Fist Moreover, a proper logical method is the first and foremost requirement to make every trader’s dream come true: automated trading. Automating random, creative processes is rather challenging, while automating logical, methodical processes is straightforward. So, what does such a system look like? What kind of wizardry or black magic is in order? There is no magic. It’s pure logic. I will take you through a step by step analysis that you should be able to follow and understand. It doesn’t involve any high-level industry secret or guru-kind of skills. It relies on simple logic instead. I will lay out a , starting with the basics. I will then dissect the logic behind trading strategies, discuss how to build them and propose how to use them. framework You can think of this framework as a structure that can be further optimized by producing additional analysis on top. In fact, what I will cover in this article is Level One — the basics. If you are a bit lost with strategies, Technical Analysis or are still trying to crawl your way up the learning curve, understanding this framework will put you in the right mind space and will provide you with a solid foundation for your trading education. The purpose of this framework is to provide you with an understanding of how to develop your trading system, on which you can keep building as you advance in your trading career. The Basics In terms of structure, you can think of a trading system as a hierarchical arrangement organizing the actionable aspects of your investment plan. The structure would be quite large and complex if you were an Investment Bank but can be rather simple for traders just starting. The framework I will discuss allows for building more complexity at a later moment, as your trading experience develops and you get ready to implement more comprehensive processes. I will occasionally mention and touch on aspects that have to do with your . However, you will notice I will systematically avoid discussing the plan itself, as the scope of this article is the actual framework for your trading system. Dozens of books have been written on each of the topics that I will choose to skip, so please accept the narrow focus of the article from the get-go. Investment Plan Capital The first order of things is determining how much money you will be working with. This is your initial . capital I won’t go into details on how to determine this number or offer any kind of advice. Those kinds of concerns are out of the scope of this piece, as I wish to focus on the framework itself. So, it is up to you to determine what you will use for trading. The point to take home here is that . capital there is a finite amount of capital You will need to manage this . capital You will need to preserve it. And you will aim to increase it. Market The refers to the pair of assets you wish to trade with, for instance, BTC-USD, ETH-BTC, etc. market Again, there are many reasons why you may prefer a over others. Liquidity, volatility, the likability of the underlying project… you name it. market The matter of choosing a is out of the scope of this piece too, so let’s move on taking home the following point: , and — of course — you are free to choose more than one. market choosing a market is a strategic decision that you need to make Base Asset The third order of things is deciding what your is. That is, what asset you wish to stand on when you are out of the trade, with no open positions. base asset For instance, let’s assume you see the outcome of your trading as your retirement bonus. You are also a crypto-believer and are long-term bullish on bitcoin. Chances are you may want to accumulate bitcoin. That is, your is bitcoin. base asset Needless to say, you may have a valid argument for picking any other or any number of . base assets Your Investment Plan As you may have noticed, these three elements — , and — are an integral part of your investment plan. capital market base asset The plan is yours because it needs to respond to your needs. That is the main reason why simply copying ideas or attempting to follow the trading of random people wouldn’t necessarily work for you — no matter what mega-following your trading hero may have on Twitter. Your plan needs to serve your purpose and only you know what your purpose is. Your plan may have any number of goals (e.g. accumulating bitcoin, diversifying on a basket of coins, annual profit targets, etc.), and you may need to develop individual plans to achieve each of those goals. This leads us to the concept of strategies. Strategies A methodical framework would define a as . strategy a set of actions occurring in stages, designed to achieve a specific goal within a broader plan, via executing trades Let’s start by dissecting this definition… A "set of actions occurring in stages" refers to the structure of a . The actions occur in stages because certain actions may be grouped, and each group of actions may be played in a specific sequence. strategy This concept is fundamental to the methodical aspect of the system, as it provides a framework to run every with the same logic, which certainly contributes to developing a scalable system that may grow to any number of strategies. strategy The second important bit in the definition of a is “designed to achieve a specific goal within a broader plan”. strategy One specific goal. If you attempt to achieve two different goals with a single , you may run into problems. What if the two goals were antagonistic? You could argue solutions may still be found, but the would certainly be more complex. strategy strategy In any case, the logical thing to do is to analyze each goal separately so that you can design at least one clear, straightforward for each goal. strategy Now, can you have more than one to achieve a single goal? strategy Certainly! There are many roads to Rome! In fact, the norm is to work with several strategies at the same time, as this usually leads to identifying more trading opportunities. The set of rules and formulas comprising the can be anything. They may be based on Technical Analysis, incorporate fundamentals or sentiment data or anything else you may think of. strategy Again, I’m not going to discuss any particular indicator or in this piece but will instead focus on the framework, that is, the generalization of the trading process. strategy Suffice to say that your strategies will be somehow related to the that you chose to trade in and that they will have several characteristics which I will discuss as I move on with this analysis. market Finally, I will refer to the third section of the definition of “via executing trades”, which leads us to the concept of "a trade". strategy A trade is a process that exchanges the base asset for a second asset and that — after some time — exchanges back the second asset for the base asset . The first and foremost rule of a trade is to preserve capital and its main goal is to increase it. This means you will have rules that indicate when to sell your and when to buy your back. base asset base asset Preserving is one of the key rules of becoming a successful trader, as you will probably have as many good trades as bad ones. The trick is that your good trades should end up accumulating more profits than the losses you accumulate with your bad trades. capital In terms of its goal, a trade is engaged for the prospect of increasing the quantity of a given . base asset In other words, you trade in the hope that — during the trade — the second asset will revalue against the so that by the time the second asset is exchanged back for the , the resulting quantity of is bigger than the original. base asset base asset base asset For instance, let’s suppose your is bitcoin and you are trading on the BTC-USD : you may want to sell bitcoin when bitcoin price is falling to buy back a larger quantity of bitcoin for the same dollars, as you will be buying at a lower price. base asset market With all that in mind, let’s assume you have a few strategies ready. When do you start trading? How do you know which to use? strategy Stage 1: Trigger Those two questions lead you straight into Stage 1 of your and point to the first characteristic that needs to be present in it: the rules or to the . strategy conditions trigger on strategy Triggering Strategies I call this particular set of rules a , in the sense that you are trying to determine what is going on with the and if the is right to use a certain . situation market situation strategy Put in other words, you define in which you wish to use a certain and each is described as a set of that need to be met for you to consider starting to use the said . situations strategy situation conditions strategy When the for any of the that would a are met, I call this a event, meaning the event activates the . conditions situations trigger strategy trigger on strategy Now, what does that mean? I’m not yet discussing taking positions, so it doesn’t mean that you should buy or sell something. A event signals an ideal time to activate the and look for the opportunity of taking a position. trigger on strategy Now let’s assume it is the ideal time to your , how do you next decide when to take a position or not? trigger strategy To take a position, you will too define . situations In this case, when the that define a are met, this marks the event, that is, the moment to enter the trade. conditions situation take position Are you starting to see the pattern? Your strategy is guided by predefined conditions that — when met — define situations that determine that a certain event will take place. Now, what happens if the are not met? take position conditions This leads us to understand that, just like you had a set of rules to determine when a seems appropriate, thus a specific , you should also be able to analyze when the has shifted out of those — therefore cancelling the potential for taking a position — so that the strategy can eventually be . situation triggering on strategy market conditions triggered off Why is it important to a ? trigger off strategy It was established that while a is on, you need to pay close attention to it and constantly evaluate the for entering a trade. the allows freeing up those resources (your attention) and going back to doing something else. strategy conditions Triggering off strategy Size Definition, Capital Request & Allocation Before taking a position, it will be necessary to define the amount of that you are going to risk in the trade — what I call the size of the position — which points back to one important concept I touched on before: . base asset capital It was established that — overall — you have a certain amount of to trade with and that you will need to manage. It was also established that you are most likely going to work with several strategies. capital Do you see where I’m going with this? This is when you start managing your . capital Because you are working with several strategies, you need to decide how to allocate portions of that to each . And — again — this is an integral part of the investment planning decisions that you will need to make and that are out of the scope of this article. capital strategy Suffice to say that , and a subject worthy of its a full level in the framework which may be covered in a follow-up piece later on. capital allocation is part of your overall capital management and diversification plan Notice how the Stage 1 diagram above makes a clear differentiation between Size Definition and Capital Request & Allocation. This is because each of those concepts is completely independent of each other at a conceptual level, and because in larger organizations, different people may take responsibility for each of them or co-participate in the process. Take Position I explained with their set of when discussing and events that activate and deactivate strategies. situations conditions trigger on trigger off The same concept of with apply when you are looking to take a position. situations conditions When setting up your , you will describe , each defined by a set of rules or that — when met — indicate that the moment is ripe for taking a position. I call this the event. strategy situations conditions take position Taking a position refers to the act of entering a trade, that is, placing the orders at the exchange. These actions are taken in the next stage, during execution. Quick Recap Stage 1 is about monitoring the and identifying when the that define certain are met, one of your strategies. market conditions situations triggering on You may see this as an early signal that tells you an opportunity may emerge soon. The that define the for actually taking a position may be seen as the final confirmation: the signal that determines that the time for entering a trade is as good as it gets. conditions situation I will give you a quick example… Let’s say you are trading the BTC-USD during the long crypto-winter. Your is BTC, thus, you come up with a trend-following based on the Bollinger bands indicator. market base asset strategy Your goal is to accumulate bitcoin selling BTC as the price starts dropping and re-buying BTC at a lower price when the price stabilizes. One of the you wish to identify to the is, for instance, when you detect what you may call an Incipient down-trend (or to be clear, a where a down-trend is developing). situations trigger on strategy situation How would you describe the Incipient down-trend with a specific set of ? situation conditions Well… you may come up with something like this: : The percentage bandwidth moving average of the Bollinger bands is going down… Condition 1 : The percentage bandwidth is smaller than the previous for two consecutive periods (2 candles)… Condition 2 : The minimum candle value is less than the previous minimum for two consecutive periods… Condition 3 The framework dictates that when those three are met at any moment in time, the is . conditions strategy triggered on So you keep looking and waiting for the final confirmation to take a position that is also defined by a embodied by its own set of . You will probably want to give the a significant name, such as Down-trend entry signal. situation conditions situation The new set of may look like the following: conditions : The percentage bandwidth is smaller than the previous for the third consecutive period (3 candles)… Condition 1 : The minimum candle value is less than the lower Bollinger band for the last two periods (2 candles)… Condition 2 That’s it! The are met and you are finally ready to take the position. conditions So, what’s next? Stage 2: Open You have decided when is a good time to take a position. Good. However, to complete the trade — that is, to buy back the — you also need to define the rules to exit the position, or what I call the and . base asset take profit stop formulas Initial Take Profit & Stop As per the definition of a trade, the main rule is minimizing the amount of the potential loss and — if possible — the goal is completing the trade at a profit, that is, ending up with a higher amount of your . base asset In that sense, the next step is defining two separate rule-sets for exiting the position: and . These formulas will allow us to do just that: take the profit when the trade hits a target or and exit the position in case things are not going as expected. take profit stop stop These rule-sets are most likely expressed as mathematical formulas. The simplest approach is fixing a constant value as a percentage of the price at the time of the event. take position For instance, let’s say you bought for 10 expecting the price to go up, and your profit target for the trade is a 20% win. Then your would be at 10 + 20% = 12. take profit That would be a constant value for your . take profit Then, let’s say you are willing to lose up to 2% of the in the trade if the moves in the wrong direction; then your would be fixed at 10–2% = 9.8. capital market stop There certainly are many considerations as of how to set these two formulas, and several variables like volatility, your risk profile, quality of the signal, long-term targets and so on will be part of the criterion you will want to consider. However, such considerations are beyond the scope of this article. market That said, it is important to note that setting constant values for and is certainly a simplistic approach and that a lot more efficiency can be obtained with more dynamic formulas. take profit stop Such formulas may take into consideration the actual price movement, momentum, and as many indicators as you may wish to factor in the analysis. Execution If Stage 1 was mostly about monitoring the , Stage 2 is about execution: you have identified that the moment is right to take a position, now it’s time to go and do it. market Why would you want to think of this as a two-stage process? Isn’t placing an order at the exchange a pretty straightforward operation anyway? Well… it may or may not be. For starters, there are further decisions to be made: are you placing a market order or a limit order? Moreover, the complexity of the execution depends on several factors, the most relevant being the size of the trade and the liquidity of the . market Imagine placing a limit order to buy 1,000 BTC in a second-tier exchange… The order would probably take some time to fill, get partially filled or not get filled at all, right? Also, placing such a big order in the book may affect the and substantially affect the price, which is undesirable. market Large orders need to be fragmented, sometimes even across different exchanges. Also, the position may be taken at different prices, or along a certain period. However, because I’m introducing you to the Level One of the framework, for the time being, I will assume your orders will be rather small, in the order of magnitude that your exchange of choice can handle fine in a single order. The aforementioned tactics are the subject of a higher level of the framework which I may cover in future articles. As you may now see, there are considerations to be made at the time of execution, and the task itself is quite different from monitoring the , hence the view of the two as belonging to separate stages. market Stage 3: Manage As hinted earlier, what you have read so far is the basis of the framework to develop your trading system. As you may have noticed, a trading system corresponds to a lower level logic concerning the strategic aspects of trading. The system serves to structure the processes and methods that you will use to implement your trading strategies. What follows are considerations that aim to increase the efficiency of your system. In Stages 1 and 2, I described the fundamental components of the , and events of a trade. What I haven’t covered so far are the underlying opportunities to manage the trade while you have an open position. take position take profit stop The term trade management implies that the rules set forth for the and don’t need to be static. take profit stop I already discussed how setting the and with dynamic formulas that take into consideration several relevant parameters such as current price or other indicators is preferred over the simplistic approach of setting a constant value considering the price at the event only. take profit stop take position The concept of managing a trade goes even further. It means that the formulas to determine the and may change as the trade develops. take profit stop The key point to take home is that . A trade is not an instantaneous event. It matures over time. there is a development or evolution attached to a trade Then, how do you manage the trade? What could happen that would make you want to change your and formulas? take profit stop How do you determine when to change them? Well… let’s start with stating the obvious: the development of the trade is analyzed through the same lens you have been using throughout the previous steps, meaning that you keep looking at the state of the in relation to any number of indicators you wish to analyze, in an attempt to predict what may happen next. market But, most importantly, you analyze the with a focus in your current targets, embodied by the originally defined and . market take profit stop To make this clearer, let’s remember the main reason why you want to manage the trade: to optimize the outcome. Therefore, . That is, the is moving in the expected direction and you seem to be making a profit. the typical situation in which you may want to change your original take profit and stop formulas is when the trade seems to be going well in your favor market Does this sound counter-intuitive? Why would you want to change anything at all if things are going according to your expectations? First of all, as long as the position is open, you haven’t accrued the profits! Even if you seem to be winning, the may reverse before hitting the and may go all the way back to your . market take profit stop In such case, if you were playing by the book of Stage 2 (with initial and ), you would end up with a loss even though you were temporarily winning at some point. take profit stop Under the Stage 3 paradigm, you would be interested in moving your as the price moves in the expected direction in such a way that even if the reverses before hitting the , you would end up with a smaller loss, with zero loss or even with a profit, depending on how much you manage to move the . stop market take profit stop A second potential scenario is that the moves in the desired direction and does not reverse. market In such a case, if you did nothing to manage the trade, you would hit the original . take profit Good, right? Now, what if the keeps going way beyond the initial ? market take profit Indeed, you would have missed a good opportunity to surf a big move and make a much larger profit than originally expected. market The conclusion is that it may be in your best interest to manage both and , moving them in the direction of the trade as the moves, allowing some leeway for a larger profit than expected and at the same time cutting the potential for a loss. stops take profit market Remember, greed is not the point of managing the trade; the point is optimization. You need to be careful not to increase the risk as you move the , and make sure you are always tightening your at the same time too. In fact, the best practice is to move only part of your , but again, the specifics of the tactics are beyond the scope of this article. take profit stop take profit How does all this management translate in the framework? The management of the trade is handled in phases. Actually, the management of and — while correlated — is done independently of each other, therefore, each concept has its own set of phases. take profit stop Changes to and formulas respond to the same kind of logic you used to set the original values. When a defined by a set of is met, the event indicates that or formulas shall be changed. At the moment those predefined are met, you enter the next phase. Keep in mind that the trade is in constant development, so there may be as many phases as you deem appropriate for your particular . take profit stop situation conditions take profit stop conditions strategy In the animated image above, you may see chart notations indicating changes of phases on (green) and (red). Horizontal red lines represent a dynamic at each candle interval while horizontal green lines represent a dynamic . take profit stop stop take profit The idea of having different phases comes from the notion that big moves tend to provide clues as of what may come up next. market For instance, rallies may accelerate as more traders join the move. Recognizable patterns may emerge. Signs of exhaustion may be identified. All of these considerations should feed the dynamic analysis performed as the trade develops, and may be contrasted with the predefined that may push or further, entering one phase after the next. conditions take profit stop Stage 4: Close Closing Execution The Closing Stage has very similar implications to what I explained in the Open Stage in regards to execution. While it is true that the trade management process takes care of making the decisions as of when to close the position by managing the and , the actual execution of the exit may require further considerations when dealing with substantial amounts of . take profit stop capital It is for that reason that I propose to understand execution as a separate stage, while it may not be required in practical terms if you are trading a small . If that is the case, then your trade management includes the actual execution and you don’t need to consider any other variables. capital As hinted earlier, I may review more complex execution tactics in a separate article later on. Record Keeping While it is sometimes disregarded as a boring task, record keeping is a fundamental part of the process and should be implemented in your trading system. It doesn’t require much analysis to conclude that being able to track the results of each of your trades will become a fundamental piece of information that should help you fine-tune your strategies in the future. Remember that evolve and strategies perform well for limited periods. Therefore, you should implement a procedure that will evaluate the efficiency of your strategies over time. markets Such procedures are out of the scope of this piece and I may cover them in a future article. For the time being, just make sure you take note of each of your trades, with at least the basic information, such as date of opening, reasons for entering the trade ( met to take the position), price, initial and last and , return on the trade (%), profit & loss (expressed in your base currency) and duration of the trade. conditions take position take profit stop Further Levels So far, I covered the basic framework — what I call Level One — analyzing the four stages of a trading . strategy Needless to say, there is a lot more depth on the subject of trading systems. I would argue that if you manage to implement the framework up to this Level One, you will have built a solid base for becoming a successful trader. That said, it is what comes after Level One what will put you higher in the food chain. For instance, two of the most relevant subjects left out of the scope of this piece are allocation and risk management. capital I might get on to that later on with a follow-up piece, so stay tuned! In the meantime, it’s up to you to get up to speed with a solid foundation for your trading system… My Implementation I'm a co-founder of the , an open-source project developing and freely distributing trading tools, and building a Collective Trading Intelligence. Superalgos Project The framework proposed in this article has been implemented as the Superalgos Protocol, a trading protocol that enables the standardization of the description of trading strategies. Standardizing how trading strategies are defined enabled the development of , a piece of open-source software that helps traders fully automate their work. Superalgos The Superalgos Platform is a client app running on user's machines, removing all trust requirements (no need to trust a third party with funds, API Keys or strategies). Traders may build strategies in a visual setting (no coding required) and test their performance in real-time through a simulation engine with historical (backtesting) and up-to-date (paper-trading) market data. Once happy with the simulation output, traders may deploy their strategies as fully automated trading bots, and trade live. to engage with other users and the developers behind the project. Join our Telegram Acknowledgment: Thanks to Andreja Cobeljic for his technical review/editing. Disclaimer : I am not a financial advisor and this is not financial advice. I share strategies and my own trading experiences as a means to disseminate knowledge. You are responsible for whatever you choose to do with the information I share. Disclosure : The author is a core team member of the Superalgos Project . Featured Image Credit : © WHYFRAME, shutterstock.com