Testing a Trading Idea Tutorial

This commit is contained in:
Luis Fernando Molina committed 2021-01-09 09:58:36 +01:00
1 parent f220e9404d
commit 8afcb88a26
82 files changed
+2079

No files matched your search

@@ -0,0 +1,26 @@
{
"tutorial": "3. Testing a Trading Idea - The Trigger Stage",
"pageNumber": 1,
"type": "Tutorial - Testing a Trading Idea",
"definition": {
"icon": {
"project": "Superalgos",
"name": "trading-strategy"
},
"text": "We got to the point where we can finally put the theory in practice, so let's get on with it!"
},
"paragraphs": [
{
"style": "Text",
"text": "In the second tutorial in the series we covered how to properly define a trading idea so that it is testable. We also went on a field trip and came back with a proper formalized hypothesis to test."
},
{
"style": "Callout",
"text": "In this tutorial, we will test the hypothesis!"
},
{
"style": "Note",
"text": "I highly recommend you do the first and second tutorials in the series before doing this one! The story is carried from one to the next!"
}
]
}
@@ -0,0 +1,38 @@
{
"tutorial": "3. Testing a Trading Idea - The Trigger Stage",
"pageNumber": 2,
"type": "Tutorial Step - The Pipeline",
"definition": {
"icon": {
"project": "Superalgos",
"name": "dataset-definition"
},
"text": "We will cover several topics! Let's make a quick list to use as a guide along the way!"
},
"paragraphs": [
{
"style": "List",
"text": "The Trigger Stage with it's three events: Trigger On Event, Trigger Off Event, and Take Position Event."
},
{
"style": "List",
"text": "Basic definitions including what is a Situation, a Condition, and a Formula."
},
{
"style": "List",
"text": "Syntax, or how to write conditions and formulas."
},
{
"style": "List",
"text": "Indicator properties and how to use them."
},
{
"style": "List",
"text": "Open, Manage, and Close Stages basics."
},
{
"style": "Success",
"text": "Have you read about these topics? No worries... you will!"
}
]
}
@@ -0,0 +1,26 @@
{
"tutorial": "3. Testing a Trading Idea - The Trigger Stage",
"pageNumber": 3,
"type": "Tutorial Step - Do You Have The Data?",
"definition": {
"icon": {
"project": "Superalgos",
"name": "data-tasks"
},
"text": "If you didn't do the second tutorial in the series, chances are you are missing the data you need to do this one!"
},
"paragraphs": [
{
"style": "Callout",
"text": "If you did the second tutorial, you can skip the data mining! If you didn't, then proceed!"
},
{
"style": "Note",
"text": "The sensor bot will run on the BTC/USDT market (Binance) from January 1st, 2020."
},
{
"style": "Warning",
"text": "If you have data on this market but on a different time range, this may affect your data! Read the sensor bot documentation to learn how!"
}
]
}
@@ -0,0 +1,22 @@
{
"tutorial": "3. Testing a Trading Idea - The Trigger Stage",
"pageNumber": 4,
"type": "Tutorial Step - Let's Mine Some Data!",
"definition": {
"icon": {
"project": "Superalgos",
"name": "run"
},
"text": "Now that you understand the implications of running this data mining operation, let's get on with it!"
},
"paragraphs": [
{
"style": "Callout",
"text": "If you didn't do the second tutorial in the series, select Run All Project Data Tasks on the Data Tasks node menu!"
},
{
"style": "Note",
"text": "If you are doing this tutorial after doing other tutorials, chances are you may already have part of the data required, which may make things faster! Either way, no need to wait for the data mining to get to the present time... you may keep going with the tutorial!"
}
]
}
@@ -0,0 +1,22 @@
{
"tutorial": "3. Testing a Trading Idea - The Trigger Stage",
"pageNumber": 5,
"type": "Tutorial Step - Let's Start With the Basics!",
"definition": {
"icon": {
"project": "Superalgos",
"name": "trading-strategy"
},
"text": "You define trading strategies following the Superalgos Protocol!"
},
"paragraphs": [
{
"style": "Callout",
"text": "Please, read this page about trading strategies. It is the base of everything we will be discussing!"
},
{
"style": "Note",
"text": "The last paragraph in the page states that the framework is flexible enough to accept definitions that bend the rigid interpretation of what a position is. In this tutorial, we will focus on a typical by-the-book definition of a strategy, that is, the case for which the framework is optimized. We will cover other cases in other tutorials!"
}
]
}
@@ -0,0 +1,26 @@
{
"tutorial": "3. Testing a Trading Idea - The Trigger Stage",
"pageNumber": 6,
"type": "Tutorial Step - Trading Systems",
"definition": {
"icon": {
"project": "Superalgos",
"name": "trading-system"
},
"text": "New trading systems are created from the Superalgos Project hierarchy, in particular, from the Other Hierarchies node."
},
"paragraphs": [
{
"style": "Text",
"text": "But... you know what? We'll use one I created already!"
},
{
"style": "Callout",
"text": "Feel free to add a trading system if you wish, but delete it afterwards, as we are not going to use it!"
},
{
"style": "Note",
"text": "I set up a trading system while you weren't watching so that I can reference existing nodes and take you to specific places while we move along this tutorial! Merely for technical reasons, if you must know!"
}
]
}
@@ -0,0 +1,26 @@
{
"tutorial": "3. Testing a Trading Idea - The Trigger Stage",
"pageNumber": 7,
"type": "Tutorial Step - Right Out of the Box!",
"definition": {
"icon": {
"project": "Superalgos",
"name": "trading-system"
},
"text": "This is the trading system we will use, virtually as it comes right out of the box!"
},
"paragraphs": [
{
"style": "Text",
"text": "All I've done with it is organize the hierarchy the way I like it, and give it a name: BB Breakdown."
},
{
"style": "Callout",
"text": "Expand the hierarchy and look around! Notice the Downtrends strategy... Expand each of the nodes corresponding to the four stages, one by one, and take a good look inside!"
},
{
"style": "Note",
"text": "The nodes you see within each of these stages make up the definitions of a strategy..."
}
]
}
@@ -0,0 +1,26 @@
{
"tutorial": "3. Testing a Trading Idea - The Trigger Stage",
"pageNumber": 8,
"type": "Tutorial Step - Why Downtrends?",
"definition": {
"icon": {
"project": "Superalgos",
"name": "help"
},
"text": "If you paid attention to the first tutorial in the series on trading systems, you must know the answer to the above question!"
},
"paragraphs": [
{
"style": "Text",
"text": "In the second tutorial in the series, we came up with two similar hypotheses: one involves trading during uptrends and the second, in downtrends."
},
{
"style": "Callout",
"text": "Those are two distinct ideas and should be treated as different strategies because they will handle similar logic, but not the same!"
},
{
"style": "Note",
"text": "We'll focus in the Downtrend strategy first, because I feel it's the most promising one!"
}
]
}
@@ -0,0 +1,34 @@
{
"tutorial": "3. Testing a Trading Idea - The Trigger Stage",
"pageNumber": 9,
"type": "Tutorial Step - Trigger Stage Events",
"definition": {
"icon": {
"project": "Superalgos",
"name": "trigger-stage"
},
"text": "In a way, strategies are defined as a collection of events. The events that trigger a Trading Strategy are the first to consider!"
},
"paragraphs": [
{
"style": "Text",
"text": "In the next few steps, we will define the..."
},
{
"style": "List",
"text": "Trigger On Event "
},
{
"style": "List",
"text": "Trigger Off Event "
},
{
"style": "List",
"text": "Take Position Event "
},
{
"style": "Callout",
"text": "If you haven't yet, please read this page to get up to speed with these concepts!"
}
]
}
@@ -0,0 +1,26 @@
{
"tutorial": "3. Testing a Trading Idea - The Trigger Stage",
"pageNumber": 10,
"type": "Tutorial Step - Trigger On Event",
"definition": {
"icon": {
"project": "Superalgos",
"name": "trigger-on-event"
},
"text": "The Trigger On Event defines the market Situation in which the strategy shall be triggered."
},
"paragraphs": [
{
"style": "Text",
"text": "Let's refresh the basic concepts! The triggering of a strategy has two main implications:"
},
{
"style": "List",
"text": "The strategy is selected among other strategies in the trading system and is assigned the capital available for the trading session. This is important because we'll eventually have two strategies in the trading system!"
},
{
"style": "List",
"text": "Once a strategy is triggered, the trading bot starts evaluating the Take Position Event and the Trigger Off Event. When any of those two validate true, the strategy exits the Trigger Stage!"
}
]
}
@@ -0,0 +1,22 @@
{
"tutorial": "3. Testing a Trading Idea - The Trigger Stage",
"pageNumber": 11,
"type": "Tutorial Step - Situations, Conditions, and Formulas in Superalgos",
"definition": {
"icon": {
"project": "Superalgos",
"name": "situation"
},
"text": "Before we get to write definitions for the trigger on event, you need to get the basic education on these fundamental topics!"
},
"paragraphs": [
{
"style": "Callout",
"text": "If you haven't yet, please read this page outlining the concepts of situations, conditions, and formulas. These are the key concepts that make up most definitions in a strategy!"
},
{
"style": "Note",
"text": "Don't worry about the syntax in the examples. We will get to that soon! If you are not a developer, focus on the simple examples."
}
]
}
@@ -0,0 +1,26 @@
{
"tutorial": "3. Testing a Trading Idea - The Trigger Stage",
"pageNumber": 12,
"type": "Tutorial Step - Remember the Context?",
"definition": {
"icon": {
"project": "Superalgos",
"name": "layer-trends"
},
"text": "Now that you understand what conditions and situations are, let's pose a question: how do we define the Trigger On Event?"
},
"paragraphs": [
{
"style": "Text",
"text": "Because the trigger on event determines which strategy is selected to trade, the definition of the context of our hypothesis should be the main thing to consider!"
},
{
"style": "Callout",
"text": "The strategy should trade when there is a downtrend in the 24H time frame."
},
{
"style": "Success",
"text": "Our job is to write a set of conditions that mathematically describe the market situation of a downtrend in the 24H chart!"
}
]
}
@@ -0,0 +1,26 @@
{
"tutorial": "3. Testing a Trading Idea - The Trigger Stage",
"pageNumber": 13,
"type": "Tutorial Step - Let's Study the Syntax!",
"definition": {
"icon": {
"project": "Superalgos",
"name": "text"
},
"text": "The syntax to write conditions and formulas follows a few basic rules that will soon seem obvious!"
},
"paragraphs": [
{
"style": "Text",
"text": "It may take some time to master the syntax, particularly if you are not a technical person, but experience shows that Superalgos users get used to it while building their first strategy!"
},
{
"style": "Callout",
"text": "Please, read this page carefully!"
},
{
"style": "Success",
"text": "Don't worry if it seems hard to grasp... We'll practice a lot along with this tutorial series!"
}
]
}
@@ -0,0 +1,30 @@
{
"tutorial": "3. Testing a Trading Idea - The Trigger Stage",
"pageNumber": 14,
"type": "Tutorial Step - Reinforce The Learning!",
"definition": {
"icon": {
"project": "Superalgos",
"name": "learning-bot"
},
"text": "Let's do a quick recap on the matter of the syntax! I'll push this until you learn it!"
},
"paragraphs": [
{
"style": "List",
"text": "FIRST: The time frame! (i.e.: chart.at24hs)"
},
{
"style": "List",
"text": "SECOND: Each segment of the instruction is separated by dots! (i.e.: like.this)"
},
{
"style": "List",
"text": "THIRD: Product name and property name are determined by the indicator you are using. No need to memorize them, as you may copy and paste them from the docs when you need them!"
},
{
"style": "List",
"text": "FOURTH: Compound words in the product and property name are written altogether, with the first word in lowercase and the rest of the words capitalized! (i.e.: forExampleLikeThis)"
}
]
}
@@ -0,0 +1,26 @@
{
"tutorial": "3. Testing a Trading Idea - The Trigger Stage",
"pageNumber": 15,
"type": "Tutorial Step - Are We Up to Date?",
"definition": {
"icon": {
"project": "Superalgos",
"name": "indicator-process-instance"
},
"text": "By now, all processes should be at 100%. We need the data to be ready so that we can go and do some work on the charts!"
},
"paragraphs": [
{
"style": "Callout",
"text": "If you are mining data because you didn't do it in the previous tutorial, look around and see if all processes are at 100%. If all of them are, then stop the data mining!"
},
{
"style": "Note",
"text": "Wait until all processes reach the 100% mark before continuing!"
},
{
"style": "Success",
"text": "Let's go to the charts!"
}
]
}
@@ -0,0 +1,26 @@
{
"tutorial": "3. Testing a Trading Idea - The Trigger Stage",
"pageNumber": 16,
"type": "Tutorial Step - Time to Work the Charts!",
"definition": {
"icon": {
"project": "Superalgos",
"name": "trigger-on-event"
},
"text": "We are going to do some work on the charts, placing the focus on the Trigger On Event!"
},
"paragraphs": [
{
"style": "Text",
"text": "Bear in mind that the trigger on event on each strategy within a trading system is what determines which of the strategies is going to trade in the current context. In our case, we'll eventually have at least two strategies, and we want each of them to specialize on different trends."
},
{
"style": "Callout",
"text": "The first concern is with determining the trend! How to we go about this?"
},
{
"style": "Text",
"text": "We'll work on something around the Bollinger Bands, as you may imagine!"
}
]
}
@@ -0,0 +1,26 @@
{
"tutorial": "3. Testing a Trading Idea - The Trigger Stage",
"pageNumber": 17,
"type": "Tutorial Step - Determining the Trend",
"definition": {
"icon": {
"project": "Superalgos",
"name": "layer-trends"
},
"text": "There are probably as many ways to determine a trend as traders inhabit planet Earth! It's a matter of style and mostly subjective!"
},
"paragraphs": [
{
"style": "Text",
"text": "We'll take an arbitrary and rather simple approach based on the 20-periods moving average (MA) built in the Bollinger Bands."
},
{
"style": "Callout",
"text": "Go to the Masters Layer Manager and turn on the Bollinger Channels Objects Layer!"
},
{
"style": "Note",
"text": "This indicator derives the direction of the MA and draws a green channel when the MA is going Up and a red channel when it's going Down."
}
]
}
@@ -0,0 +1,26 @@
{
"tutorial": "3. Testing a Trading Idea - The Trigger Stage",
"pageNumber": 18,
"type": "Tutorial Step - Is That Good Enough?",
"definition": {
"icon": {
"project": "Superalgos",
"name": "help"
},
"text": "This seems to work well for the reversals of February 25th and April 1st, right?"
},
"paragraphs": [
{
"style": "Callout",
"text": "Pan the chart to the right and check the period between May 24th and July 16th!"
},
{
"style": "Text",
"text": "The market is clearly moving sideways in a narrowing range, and the indicator switches back and forth between Up and Down directions erratically."
},
{
"style": "Success",
"text": "This is not the ultimate solution to determine the trend!"
}
]
}
@@ -0,0 +1,26 @@
{
"tutorial": "3. Testing a Trading Idea - The Trigger Stage",
"pageNumber": 19,
"type": "Tutorial Step - An Extra Dimension!",
"definition": {
"icon": {
"project": "Superalgos",
"name": "layer-trends"
},
"text": "Let's try an indicator that brings an additional dimension to the information we are getting from this one!"
},
"paragraphs": [
{
"style": "Callout",
"text": "Turn off the Bollinger Channels Objects layer! Now turn on the Bollinger SubChannels Objects layer!"
},
{
"style": "Text",
"text": "There's still a lot of back and forth with the Up and Down directions... but!"
},
{
"style": "Success",
"text": "Slide the mouse pointer over the chart and look at the Slope property in the plotter panel of the indicator! Switch it on in case it's off!"
}
]
}
@@ -0,0 +1,22 @@
{
"tutorial": "3. Testing a Trading Idea - The Trigger Stage",
"pageNumber": 20,
"type": "Tutorial Step - Bollinger Subchannels",
"definition": {
"icon": {
"project": "Superalgos",
"name": "layer-trends"
},
"text": "The slope provides an indication of how steep the MA curve is... that is, how pronounced is the decline or ascent of the MA!"
},
"paragraphs": [
{
"style": "Callout",
"text": "Read the description of the indicator in the documentation. Then scroll down and get to the Bollinger SubChannels Products & Properties section."
},
{
"style": "Success",
"text": "The kind of information you find on this page is available for every indicator shipping with the system."
}
]
}
@@ -0,0 +1,34 @@
{
"tutorial": "3. Testing a Trading Idea - The Trigger Stage",
"pageNumber": 21,
"type": "Tutorial Step - Products & Properties",
"definition": {
"icon": {
"project": "Superalgos",
"name": "record-property"
},
"text": "This section of the documentation of each indicator features the information you need to use the indicator in conditions and formulas!"
},
"paragraphs": [
{
"style": "Text",
"text": "The bollingerSubChannel product features three different properties:"
},
{
"style": "List",
"text": "direction: Up, Down"
},
{
"style": "List",
"text": "period: 1 to n."
},
{
"style": "List",
"text": "slope: Side, Gentle, Medium, Steep, Extreme."
},
{
"style": "Callout",
"text": "Read this section carefully so that we can go back to the charts and decide how we are going to use the slope property!"
}
]
}
@@ -0,0 +1,22 @@
{
"tutorial": "3. Testing a Trading Idea - The Trigger Stage",
"pageNumber": 22,
"type": "Tutorial Step - Let's Check Those Slopes",
"definition": {
"icon": {
"project": "Superalgos",
"name": "layer-trends"
},
"text": "We will use the slope property of the Bollinger Subchannels indicator to confirm that a trend is a trend!"
},
"paragraphs": [
{
"style": "Callout",
"text": "Slide the pointer of the mouse over different subchannels and notice their reported slope in the plotter panel."
},
{
"style": "Text",
"text": "Notice that when the market is trending, the subchannel slope is almost never Side. And that's to be expected, as the Side slope represents the shallower slope possible in the MA. On the other hand, the periods on which the market is ranging, although the direction may go back and forth between Up and Down, the slope is mostly Side."
}
]
}
@@ -0,0 +1,22 @@
{
"tutorial": "3. Testing a Trading Idea - The Trigger Stage",
"pageNumber": 23,
"type": "Tutorial Step - We Have Our Conditions!",
"definition": {
"icon": {
"project": "Superalgos",
"name": "condition"
},
"text": "It seems like we have finally come up with a way to define a downtrend... let's set it up as two conditions!"
},
"paragraphs": [
{
"style": "List",
"text": "Condition 1: The direction property of the bollingerSubChannel product is Down in the 24H chart. Put in proper syntax:<br/><br/>chart.at24hs.bollingerSubChannel.direction === 'Down'<br/><br/>"
},
{
"style": "List",
"text": "Condition 2: The slope property of the bollingerSubChannel product is <strong>not</strong> Side in the 24H chart. Put in proper syntax:<br/><br/>chart.at24hs.bollingerSubChannel.slope != 'Side'"
}
]
}
@@ -0,0 +1,22 @@
{
"tutorial": "3. Testing a Trading Idea - The Trigger Stage",
"pageNumber": 24,
"type": "Tutorial Step - Set Up the First Condition!",
"definition": {
"icon": {
"project": "Superalgos",
"name": "javascript-code"
},
"text": "I brought you to the definition of the Trigger On Event so that you may set up the first condition!"
},
"paragraphs": [
{
"style": "Callout",
"text": "Paste the condition on the Javascript Code node!"
},
{
"style": "Text",
"text": "Follow the structure of nodes under the Situation and get to the Javascript Code node under the Condition node. Click Edit on the menu, select and delete the placeholder text, and paste the below condition:<br/><br/>chart.at24hs.bollingerSubChannel.direction === 'Down'<br/><br/><strong>Label the condition node 24H Down to have a quick reference of what the condition is about.</strong>"
}
]
}
@@ -0,0 +1,26 @@
{
"tutorial": "3. Testing a Trading Idea - The Trigger Stage",
"pageNumber": 25,
"type": "Tutorial Step - Now the Second Condition!",
"definition": {
"icon": {
"project": "Superalgos",
"name": "javascript-code"
},
"text": "Select Add Condition on the situation's menu and paste the code in the Javascript Code node!"
},
"paragraphs": [
{
"style": "Text",
"text": "chart.at24hs.bollingerSubChannel.slope != 'Side'"
},
{
"style": "Callout",
"text": "Label the condition node 24H Not Side and label the situation as Downtrend to keep things tidy!"
},
{
"style": "Note",
"text": "We could have chosen to write the two conditions in one by using the && operator. After all, we want the Trigger On Event to validate true when both conditions are true, right? I'll tell you why that is not a good idea in the next step!"
}
]
}
@@ -0,0 +1,30 @@
{
"tutorial": "3. Testing a Trading Idea - The Trigger Stage",
"pageNumber": 26,
"type": "Tutorial Step - Never Forget Granularity!",
"definition": {
"icon": {
"project": "Superalgos",
"name": "situation"
},
"text": "Superalgos strives to keep things simple, and so should you, as it is the best way to handle mounting complexity!"
},
"paragraphs": [
{
"style": "Text",
"text": "Conditions should be as granular as possible because:"
},
{
"style": "List",
"text": "It makes it easier to debug the syntax: when you pile up logic in a single condition, it's hard to find bugs you may have introduced."
},
{
"style": "List",
"text": "It makes it easier to debug the strategy: if you keep logic segregated in different conditions, you will then be able to see precisely what part of the logic validates true or false."
},
{
"style": "List",
"text": "It makes the strategy easier to maintain and upgrade: granular conditions make everything easier to undertand and follow."
}
]
}
@@ -0,0 +1,30 @@
{
"tutorial": "3. Testing a Trading Idea - The Trigger Stage",
"pageNumber": 27,
"type": "Tutorial Step - Trigger Off Event",
"definition": {
"icon": {
"project": "Superalgos",
"name": "trigger-off-event"
},
"text": "Now that we have defined when the strategy should be triggered on, let's consider when the idea should be invalidated."
},
"paragraphs": [
{
"style": "Text",
"text": "Well... this is a bit of a no-brainer right? We don't want to trade with this strategy when there is no downtrend. So, we'll reverse the logic of the trigger on event!"
},
{
"style": "List",
"text": "Condition 1: chart.at24hs.bollingerSubChannel.direction === 'Up'"
},
{
"style": "List",
"text": "Condition 2: chart.at24hs.bollingerSubChannel.slope === 'Side'"
},
{
"style": "Text",
"text": "We should trigger off the stategy when either of these conditions validate true. How?"
}
]
}
@@ -0,0 +1,26 @@
{
"tutorial": "3. Testing a Trading Idea - The Trigger Stage",
"pageNumber": 28,
"type": "Tutorial Step - The Workings of Situations",
"definition": {
"icon": {
"project": "Superalgos",
"name": "situation"
},
"text": "This is a key concept that you must understand so that you may organize logic in the proper manner!"
},
"paragraphs": [
{
"style": "List",
"text": "A situation validates true when all conditions within validate true. Think of this as if conditions within a situation were bound by the && (and) operator. If all of them are true at the same time, then the situation is true as well."
},
{
"style": "List",
"text": "An event validates true when either of the situations within validates true. It is as if situations within an event were bound by the || (or) operator! If any of the situations is true at a certain point in time, then the event is triggered!"
},
{
"style": "Text",
"text": "Can you figure out how to set up this definition?"
}
]
}
@@ -0,0 +1,26 @@
{
"tutorial": "3. Testing a Trading Idea - The Trigger Stage",
"pageNumber": 29,
"type": "Tutorial Step - Separate Situations!",
"definition": {
"icon": {
"project": "Superalgos",
"name": "situation"
},
"text": "Think of it in this way: we have identified two different market situations that would invalidate this idea!"
},
"paragraphs": [
{
"style": "Text",
"text": "We will set up each of the conditions in separate situations!"
},
{
"style": "Callout",
"text": "Set up the first condition in the existing situation, and the second condition in a new situation!"
},
{
"style": "Text",
"text": "<strong>Condition 1:</strong><br/>chart.at24hs.bollingerSubChannel.direction === 'Up'<br/><strong>Condition 2:</strong><br/>chart.at24hs.bollingerSubChannel.slope === 'Side'"
}
]
}
@@ -0,0 +1,26 @@
{
"tutorial": "3. Testing a Trading Idea - The Trigger Stage",
"pageNumber": 30,
"type": "Tutorial Step - Keep the Definitions Tidy!",
"definition": {
"icon": {
"project": "Superalgos",
"name": "situation-name"
},
"text": "Try to keep up with the good practice of giving relevant names or labels to the nodes holding definitions!"
},
"paragraphs": [
{
"style": "Text",
"text": "Consider that the strategy will grow in complexity as we advance! It's good to be able to identify conditions and situations without checking the code!"
},
{
"style": "Callout",
"text": "You'll also be able to identify which situation triggered the event directly from the charts!"
},
{
"style": "Note",
"text": "You may label the first situation and the first condition with the same name, 24H Up, and the second with the following: 24H Side."
}
]
}
@@ -0,0 +1,26 @@
{
"tutorial": "3. Testing a Trading Idea - The Trigger Stage",
"pageNumber": 31,
"type": "Tutorial Step - First Backtest!",
"definition": {
"icon": {
"project": "Superalgos",
"name": "backtesting-session"
},
"text": "Now that we have these basic definitions in place, we may do a first backtest."
},
"paragraphs": [
{
"style": "Text",
"text": "We are not ready to the test the idea as we've only defined the trigger on and trigger off events. We just want to make sure we got the definitions right."
},
{
"style": "Callout",
"text": "Although the strategy will eventually include logic relating to the 1H chart, the current definitions involve the 24H chart only."
},
{
"style": "Text",
"text": "We are going to run a backtesting session between January 1st and October 1st, 2020, on the 24H time frame. Take a look at the Time Range and Time Frame parameters and make sure they match the above!"
}
]
}
@@ -0,0 +1,18 @@
{
"tutorial": "3. Testing a Trading Idea - The Trigger Stage",
"pageNumber": 32,
"type": "Tutorial Step - A Bit About Backtesting!",
"definition": {
"icon": {
"project": "Superalgos",
"name": "backtesting-session"
},
"text": "Before we get to run this first backtest, I need to acknowledge something of great importance!"
},
"paragraphs": [
{
"style": "Text",
"text": "Backtesting is a science in and of itself! There are entire books written on backtesting alone. It is a deep and complex subject mainly because humans designing and testing strategies are prone to introducing biases that may lead to overfitting, that is, adjusting the rules of the trading system to fit the data set in the quest to get good backtesting results. Superalgos offers tools to flexibly handle the data set to avoid spoiling it, like the time range parameter that allows splitting the data set as required, or setting up and running multiple sessions in parallel. That said, we are not going to cover the topic in this tutorial! The current focus is on creating the definitions of a trading idea, not backtesting per se."
}
]
}
@@ -0,0 +1,26 @@
{
"tutorial": "3. Testing a Trading Idea - The Trigger Stage",
"pageNumber": 33,
"type": "Tutorial Step - Let's Do This!",
"definition": {
"icon": {
"project": "Superalgos",
"name": "task"
},
"text": "This is going to be quick as we are testing a few months on the 24H time frame."
},
"paragraphs": [
{
"style": "Text",
"text": "Remember that running a trading task is similar to running a data task. The difference is that after running the task you also need to run the trading session."
},
{
"style": "Callout",
"text": "Select Run on the Task menu and then select Run on the Backtesting Session menu."
},
{
"style": "Note",
"text": "When the progress notice of the Trading Process Instance get's to the 100% mark, stop the task and click Next."
}
]
}
@@ -0,0 +1,22 @@
{
"tutorial": "3. Testing a Trading Idea - The Trigger Stage",
"pageNumber": 34,
"type": "Tutorial Step - Let's See What We've Got!",
"definition": {
"icon": {
"project": "Superalgos",
"name": "trigger-stage"
},
"text": "We are going to go through the simulation and see if the definition we came up with has the expected results!"
},
"paragraphs": [
{
"style": "Callout",
"text": "Go to the Simulation Objects layer manager and turn on the Strategies and Trigger Stages layers."
},
{
"style": "Note",
"text": "Do you see the two instances of strategies triggered between February 26th and April 2nd? Now, pan the charts to the right... You should see another two triggered between September 3rd - 23rd! The following step features a video of what you should see on the screen, just to make sure we're on the same page!"
}
]
}
@@ -0,0 +1,17 @@
{
"tutorial": "3. Testing a Trading Idea - The Trigger Stage",
"pageNumber": 35,
"type": "Tutorial Step - Trading Systems Trigger Stage Test",
"definition": {
"icon": {
"project": "Superalgos"
},
"text": "This step will play a video in full screen mode."
},
"paragraphs": [
{
"style": "Gif",
"text": "GIFs/Superalgos/Tutorials/trading-systems-trigger-stage-test.gif"
}
]
}
@@ -0,0 +1,34 @@
{
"tutorial": "3. Testing a Trading Idea - The Trigger Stage",
"pageNumber": 36,
"type": "Tutorial Step - Can't See What's Expected?",
"definition": {
"icon": {
"project": "Superalgos",
"name": "bullet-error"
},
"text": "If you can't see what I showed in the video, chances are you skipped one or more of my previous instructions!"
},
"paragraphs": [
{
"style": "Text",
"text": "I will cover some troubleshooting tactics later on, but for the time being, the solution is to go back in the tutorial and make sure you did everything I told you to do!"
},
{
"style": "List",
"text": "Did you turn on the right layers? "
},
{
"style": "List",
"text": "Did you run the backtest? "
},
{
"style": "List",
"text": "Did you set up the definitions as instructed? "
},
{
"style": "Success",
"text": "Go backwards in the tutorial, step by step, and make sure you didn't skip any steps!"
}
]
}
@@ -0,0 +1,22 @@
{
"tutorial": "3. Testing a Trading Idea - The Trigger Stage",
"pageNumber": 37,
"type": "Tutorial Step - Visual Verification",
"definition": {
"icon": {
"project": "Superalgos",
"name": "bot-data-dependencies"
},
"text": "Let's do a quick visual check on the simulation to understand if the strategy was triggered on and off as expected!"
},
"paragraphs": [
{
"style": "Callout",
"text": "Make sure the Bollinger SubChannels Object layer is on along with the layer's panel!"
},
{
"style": "Text",
"text": "Place the mouse pointer on the Feb 25th candle. This is the first candle that closed with the MA going down. You can tell by the red color of the subchannel, and also looking at the direction property in the panel. However, the slope on this candle is Side, and that is the reason why the strategy wasn't triggered on the 25th. Remember, the conditions are that the direction should be Down and the slope should be different than Side."
}
]
}
@@ -0,0 +1,22 @@
{
"tutorial": "3. Testing a Trading Idea - The Trigger Stage",
"pageNumber": 38,
"type": "Tutorial Step - Look at the 26th!",
"definition": {
"icon": {
"project": "Superalgos",
"name": "bot-data-dependencies"
},
"text": "Let's shift the mouse pointer to the next candle, on February 26th!"
},
"paragraphs": [
{
"style": "Callout",
"text": "On the 26th the direction is Down and the slope is Gentle. Both conditions are met, so the strategy is triggered as soon as the candle closes."
},
{
"style": "Important",
"text": "Remember, each candle is evaluated only after it has closed! Every property of every product of every indicator refers to closed candles! This is crucial information, in particular when you are working with multiple time frames. I'll expand on this later on, but keep it in mind at all times!"
}
]
}
@@ -0,0 +1,22 @@
{
"tutorial": "3. Testing a Trading Idea - The Trigger Stage",
"pageNumber": 39,
"type": "Tutorial Step - Keep Looking!",
"definition": {
"icon": {
"project": "Superalgos",
"name": "bot-data-dependencies"
},
"text": "This visual check helps you mentally connect the dots of what you see on a simulation with the definitions you produce!"
},
"paragraphs": [
{
"style": "Callout",
"text": "Take a few more minutes to explore the trigger off event of the strategy, as well as the rest of the triggers ocurring over the period tested."
},
{
"style": "Success",
"text": "Take a moment to internalize the fact that events are triggered only once all the conditions in a given situation are met, and that conditions are evaluated over closed candles only!"
}
]
}
@@ -0,0 +1,26 @@
{
"tutorial": "3. Testing a Trading Idea - The Trigger Stage",
"pageNumber": 40,
"type": "Tutorial Step - Troubleshooting 101",
"definition": {
"icon": {
"project": "Superalgos",
"name": "bullet-error"
},
"text": "Whenever you are working on and testing definitions in a trading system, you should be in troubleshooting mode!"
},
"paragraphs": [
{
"style": "Text",
"text": "There are so many things involved in running a trading session that errors may occur for a wide assortment of reasons. The trading bot evaluates the definitions in the trading system and applies them by evaluating the data sets referenced in the definitions."
},
{
"style": "Callout",
"text": "Errors in the data or the definitions are common."
},
{
"style": "Text",
"text": "It's not likely that a data set is calculated with errors. However, if you haven't calculated the data set by running the corresponding data task, you will get errors!"
}
]
}
@@ -0,0 +1,30 @@
{
"tutorial": "3. Testing a Trading Idea - The Trigger Stage",
"pageNumber": 41,
"type": "Tutorial Step - Let's Hunt For Errors!",
"definition": {
"icon": {
"project": "Superalgos",
"name": "bullet-error"
},
"text": "Even when you are getting the results you expect, you may still have errors lurking around!"
},
"paragraphs": [
{
"style": "Text",
"text": "Some errors may be innocuous, and some may have hard-to-notice consequences."
},
{
"style": "Callout",
"text": "Go to the Trading System layer manager and turn on the Trading System Errors layer!"
},
{
"style": "Text",
"text": "Pan the charts to the left until you get to the first days of January. Do you see the error bullets at the bottom?"
},
{
"style": "Note",
"text": "Feel free to turn off some layers if needed."
}
]
}
@@ -0,0 +1,22 @@
{
"tutorial": "3. Testing a Trading Idea - The Trigger Stage",
"pageNumber": 42,
"type": "Tutorial Step - Errors & Time",
"definition": {
"icon": {
"project": "Superalgos",
"name": "bullet-error"
},
"text": "Errors are always tied to a specific point in time, that is, to a specific candle!"
},
"paragraphs": [
{
"style": "Text",
"text": "When the Trading Bot runs a trading session, it applies the definitions in the trading system candle by candle, one at a time. The bot doesn't know what lies ahead... it only knows the current candle, that is, the candle that is being evaluated."
},
{
"style": "Callout",
"text": "When an error occurs, it is handled by the trading bot, and the error is saved with the timestamp of the candle where it happened. This is how you get to know exactly what errors happened when."
}
]
}
@@ -0,0 +1,26 @@
{
"tutorial": "3. Testing a Trading Idea - The Trigger Stage",
"pageNumber": 43,
"type": "Tutorial Step - Errors & Nodes",
"definition": {
"icon": {
"project": "Superalgos",
"name": "bullet-error"
},
"text": "When errors happen due to definitions in the trading system, that is where you will find the corresponding error messages!"
},
"paragraphs": [
{
"style": "Text",
"text": "The Trading System Errors layer interacts with the design space so that you may track and find error messages. Messages are tied to the node responsible for producing the error!"
},
{
"style": "Callout",
"text": "Place the mouse pointer over one of the error bullets in the charting space and use the design space map to find the source of the red circle."
},
{
"style": "Note",
"text": "The video next shows what I found!"
}
]
}
@@ -0,0 +1,17 @@
{
"tutorial": "3. Testing a Trading Idea - The Trigger Stage",
"pageNumber": 44,
"type": "Tutorial Step - Trading Systems Tracking Errors",
"definition": {
"icon": {
"project": "Superalgos"
},
"text": "This step will play a video in full screen mode."
},
"paragraphs": [
{
"style": "Gif",
"text": "GIFs/Superalgos/Tutorials/trading-systems-tracking-errors.gif"
}
]
}
@@ -0,0 +1,30 @@
{
"tutorial": "3. Testing a Trading Idea - The Trigger Stage",
"pageNumber": 45,
"type": "Tutorial Step - Deciphering Errors",
"definition": {
"icon": {
"project": "Superalgos",
"name": "bullet-error"
},
"text": "Can not read property 'direction' of undefined. What is that all about?"
},
"paragraphs": [
{
"style": "Text",
"text": "This is the proper procedure to unpack an error message and understand what it is about:"
},
{
"style": "List",
"text": "You know when the error happened. Keep that in mind, as the error is solely related to the candle where it happened!"
},
{
"style": "List",
"text": "You know which node caused the error. It is likely the definition in the node that caused the error, either due to the code in the associated Javascript Node (if it's a condition), the formula (if it's a Formula node), or the node's configuration."
},
{
"style": "List",
"text": "You know the error message. Read it carefully and make the connection with the two previous clues!"
}
]
}
@@ -0,0 +1,26 @@
{
"tutorial": "3. Testing a Trading Idea - The Trigger Stage",
"pageNumber": 46,
"type": "Tutorial Step - Let's Unpack This Error",
"definition": {
"icon": {
"project": "Superalgos",
"name": "bullet-error"
},
"text": "The error is associated with one of our conditions, so we must check the Javascript Code we used!"
},
"paragraphs": [
{
"style": "Text",
"text": "This is the code in our condition:<br/>chart.at24hs.bollingerSubChannel.direction === 'Down'"
},
{
"style": "Callout",
"text": "The error says that the direction property of an object that is 'undefined' cannot be read."
},
{
"style": "Text",
"text": "The object the error refers to is the bollingerSubChannel product. That object is 'undefined'. Why? There is one last piece to fit in the puzzle: the error happens at the beginning of the data set. Do you see the problem?"
}
]
}
@@ -0,0 +1,26 @@
{
"tutorial": "3. Testing a Trading Idea - The Trigger Stage",
"pageNumber": 47,
"type": "Tutorial Step - Counting Candles!",
"definition": {
"icon": {
"project": "Superalgos",
"name": "layer-candles"
},
"text": "Take a good look at the first few candles in the data set. Do you see anything unusual?"
},
"paragraphs": [
{
"style": "Callout",
"text": "The Bollinger SubChannels does not exist for the first 19 candles! Hence, the object is undefined!"
},
{
"style": "Text",
"text": "The indicator derives from the Bollinger Bands, and the bands require at least 20 periods of historic data to be calculated. That is why it's undefined for 19 candles."
},
{
"style": "Success",
"text": "If we want to test a certain time range, we must make sure that all indicators we use in our trading system are calculated for the full range!"
}
]
}
@@ -0,0 +1,26 @@
{
"tutorial": "3. Testing a Trading Idea - The Trigger Stage",
"pageNumber": 48,
"type": "Tutorial Step - Lesson Learned?",
"definition": {
"icon": {
"project": "Superalgos",
"name": "learning-bot"
},
"text": "At this moment, the error doesn't affect us, because the first 19 days of the data set correspond to an uptrend! However, ..."
},
"paragraphs": [
{
"style": "Text",
"text": "... it would affect us if we were working with uptrends!"
},
{
"style": "Callout",
"text": "The troubleshooting process we just went through may come naturally to you if you are a developer. If you are not, you must become familiar with it, because you will certainly need to use it."
},
{
"style": "Success",
"text": "Trading automation requires many pieces of information to fit together like in a Swiss watch. You will make errors building strats. Deal with 'em!"
}
]
}
@@ -0,0 +1,26 @@
{
"tutorial": "3. Testing a Trading Idea - The Trigger Stage",
"pageNumber": 49,
"type": "Tutorial Step - Highlights and Values",
"definition": {
"icon": {
"project": "Superalgos",
"name": "nodes-highlights"
},
"text": "Let's move on to a brighter topic! I'll show you how to verify the validation of conditions with the highlights and values layers."
},
"paragraphs": [
{
"style": "Text",
"text": "Go to the Trading System layer manager and turn on the Trading System Highlights and the Trading System Values layers..."
},
{
"style": "Callout",
"text": "Now slide the mouse pointer over the candle where the strategy is triggered on!"
},
{
"style": "Success",
"text": "Use this resource when things are not going as you'd expect! This is how you find out why an event is not triggering when you think it should!"
}
]
}
@@ -0,0 +1,26 @@
{
"tutorial": "3. Testing a Trading Idea - The Trigger Stage",
"pageNumber": 50,
"type": "Tutorial Step - A Note on Event-Evaluation",
"definition": {
"icon": {
"project": "Superalgos",
"name": "nodes-highlights"
},
"text": "Did you notice that once the trigger stage is active, the conditions of the trigger on event are no longer evaluated?"
},
"paragraphs": [
{
"style": "Text",
"text": "The opposite goes for the trigger off event conditions: they are not evaluated before the stage is active. See for yourself!"
},
{
"style": "Callout",
"text": "The trading bot follows the protocol that governs trading systems and only evaluates the events that are required at any moment in time!"
},
{
"style": "Text",
"text": "It's logical, right? The bot aims to be as efficient as possible and does only what needs to be done!"
}
]
}
@@ -0,0 +1,26 @@
{
"tutorial": "3. Testing a Trading Idea - The Trigger Stage",
"pageNumber": 51,
"type": "Tutorial Step - The Land of Confusion",
"definition": {
"icon": {
"project": "Superalgos",
"name": "nodes-highlights"
},
"text": "Indeed, it is logical that the trading bot evaluates only the definitions that make sense evaluating at any point in time!"
},
"paragraphs": [
{
"style": "Text",
"text": "However, this is sometimes a source of confusion! Let's set up a hypothetical scenario!"
},
{
"style": "Callout",
"text": "Turn off the Strategies and the Trigger Stages layers in the Simulation Objects layer manager!"
},
{
"style": "Text",
"text": "Now slide the pointer over the candles around March 1st! Imagine that you are trying to verify your conditions, but for some reason, they show values and highlights for some candles, but not for others! Something is wrong with Superalgos! Not really, right?"
}
]
}
@@ -0,0 +1,26 @@
{
"tutorial": "3. Testing a Trading Idea - The Trigger Stage",
"pageNumber": 52,
"type": "Tutorial Step - The Time Frame Mystery",
"definition": {
"icon": {
"project": "Superalgos",
"name": "time-frames-filter"
},
"text": "Let's pull one more trick! Switch the time frame to 12 hs and slide the pointer over the charts!"
},
"paragraphs": [
{
"style": "Text",
"text": "OMG! I broke Superalgos! Nothing works anymore!"
},
{
"style": "Callout",
"text": "Trading sessions create simulations for the time frame configured in the Time Frame parameter!"
},
{
"style": "Text",
"text": "If you set your chart to a different time frame, you won't be able to see the simulation! In fact, you may find another simulation that you ran on that time frame at some other point in time! Indeed, Superalgos stores simulations for each time frame separately, even when they originate from the same trading session!"
}
]
}
@@ -0,0 +1,26 @@
{
"tutorial": "3. Testing a Trading Idea - The Trigger Stage",
"pageNumber": 53,
"type": "Tutorial Step - What Am I Missing?",
"definition": {
"icon": {
"project": "Superalgos",
"name": "help"
},
"text": "That, my friend, is the right question to ask! It's not... What is wrong? But... What am I missing?!"
},
"paragraphs": [
{
"style": "Text",
"text": "As I said earlier, many pieces of information need to fall in the right place for things to make sense in a complex world, and algorithmic trading is complex!"
},
{
"style": "Callout",
"text": "To succeed at building strategies, you must develop the intuition to ask yourself that question whenever things are not going your way!"
},
{
"style": "Success",
"text": "But don't be disheartened! I'll show you all the tricks I know so that you master algo-trading!"
}
]
}
@@ -0,0 +1,26 @@
{
"tutorial": "3. Testing a Trading Idea - The Trigger Stage",
"pageNumber": 54,
"type": "Tutorial Step - Free as a Bird",
"definition": {
"icon": {
"project": "Superalgos",
"name": "twitter"
},
"text": "Superalgos puts little or no constraints on what you may or may not do... You are free and encouraged to innovate!"
},
"paragraphs": [
{
"style": "Text",
"text": "Superalgos is not a little toy to play and build dumb bots with. It's a powerful and flexible arsenal to conquer trading! But flexibility comes at a cost!"
},
{
"style": "Callout",
"text": "Learn to handle the weapon to harness its power!"
},
{
"style": "Note",
"text": "Take a minute to reflect on the following: what do you think your odds of success at algorithmic trading would be without such a powerful tool in your hands? It's worth learning it!"
}
]
}
@@ -0,0 +1,22 @@
{
"tutorial": "3. Testing a Trading Idea - The Trigger Stage",
"pageNumber": 55,
"type": "Tutorial Step - Take Position Event",
"definition": {
"icon": {
"project": "Superalgos",
"name": "take-position-event"
},
"text": "Let's move on and start working on the definition of the Take Position Event!"
},
"paragraphs": [
{
"style": "Text",
"text": "A quick refresher about the hypothesis we came up with during the previous tutorial: In the context of a downtrend in the daily chart, a breakdown of the Bollinger Bands in the 1H chart may predict an acceleration of the downtrend. A breakdown means a candle closing below the lower band, so, let's find out how a close of a candle is described in Superalgos."
},
{
"style": "Callout",
"text": "This is the page documenting the Candles Volumes indicator. Scroll down to the Products & Properties > Candles section and read!"
}
]
}
@@ -0,0 +1,30 @@
{
"tutorial": "3. Testing a Trading Idea - The Trigger Stage",
"pageNumber": 56,
"type": "Tutorial Step - Candle Properties",
"definition": {
"icon": {
"project": "Superalgos",
"name": "layer-candles"
},
"text": "We have direct access to the properties of candles, and the value of the close is available at the close property."
},
"paragraphs": [
{
"style": "Text",
"text": "This makes accessing the close value of the candle quite straightforward:"
},
{
"style": "List",
"text": "Declare the time frame: <br/>chart.at01hs."
},
{
"style": "List",
"text": "Followed by product and property: <br/>candle.close"
},
{
"style": "Success",
"text": "That was the easy bit! Let's tackle the Bollinger Bands bit!"
}
]
}
@@ -0,0 +1,22 @@
{
"tutorial": "3. Testing a Trading Idea - The Trigger Stage",
"pageNumber": 57,
"type": "Tutorial Step - A Close Below the Bands?",
"definition": {
"icon": {
"project": "Superalgos",
"name": "layer-bands"
},
"text": "How do we describe a candle closing below the lower band? Let's see how the lower band is described!"
},
"paragraphs": [
{
"style": "Text",
"text": "The description of the Bollinger Bands explains that the upper and lower bands are located two standard deviations above and below the moving average (MA) respectively. We know the MA, as is offered in the movingAverage property. The standard deviation is offered in the standardDeviation property."
},
{
"style": "Callout",
"text": "The lower band is located two standard deviations below the MA. Then the lower band equals the MA minus the standard deviation times two."
}
]
}
@@ -0,0 +1,26 @@
{
"tutorial": "3. Testing a Trading Idea - The Trigger Stage",
"pageNumber": 58,
"type": "Tutorial Step - One More Detail!",
"definition": {
"icon": {
"project": "Superalgos",
"name": "layer-bands"
},
"text": "Look at the BB properties again! Two standard deviations is the deviation property!"
},
"paragraphs": [
{
"style": "Text",
"text": "So, the lower band is the MA minus the deviation!"
},
{
"style": "Callout",
"text": "Can you write the condition with this information? Open a text editor and try it!"
},
{
"style": "Success",
"text": "The close of the candle in the 1H chart is lesser than the moving average minus the deviation!"
}
]
}
@@ -0,0 +1,30 @@
{
"tutorial": "3. Testing a Trading Idea - The Trigger Stage",
"pageNumber": 59,
"type": "Tutorial Step - Let's Break It Down!",
"definition": {
"icon": {
"project": "Superalgos",
"name": "condition"
},
"text": "We will go through the statement step and step and put it into proper syntax!"
},
"paragraphs": [
{
"style": "List",
"text": "Remember, time goes first: in the 1H chart! <br/>chart.at01hs."
},
{
"style": "List",
"text": "The close of the candle: <br/>candle.close"
},
{
"style": "List",
"text": "Is lesser than: <br/><"
},
{
"style": "List",
"text": "The moving average minus the deviation, and remember you need to define a time frame for every statement: <br/>chart.at01hs.bollingerBand.movingAverage - chart.at01hs.bollingerBand.deviation"
}
]
}
@@ -0,0 +1,26 @@
{
"tutorial": "3. Testing a Trading Idea - The Trigger Stage",
"pageNumber": 60,
"type": "Tutorial Step - Let's Define It!",
"definition": {
"icon": {
"project": "Superalgos",
"name": "javascript-code"
},
"text": "We are ready to set up the condition under the Take Position Event! Let's do it!"
},
"paragraphs": [
{
"style": "Text",
"text": "The complete statement:<br/>chart.at01hs.candle.close < chart.at01hs.bollingerBand.movingAverage - chart.at01hs.bollingerBand.deviation"
},
{
"style": "Callout",
"text": "Copy and paste the statement in the Javascript Code node!"
},
{
"style": "Success",
"text": "Remember to give the condition a descriptive name, for example, 1H Breakdown."
}
]
}
@@ -0,0 +1,26 @@
{
"tutorial": "3. Testing a Trading Idea - The Trigger Stage",
"pageNumber": 61,
"type": "Tutorial Step - The Second Close",
"definition": {
"icon": {
"project": "Superalgos",
"name": "condition"
},
"text": "When we came up with the trading idea, we noticed that a single breakdown in the 1H chart would produce bad entries..."
},
"paragraphs": [
{
"style": "Text",
"text": "We decided that a first breakdown would be our signal, and that a second consecutive breakdown would be our confirmation."
},
{
"style": "Callout",
"text": "Let's refresh the concepts that will help us describe that situation! We are back on the Syntax Overview page. Please, read the section about the Previous Property!"
},
{
"style": "Text",
"text": "Can you write a second condition to finish the definition of the take position event?"
}
]
}
@@ -0,0 +1,22 @@
{
"tutorial": "3. Testing a Trading Idea - The Trigger Stage",
"pageNumber": 62,
"type": "Tutorial Step - The Previous Close",
"definition": {
"icon": {
"project": "Superalgos",
"name": "javascript-code"
},
"text": "Two consecutive closes means that the current and the previous candle close below the lower band!"
},
"paragraphs": [
{
"style": "Text",
"text": "To describe the close of the previous candle, we need to use the previous property to modify each property of each indicator used on both sides of the statement:<br/>chart.at01hs.candle.previous.close < chart.at01hs.bollingerBand.<br/>previous.movingAverage - chart.at01hs.bollingerBand.<br/>previous.deviation"
},
{
"style": "Text",
"text": "<strong>Create a new condition under the same situation and use the code above!</strong> Before you do that, notice that I introduced a couple of breaks in the statements after bollingerBand. just to have them fit the screen. You must remove them so that they don't cause trouble!"
}
]
}
@@ -0,0 +1,22 @@
{
"tutorial": "3. Testing a Trading Idea - The Trigger Stage",
"pageNumber": 63,
"type": "Tutorial Step - The Previous Property",
"definition": {
"icon": {
"project": "Superalgos",
"name": "record-property"
},
"text": "I mentioned we would use the previous property to modify each property on both sides of the statement..."
},
"paragraphs": [
{
"style": "Text",
"text": "I just wanted to clarify that such use is not mandatory! You may use the previous property on the statements of your choice. In our case, we need to compare the close of the candle, with the difference of the moving average and the deviation of the same candle! That is why we apply it to all statements!"
},
{
"style": "Text",
"text": "But you may, for instance, want to compare the close of the current candle to the close of the previous candle! In such a case, you may build a statement as follows:<br/><br/>chart.at01hs.candle.close > chart.at01hs.candle.previous.close"
}
]
}
@@ -0,0 +1,30 @@
{
"tutorial": "3. Testing a Trading Idea - The Trigger Stage",
"pageNumber": 64,
"type": "Tutorial Step - Second Backtest!",
"definition": {
"icon": {
"project": "Superalgos",
"name": "backtesting-session"
},
"text": "Now that we have implemented statements involving the 1H chart, we need to revise our testing parameters!"
},
"paragraphs": [
{
"style": "Text",
"text": "Make the following changes in these parameters:"
},
{
"style": "List",
"text": "Time Range: change the initialDateTime to 2020-02-01, so that we avoid the errors during the first 19 days of January."
},
{
"style": "List",
"text": "Time Frame: change the label to 01-hs to adapt to the current definitions."
},
{
"style": "Note",
"text": "We are not addressing the rest of the parameters yet, as we haven't defined the Open Stage, the one dealing with execution."
}
]
}
@@ -0,0 +1,22 @@
{
"tutorial": "3. Testing a Trading Idea - The Trigger Stage",
"pageNumber": 65,
"type": "Tutorial Step - Let's Do This!",
"definition": {
"icon": {
"project": "Superalgos",
"name": "task"
},
"text": "This is going to take a bit longer than the first backtest, as we are now testing on the 1H time frame."
},
"paragraphs": [
{
"style": "Callout",
"text": "If your trading task is still running, select Run on the Backtesting Session menu. If not, select Run on the Task menu first."
},
{
"style": "Note",
"text": "When the progress notice of the Trading Process Instance get's to the 100% mark, stop the task and click Next."
}
]
}
@@ -0,0 +1,38 @@
{
"tutorial": "3. Testing a Trading Idea - The Trigger Stage",
"pageNumber": 66,
"type": "Tutorial Step - Let's Get On The Same Page",
"definition": {
"icon": {
"project": "Superalgos",
"name": "bot-data-dependencies"
},
"text": "I just brought you to the one hour chart! Before discussing what we see here, let's take a minute to organize your chart."
},
"paragraphs": [
{
"style": "Text",
"text": "That way I can make sure you see the same things I see!"
},
{
"style": "List",
"text": "Masters Data Layer Manager: Turn everything off but the Candles and the Bollinger Bands layers."
},
{
"style": "List",
"text": "Simulation Objects Layer Manager: Turn everything off but the Strategies and Trigger Stages layers."
},
{
"style": "List",
"text": "Trading System Layer Manager: Turn everything off but the Trading System Errors, Highlights, and Values layers."
},
{
"style": "List",
"text": "Trading Engine Layer Manager: Turn everything off."
},
{
"style": "Text",
"text": "The next video shows what I see... and what you should!"
}
]
}
@@ -0,0 +1,17 @@
{
"tutorial": "3. Testing a Trading Idea - The Trigger Stage",
"pageNumber": 67,
"type": "Tutorial Step - Trading Systems Second Backtest",
"definition": {
"icon": {
"project": "Superalgos"
},
"text": "This step will play a video in full screen mode."
},
"paragraphs": [
{
"style": "Gif",
"text": "GIFs/Superalgos/Tutorials/trading-systems-second-backtest.gif"
}
]
}
@@ -0,0 +1,22 @@
{
"tutorial": "3. Testing a Trading Idea - The Trigger Stage",
"pageNumber": 68,
"type": "Tutorial Step - What Do We Have Here?",
"definition": {
"icon": {
"project": "Superalgos",
"name": "help"
},
"text": "In our first backtest, the strategy triggered after the daily Feb 26th candle closes. That shouldn't change on this one!"
},
"paragraphs": [
{
"style": "Callout",
"text": "Take a look! The strategy is triggered as soon as the last hourly candle of Feb 26th closes!"
},
{
"style": "Text",
"text": "Of course, the triggering has nothing to do with the hourly candle closing, but with the daily candle (that closes at the same time) validating both trigger on conditions as true. It doesn't matter what chart you are looking at or in what time frame the trading session runs. The trading bot validates each statement on the defined time frame."
}
]
}
@@ -0,0 +1,26 @@
{
"tutorial": "3. Testing a Trading Idea - The Trigger Stage",
"pageNumber": 69,
"type": "Tutorial Step - Take Position Event",
"definition": {
"icon": {
"project": "Superalgos",
"name": "take-position-event"
},
"text": "Let's do a quick check on the take position event and then address the elephant in the room: we have errors!"
},
"paragraphs": [
{
"style": "Text",
"text": "We mentioned earlier that when either the take position event or the trigger of event validates true, the trigger stage closes."
},
{
"style": "Callout",
"text": "Well, we can see the Trigger Stage closing on Feb 28th, at 9 hs... right after two consecutive hourly closes below the lower band! So far so good!"
},
{
"style": "Warning",
"text": "But we have errors immediately after that! Can you figure out what's going on?"
}
]
}
@@ -0,0 +1,22 @@
{
"tutorial": "3. Testing a Trading Idea - The Trigger Stage",
"pageNumber": 70,
"type": "Tutorial Step - Find The Error Challenge",
"definition": {
"icon": {
"project": "Superalgos",
"name": "bullet-error"
},
"text": "Did you find the error? What? You haven't looked? I just split the screen so that you may do your thing!"
},
"paragraphs": [
{
"style": "Callout",
"text": "The Trading System Errors layer is on! Go ahead and track the error on the Trading System!"
},
{
"style": "Success",
"text": "Remember... You just need to point to the error at the bottom of the chart, find the red circle on the design space, read the error message, and interpret it! Good luck!"
}
]
}
@@ -0,0 +1,26 @@
{
"tutorial": "3. Testing a Trading Idea - The Trigger Stage",
"pageNumber": 71,
"type": "Tutorial Step - Target Rate Error",
"definition": {
"icon": {
"project": "Superalgos",
"name": "bullet-error"
},
"text": "Did you find the error? You must have tracked it deep into the Open Stage, on the formula of the Target Rate definition!"
},
"paragraphs": [
{
"style": "Text",
"text": "Let me explain what this is about."
},
{
"style": "Callout",
"text": "When the Take Position Event validates true, the Trigger Stage is closed, and both the Open Stage and the Manage Stage are opened!"
},
{
"style": "Text",
"text": "We are getting an error on the first node of the open stage the trading bot evaluates. That is, if we fix that error, more errors will pop up when the trading bot attempts to evaluate the rest of the nodes that are also undefined."
}
]
}
@@ -0,0 +1,26 @@
{
"tutorial": "3. Testing a Trading Idea - The Trigger Stage",
"pageNumber": 72,
"type": "Tutorial Step - Radical Workaround",
"definition": {
"icon": {
"project": "Superalgos",
"name": "bullet-error"
},
"text": "The definitions in the open, close, and manage stages are the subject of the next tutorial in the series!"
},
"paragraphs": [
{
"style": "Text",
"text": "To complete the overview of the Trigger Stage we want to be able to see how the Take Position Event works on the rest of the time range tested. We are going to go for a radical workaround!"
},
{
"style": "Callout",
"text": "Delete the open, close, and manage stages! Use the Delete button on the menu!"
},
{
"style": "Text",
"text": "This way, when the take position event validates true and the trading bot attempts to read the definitions of the open stage, it will understand that the rest of the strategy is not defined, and will close the strategy."
}
]
}
@@ -0,0 +1,22 @@
{
"tutorial": "3. Testing a Trading Idea - The Trigger Stage",
"pageNumber": 73,
"type": "Tutorial Step - Let's Test Again!",
"definition": {
"icon": {
"project": "Superalgos",
"name": "task"
},
"text": "After you delete the open, close, and manage stages, you are ready to run a new backtest with the same parameters used earlier."
},
"paragraphs": [
{
"style": "Callout",
"text": "Let's do it! Run the task and session!"
},
{
"style": "Note",
"text": "When you run multiple backtests on the same time frame, the earlier data is replaced. That is, a trading session stores one data set for each time frame. If you want to keep&mdash;and be able to access&mdash;different versions of the tests you should use different trading sessions, and even better, different trading systems so that you may keep the matching definitions as well!"
}
]
}
@@ -0,0 +1,26 @@
{
"tutorial": "3. Testing a Trading Idea - The Trigger Stage",
"pageNumber": 74,
"type": "Tutorial Step - Are Errors Gone?",
"definition": {
"icon": {
"project": "Superalgos",
"name": "trading-strategy"
},
"text": "Ok! As expected, we can see that the strategy closes after the trigger stage closes! The video in the next step shows what I see!"
},
"paragraphs": [
{
"style": "Text",
"text": "Let's unpack what happens after the trigger stage closes!"
},
{
"style": "Callout",
"text": "Can you see the strategy triggering five times in a row starting on Feb 28th, at 9 hs?"
},
{
"style": "Text",
"text": "This happens because as soon as the strategy closes, the bot goes back to evaluating the Trigger On Event! That is what it usually does after a position is closed... look for more trading opportunities! This behavior is part of the normal functioning of the system, and a consequence of not defining the open, close, and manage stages."
}
]
}
@@ -0,0 +1,17 @@
{
"tutorial": "3. Testing a Trading Idea - The Trigger Stage",
"pageNumber": 75,
"type": "Tutorial Step - Trading Systems Third Backtest",
"definition": {
"icon": {
"project": "Superalgos"
},
"text": "This step will play a video in full screen mode."
},
"paragraphs": [
{
"style": "Gif",
"text": "GIFs/Superalgos/Tutorials/trading-systems-third-backtest.gif"
}
]
}
@@ -0,0 +1,30 @@
{
"tutorial": "3. Testing a Trading Idea - The Trigger Stage",
"pageNumber": 76,
"type": "Tutorial Step - Let's Take a Closer Look!",
"definition": {
"icon": {
"project": "Superalgos",
"name": "bot-data-dependencies"
},
"text": "We're going to take a few minutes to unpack everything we see on the chart so that you may fully understand how this works!"
},
"paragraphs": [
{
"style": "Text",
"text": "The fact that the strategy is triggering and closing five times in a row in five consecutive candles must mean the following:"
},
{
"style": "List",
"text": "The Trigger On Event validates true on each of these candles. "
},
{
"style": "List",
"text": "The Take Position Event also validates true on each of these candles! "
},
{
"style": "Success",
"text": "This also means that the strategy is triggering and taking the position on the same candle! Let's go and verify if all this is true!"
}
]
}
@@ -0,0 +1,26 @@
{
"tutorial": "3. Testing a Trading Idea - The Trigger Stage",
"pageNumber": 77,
"type": "Tutorial Step - Trigger On Conditions!",
"definition": {
"icon": {
"project": "Superalgos",
"name": "bot-data-dependencies"
},
"text": "Trigger on conditions require the subchannel direction to be Down and the slope to not be Side at the current 24H candle!"
},
"paragraphs": [
{
"style": "Text",
"text": "We are looking at 1H candles between 9 and 14 hs, on Feb 28th. Those are the candles on which the strategy is triggering and taking the position. Check for yourself!"
},
{
"style": "Callout",
"text": "What is the current daily candle? Think of what you learned earlier about evaluating closed candles!"
},
{
"style": "Text",
"text": "The current daily candle is the one that closed last: the Feb 27th candle, because the Feb 28th candle hasn't closed yet! Go to the 24H chart and confirm that the subchannel is Down and not Side on Feb 27th!"
}
]
}
@@ -0,0 +1,22 @@
{
"tutorial": "3. Testing a Trading Idea - The Trigger Stage",
"pageNumber": 78,
"type": "Tutorial Step - Take Position Conditions!",
"definition": {
"icon": {
"project": "Superalgos",
"name": "bot-data-dependencies"
},
"text": "The take position conditions require that two consecutive 1H candles close below the lower Bollinger Band!"
},
"paragraphs": [
{
"style": "Text",
"text": "That is quite easy to check! We've got the first close of the trigger stage at 9hs, after the 7hs and 8hs candles closed below the lower band. So, far, so good!"
},
{
"style": "Callout",
"text": "We have four more consecutive hourly closes below the lower band! On each of them, the condition of two consecutive closes below the lower band is true! Now that we understand what we see on this chart, let's discuss what this means for our trading idea!"
}
]
}
@@ -0,0 +1,26 @@
{
"tutorial": "3. Testing a Trading Idea - The Trigger Stage",
"pageNumber": 79,
"type": "Tutorial Step - A Little Speculation Game",
"definition": {
"icon": {
"project": "Superalgos",
"name": "help"
},
"text": "Let's do a quick mental exercise! Consider the point of the first take position event, that is, the 8hs candle, closing at 9 hs."
},
"paragraphs": [
{
"style": "Text",
"text": "Discard the chain of strategies that follow, as those are a by-product of not defining the rest of the stages!"
},
{
"style": "Callout",
"text": "Go to the Masters Data layer panel and turn on the plotter panel of the Candles layer in case it isn't!"
},
{
"style": "Text",
"text": "Now place the pointer of the mouse on the 8hs candle. As you can see on the panel, that candle closed at 8702 USDT. That would be our take position rate, give or take slippage. Now go to the 12hs candle. The min value for that candle is 8445 USDT. After that short-term low, the market goes in an uptrend (in the 1H time frame)."
}
]
}
@@ -0,0 +1,17 @@
{
"tutorial": "3. Testing a Trading Idea - The Trigger Stage",
"pageNumber": 80,
"type": "Tutorial Step - Trading Systems Candles Panel",
"definition": {
"icon": {
"project": "Superalgos"
},
"text": "This step will play a video in full screen mode."
},
"paragraphs": [
{
"style": "Gif",
"text": "GIFs/Superalgos/Tutorials/trading-systems-candles-panel.gif"
}
]
}
@@ -0,0 +1,26 @@
{
"tutorial": "3. Testing a Trading Idea - The Trigger Stage",
"pageNumber": 81,
"type": "Tutorial Step - Not So Great Right?",
"definition": {
"icon": {
"project": "Superalgos",
"name": "hit-fail"
},
"text": "That first entry doesn't look great if you ask me! Let's carry on with the same speculation game on the second potential entry!"
},
"paragraphs": [
{
"style": "Text",
"text": "This is the next instance of the trigger stage after the time range we analyzed earlier."
},
{
"style": "Callout",
"text": "Looks a lot more promising, right? It's the prelude to the March 12th crash, and there are good entries ahead of it!"
},
{
"style": "Text",
"text": "The first is at the close of the 15hs candle on March 8th. The second, at the close of the 8hs candle on March 12th. This is exactly what we were expecting from the analysis we did in the second tutorial."
}
]
}
@@ -0,0 +1,26 @@
{
"tutorial": "3. Testing a Trading Idea - The Trigger Stage",
"pageNumber": 82,
"type": "Tutorial Step - Let's Wrap It Up!",
"definition": {
"icon": {
"project": "Superalgos",
"name": "trigger-stage"
},
"text": "We've covered the basics and many of the nuances of the Trigger Stage, but the trading idea is not tested yet!"
},
"paragraphs": [
{
"style": "Text",
"text": "This little speculation game we just played is just that... a game! To complete the test of the trading idea, we'll have to dive deep into the rest of the stages!"
},
{
"style": "Callout",
"text": "And that is the subject of the next tutorial!"
},
{
"style": "Success",
"text": "If you are ready to keep going, click Next to close this tutorial and select Play on the one to the right!"
}
]
}