HUGE Refactoring Superalgos Project to Foundations Project done

This commit is contained in:
Luis Fernando Molina committed 2021-06-09 22:21:01 +02:00
1 parent c9c0aeaca7
commit 87edcc043d
3557 files changed
+10791 -10789

No files matched your search

@@ -0,0 +1,24 @@
{
"tutorial": "Testing a Trading Idea - The Other Stages",
"pageNumber": 1,
"type": "Testing a Trading Idea - The Other Stages Tutorial",
"definition": {
"text": "This tutorial completes the implementation of the trading idea formulated in the previous tutorials, covering the definitions of the Open Stage, Manage Stage, and Close Stage.",
"updated": 1617118735617
},
"paragraphs": [
{
"style": "Title",
"text": "About This Tutorial",
"updated": 1617118953736
},
{
"style": "List",
"text": "Workspace: Trading System Design Tutorials Plugin Workspace."
},
{
"style": "List",
"text": "Maintainer: @julianmolina (Telegram)."
}
]
}
@@ -0,0 +1,26 @@
{
"tutorial": "Testing a Trading Idea - The Other Stages",
"pageNumber": 2,
"type": "Tutorial - The Other Stages",
"definition": {
"icon": {
"project": "Foundations",
"name": "trading-strategy"
},
"text": "We are a few steps away from being able to fully test the first trading idea! You need to learn a thing or two first!"
},
"paragraphs": [
{
"style": "Text",
"text": "In the third tutorial in the series, we covered the definitions and nuances of the Trigger Stage."
},
{
"style": "Callout",
"text": "In this tutorial, we will complete the basic definitions of the rest of the stages so that we may finally test our hypothesis!"
},
{
"style": "Note",
"text": "I highly recommend you do the first three tutorials in the series before doing this one! The story is carried from one to the next!"
}
]
}
@@ -0,0 +1,26 @@
{
"tutorial": "Testing a Trading Idea - The Other Stages",
"pageNumber": 3,
"type": "Tutorial Step - Taking a Position",
"definition": {
"icon": {
"project": "Foundations",
"name": "open-stage"
},
"text": "As soon as the Take Position Event validates true, both the open stage and the manage stage become active."
},
"paragraphs": [
{
"style": "List",
"text": "The Open Stage is activated to deal with order execution in entering the position."
},
{
"style": "List",
"text": "The Manage Stage is activated to monitor stop loss and take profit targets. It is possible that targets are hit even before actually executing the orders to take the position, and that is the reason why the stage must be activated immediately."
},
{
"style": "Success",
"text": "Read these first few paragraphs about the open stage!"
}
]
}
@@ -0,0 +1,22 @@
{
"tutorial": "Testing a Trading Idea - The Other Stages",
"pageNumber": 4,
"type": "Tutorial Step - Initial Targets....",
"definition": {
"icon": {
"project": "Foundations",
"name": "initial-targets"
},
"text": "I just brought you to the Initial Targets node in the open stage. Before we start, let's make a quick note for clarity's sake!"
},
"paragraphs": [
{
"style": "Callout",
"text": "You're not in the trading system you set up during the previous tutorial! It's a new one!"
},
{
"style": "Note",
"text": "I set up a new trading system and named it BB Breakdown 2 so that I have better control of your experience during this tutorial. Notice that I recreated the stages you deleted in the previous tutorials. All I had to do was select Add Missing Stages on the trading strategy menu!"
}
]
}
@@ -0,0 +1,30 @@
{
"tutorial": "Testing a Trading Idea - The Other Stages",
"pageNumber": 5,
"type": "Tutorial Step - Look Around!",
"definition": {
"icon": {
"project": "Foundations",
"name": "initial-targets"
},
"text": "Take a look at the nodes under Initial Targets. Do you have an intuition as to what they may be about?"
},
"paragraphs": [
{
"style": "Text",
"text": "These are the first few basic definitions required:"
},
{
"style": "List",
"text": "Target Rate is a reference rate. Think of it as a ball-park rate at which you wish to enter the position. There is a lot more depth to this concept, but the simplification serves us well at this point."
},
{
"style": "List",
"text": "The Target Size In Base Asset and it's brother node, target size in quoted asset, is the definition of the maximum size the position should achieve."
},
{
"style": "Note",
"text": "The final rates and size is determined later on, in the definitions of the Execution Algorithm."
}
]
}
@@ -0,0 +1,26 @@
{
"tutorial": "Testing a Trading Idea - The Other Stages",
"pageNumber": 6,
"type": "Tutorial Step - The Target Rate",
"definition": {
"icon": {
"project": "Foundations",
"name": "target-rate"
},
"text": "As I said earlier, the Target Rate is a concept that entails some depth, but we'll keep it simple for the time being!"
},
"paragraphs": [
{
"style": "Text",
"text": "The target rate serves several purposes. At this point, we'll place the focus on one of them:"
},
{
"style": "Callout",
"text": "We will use the target rate as a reference rate."
},
{
"style": "Text",
"text": "Later on, we will set up a market order to enter the position. However, market orders—by definition—do not specify a rate, as they are filled at the current market price. The system will use the reference rate we define to mark the take position rate in simulations, and will use it as a starting point for internal calculations too."
}
]
}
@@ -0,0 +1,31 @@
{
"tutorial": "Testing a Trading Idea - The Other Stages",
"pageNumber": 7,
"type": "Tutorial Step - How Do We Go About It?",
"definition": {
"icon": {
"project": "Foundations",
"name": "target-rate"
},
"text": "Remember we are taking the position at the close of the 1H candle, whenever the take position event validates true."
},
"paragraphs": [
{
"style": "Callout",
"text": "What would be a reasonable rate, then?"
},
{
"style": "Text",
"text": "Well... a good choice would be the rate at the close of the candle, right? Our target rate formula would then be:",
"updated": 1610472351878
},
{
"style": "Javascript",
"text": "chart.at01hs.candle.close"
},
{
"style": "Callout",
"text": "Go ahead and edit the formula with the above syntax!"
}
]
}
@@ -0,0 +1,30 @@
{
"tutorial": "Testing a Trading Idea - The Other Stages",
"pageNumber": 8,
"type": "Tutorial Step - The Target Size",
"definition": {
"icon": {
"project": "Foundations",
"name": "target-size-in-base-asset"
},
"text": "I mentioned earlier that—like when setting up a manual order at the exchange—you may define the size in either of the assets!"
},
"paragraphs": [
{
"style": "Text",
"text": "What I didn't mention is that you can't have two definitions! To avoid ambiguities, only one is allowed!"
},
{
"style": "Callout",
"text": "We will define the size in the base asset, so delete the Target Size In Quoted Asset node!"
},
{
"style": "Text",
"text": "We will keep this one simple too. For the time being, we will use the whole balance available to the session."
},
{
"style": "Success",
"text": "How do we do that? You'll see!"
}
]
}
@@ -0,0 +1,22 @@
{
"tutorial": "Testing a Trading Idea - The Other Stages",
"pageNumber": 9,
"type": "Tutorial Step - The Whole Balance?",
"definition": {
"icon": {
"project": "Foundations",
"name": "balance"
},
"text": "We haven't discussed position size so far, as the intention of the testing of the trading idea is measuring hit ratio only."
},
"paragraphs": [
{
"style": "Text",
"text": "For the same reason, we are not going to get into further considerations at this point. We'll save a few thoughts in that regard for when we define the execution algorithm and orders. <br/><br/>I just brought you to the definition of the Trading Parameters of the trading session so that you may check how the initialBalance is defined!"
},
{
"style": "Callout",
"text": "Check the Session Base Asset and the Session Quoted Asset configuration!"
}
]
}
@@ -0,0 +1,26 @@
{
"tutorial": "Testing a Trading Idea - The Other Stages",
"pageNumber": 10,
"type": "Tutorial Step - Initial Balance vs. Balance",
"definition": {
"icon": {
"project": "Foundations",
"name": "balance"
},
"text": "As you can see, the initialBalance is defined in the Session Base Asset. This is just a matter of choice!"
},
"paragraphs": [
{
"style": "Text",
"text": "We defined it in the base asset because it makes sense for our trading idea, which intends to sell some bitcoin we hold to rebuy it at a cheaper price."
},
{
"style": "Callout",
"text": "But we can't use the value of the initialBalance for our target size! Can you see why?"
},
{
"style": "Text",
"text": "The target size we define is valid for each position the strategy will take. If it was the initialBalance and we lost some bitcoin in the first position, we would get an error in the second position, as&mdash;by then&mdash;we wouldn't have that much bitcoin any more!"
}
]
}
@@ -0,0 +1,27 @@
{
"tutorial": "Testing a Trading Idea - The Other Stages",
"pageNumber": 11,
"type": "Tutorial Step - It's The Balance!",
"definition": {
"icon": {
"project": "Foundations",
"name": "balance"
},
"text": "What we need is the Balance! What balance? Take a minute and see if you can finish tying up the loose ends of the reasoning!"
},
"paragraphs": [
{
"style": "Text",
"text": "We defined the initialBalance in the base asset and will define the target size in the base asset..."
},
{
"style": "Callout",
"text": "We need the current balance of the base asset! Can you find the node in the Trading Engine that holds precisely that value?"
},
{
"style": "Success",
"text": "Trading Current (we need the balance at the moment of evaluation!) > Trading Episode (because it's the balance kept for the whole session) >... what else?",
"updated": 1617196723617
}
]
}
@@ -0,0 +1,36 @@
{
"tutorial": "Testing a Trading Idea - The Other Stages",
"pageNumber": 12,
"type": "Tutorial Step - There It Is!",
"definition": {
"icon": {
"project": "Foundations",
"name": "balance"
},
"text": "I hope you found it on your own, but don't worry if you didn't! We'll go through the whole reasoning once again!"
},
"paragraphs": [
{
"style": "Text",
"text": "The goal is that you learn how to find the data you need in the confines of the Trading Engine, which is structured logically... Make sure you read the tooltips!"
},
{
"style": "List",
"text": "Trading Current because we need the balance at the moment of evaluation!",
"updated": 1617196763109
},
{
"style": "List",
"text": "Trading Episode because is the running balance kept along the whole trading session!",
"updated": 1617196769560
},
{
"style": "List",
"text": "Episode Base Asset because it's consistent with the rest of our definitions!"
},
{
"style": "List",
"text": "Balance because it's what we wanted!"
}
]
}
@@ -0,0 +1,34 @@
{
"tutorial": "Testing a Trading Idea - The Other Stages",
"pageNumber": 13,
"type": "Tutorial Step - Copy The Node's Path!",
"definition": {
"icon": {
"project": "Foundations",
"name": "copy-path"
},
"text": "Do you remember how to extract the address of the node so that we may reference it from our formula?"
},
"paragraphs": [
{
"style": "Callout",
"text": "Acess the node's menu and click on the \"Copy Node Path\" button!",
"updated": 1622547599361
},
{
"style": "Text",
"text": "The following string should end up in your clipboard:",
"updated": 1617197048058
},
{
"style": "Json",
"text": "tradingEngine.tradingCurrent.tradingEpisode.episodeBaseAsset.balance.value",
"updated": 1617197103346
},
{
"style": "Note",
"text": "Take a look at the path... see how it makes sense?",
"updated": 1617197206806
}
]
}
@@ -0,0 +1,22 @@
{
"tutorial": "Testing a Trading Idea - The Other Stages",
"pageNumber": 14,
"type": "Tutorial Step - Circling Back!",
"definition": {
"icon": {
"project": "Foundations",
"name": "formula"
},
"text": "Awesome! We have the path of the appropriate Balance node and we now may use it in our formula!"
},
"paragraphs": [
{
"style": "Callout",
"text": "Paste the string you copied in the formula of the Target Size In Base Asset node! That's it!"
},
{
"style": "Note",
"text": "Notice that using the balance for the target size is an arbitrary decision! We could have used anything else! A percentage of the balance, a fixed number, a percentage of the initial balance... anything! Or, actually, whatever makes sense for your strategy!"
}
]
}
@@ -0,0 +1,22 @@
{
"tutorial": "Testing a Trading Idea - The Other Stages",
"pageNumber": 15,
"type": "Tutorial Step - Time to Talk Execution!",
"definition": {
"icon": {
"project": "Foundations",
"name": "open-execution"
},
"text": "We finished the definition of the rate and size targets. Let's define how we are going to take the position in terms of execution!"
},
"paragraphs": [
{
"style": "Callout",
"text": "We are in the Open Execution section of the open stage! Go exploring the Execution Algorithm and the Market Sell Order I created!"
},
{
"style": "Note",
"text": "I created the execution algo and the market order ahead of time so that I can reference them easily and take you to the right nodes during the tutorial. Both are in a freshly-created state, right as they'd be had you created them right now!"
}
]
}
@@ -0,0 +1,22 @@
{
"tutorial": "Testing a Trading Idea - The Other Stages",
"pageNumber": 16,
"type": "Tutorial Step - Let's Do Some Reading!",
"definition": {
"icon": {
"project": "Foundations",
"name": "open-execution"
},
"text": "Read these first few paragraphs about the Open Execution so that we may then start working on the definitions."
},
"paragraphs": [
{
"style": "Callout",
"text": "The point to take home is that Superalgos proposes granular definitions of orders set up within execution algorithms, which in turn are built into strategies, as the way to program both simple and complex execution logic."
},
{
"style": "Success",
"text": "We'll do some more reading before we bring all this down to Earth!"
}
]
}
@@ -0,0 +1,31 @@
{
"tutorial": "Testing a Trading Idea - The Other Stages",
"pageNumber": 17,
"type": "Tutorial Step - Execution Algorithm",
"definition": {
"icon": {
"project": "Foundations",
"name": "execution-algorithm"
},
"text": "Take a look at this page about the Execution Algorithm! Read the Configuration section too!",
"updated": 1617197894850
},
"paragraphs": [
{
"style": "Text",
"text": "For our test&mdash;and for most simple strategies&mdash;one execution algorithm is all we need."
},
{
"style": "Callout",
"text": "Once you finish reading, take a look at the configuration of the algorithm!"
},
{
"style": "Text",
"text": "Notice that the algo is assigned&mdash;by default&mdash;100% of the stage's size."
},
{
"style": "Success",
"text": "This is the first instance in which the target size we defined earlier comes into the scene!"
}
]
}
@@ -0,0 +1,27 @@
{
"tutorial": "Testing a Trading Idea - The Other Stages",
"pageNumber": 18,
"type": "Tutorial Step - Market Sell Orders",
"definition": {
"icon": {
"project": "Foundations",
"name": "market-sell-order"
},
"text": "We'll use a single execution algorithm handling 100% of the size we defined earlier! Time to learn a bit about orders!"
},
"paragraphs": [
{
"style": "Text",
"text": "There is quite a bit of depth on the matter of how orders work! We'll get into the details on a tutorial focusing on the nuances of order execution. But for the time being, we'll keep it simple:"
},
{
"style": "Callout",
"text": "A market sell order is an instruction sent to the exchange to sell the base asset, for immediate execution at current market prices.",
"updated": 1622547845887
},
{
"style": "Success",
"text": "Check the configuration of the sell order!"
}
]
}
@@ -0,0 +1,22 @@
{
"tutorial": "Testing a Trading Idea - The Other Stages",
"pageNumber": 19,
"type": "Tutorial Step - 100% of 100% = ?",
"definition": {
"icon": {
"project": "Foundations",
"name": "market-sell-order"
},
"text": "As you can see, the percentageOfAlgorithmSize is also 100% by default, and that is what we'll use for the test."
},
"paragraphs": [
{
"style": "Text",
"text": "That is, we'll set up a single order to enter the position. The order will handle 100% of what is assigned to the algorithm, which in turn handles 100% of what is assigned to the stage. And we assigned the stage 100% of the balance! In other words, we'll place one market sell order with the size of the Balance to enter each position."
},
{
"style": "Success",
"text": "I told you we'd keep it simple! This is the simplest possible order execution arrangement and, as you can see, you just need to create the algo and the order, and use the default settings!"
}
]
}
@@ -0,0 +1,22 @@
{
"tutorial": "Testing a Trading Idea - The Other Stages",
"pageNumber": 20,
"type": "Tutorial Step - Create Order Event",
"definition": {
"icon": {
"project": "Foundations",
"name": "create-order-event"
},
"text": "This event is self-explanatory and works like the rest of the events you're already familiar with, with situations and conditions."
},
"paragraphs": [
{
"style": "Text",
"text": "Although the decision to take a position is made at the Trigger Stage, the Create Order Event offers granular control over each order, so that you may decide the precise moment or market situation in which to place it."
},
{
"style": "Callout",
"text": "In our case, we'll place the order immediately after the Take Position Event is triggered, so go ahead and type true on the JavaScript Code node of the one condition created by default with the order. This makes the condition return true as soon as it's evaluated."
}
]
}
@@ -0,0 +1,22 @@
{
"tutorial": "Testing a Trading Idea - The Other Stages",
"pageNumber": 21,
"type": "Tutorial Step - Simulated Exchange Events",
"definition": {
"icon": {
"project": "Foundations",
"name": "simulated-exchange-events"
},
"text": "This section of the definitions offers another example of granular control at the level of the order, in this case affecting how orders are simulated!"
},
"paragraphs": [
{
"style": "Text",
"text": "These definitions&mdash;if used&mdash;override the Slippage and Fee Structure Trading Parameters at the level of the trading session, which affect all orders equally. Notice there is a node that may even define how to simulate the filling of orders! If there is no definition of how to simulate the individual order, the session-level parameters remain relevant."
},
{
"style": "Callout",
"text": "For the time being, we are not going to use these granular-level simulation parameters, so go ahead and delete the simulated exchange events node!"
}
]
}
@@ -0,0 +1,22 @@
{
"tutorial": "Testing a Trading Idea - The Other Stages",
"pageNumber": 22,
"type": "Tutorial Step - Close Stage Event",
"definition": {
"icon": {
"project": "Foundations",
"name": "close-stage-event"
},
"text": "We are not going to use the Close Stage Event either, so go ahead and delete it too!"
},
"paragraphs": [
{
"style": "Text",
"text": "The open stage closes automatically once the target size is filled, or when the stop loss or take profit targets are hit. The former is what we expect to happen in our case, as we are using a single market order to take the position, and it is placed as soon as the take position event is triggered. It is safe to assume that the order will get filled immediately."
},
{
"style": "Callout",
"text": "The close stage event offers&mdash;again&mdash;an additional level of control! For example, when the position is taken with multiple orders, you may want to stop placing orders under certain circumstances."
}
]
}
@@ -0,0 +1,26 @@
{
"tutorial": "Testing a Trading Idea - The Other Stages",
"pageNumber": 23,
"type": "Tutorial Step - Back to the Order",
"definition": {
"icon": {
"project": "Foundations",
"name": "market-order"
},
"text": "There's one more thing we need to take care of before we move on to the definitions in the manage stage!"
},
"paragraphs": [
{
"style": "Text",
"text": "The Trading Bot keeps track of each order at all times and saves the corresponding information in a specific structure of nodes in the Trading Engine."
},
{
"style": "Callout",
"text": "Expand the Market Sell Order #1 node and take a look inside."
},
{
"style": "Note",
"text": "Because each order has a life of it's own, the bot stores information about each order in separate structures of nodes, one per order."
}
]
}
@@ -0,0 +1,26 @@
{
"tutorial": "Testing a Trading Idea - The Other Stages",
"pageNumber": 24,
"type": "Tutorial Step - Here's The Thing!",
"definition": {
"icon": {
"project": "Foundations",
"name": "market-order"
},
"text": "The system doesn't know which arrangement of execution algorithms and orders you are going to create!"
},
"paragraphs": [
{
"style": "Text",
"text": "For that reason, it doesn't know what kind of data structure you will need at the trading engine to keep track of all your orders!"
},
{
"style": "Callout",
"text": "For the time being, there is a manual process that is required to tell Superalgos what orders you need to keep track of, and where the information should be stored! And that is what we need to do next!"
},
{
"style": "Text",
"text": "Don't worry, it's no big deal! As it's often the case, it takes longer to explain than to do it!"
}
]
}
@@ -0,0 +1,27 @@
{
"tutorial": "Testing a Trading Idea - The Other Stages",
"pageNumber": 25,
"type": "Tutorial Step - It's All About References!",
"definition": {
"icon": {
"project": "Foundations",
"name": "market-order"
},
"text": "Do you remember what references are and how to establish them? Watch the video for a quick refresher!",
"updated": 1617198810582
},
"paragraphs": [
{
"style": "Text",
"text": "References are a crucial concept in Superalgos, as they relate information across nodes and hierarchies!"
},
{
"style": "Callout",
"text": "You must establish a reference from the Market Sell Order node in the trading system to this Market Sell Order #1 Market Order node in the trading engine hierarchy! Go ahead! Do it!"
},
{
"style": "Success",
"text": "I'll give you a couple of tips on the next step if you are not sure how to go about this!"
}
]
}
@@ -0,0 +1,36 @@
{
"tutorial": "Testing a Trading Idea - The Other Stages",
"pageNumber": 26,
"type": "Tutorial Step - The Tricks of the Trade",
"definition": {
"icon": {
"project": "Foundations",
"name": "mouse-pointer"
},
"text": "Establishing a reference is kid's play! The only \"challenge\" here is that the node to be referenced is far away from the originator.",
"updated": 1615805937875
},
"paragraphs": [
{
"style": "Text",
"text": "These UI tricks may make your life easier:"
},
{
"style": "List",
"text": "Use the design space map as many times as required to find your way from node to node."
},
{
"style": "List",
"text": "Pin the node you are going to move across the design space, so that you may drop it at any point to check the design space map for directions."
},
{
"style": "List",
"text": "Use Ctrl / Command + arrow keys to drag the node across the screen after clicking on it with the mouse. Keep keys pressed and the node flies!",
"updated": 1617199512325
},
{
"style": "List",
"text": "Remove the pin once the reference is established so that the node goes back to its place."
}
]
}
@@ -0,0 +1,26 @@
{
"tutorial": "Testing a Trading Idea - The Other Stages",
"pageNumber": 27,
"type": "Tutorial Step - Position Management",
"definition": {
"icon": {
"project": "Foundations",
"name": "manage-stage"
},
"text": "We finished the definitions required to take a position and we are ready to define the initial stop loss and take profit targets!"
},
"paragraphs": [
{
"style": "Text",
"text": "Let's remember what we had decided our targets would be while developing the idea."
},
{
"style": "List",
"text": "For downtrends: we will set 3% stop loss and 10% take profit targets."
},
{
"style": "Callout",
"text": "Collapse the open stage node as we are not going to touch it for a while. <br/><br/>Now expand the Manage Stage node and take a look inside!"
}
]
}
@@ -0,0 +1,26 @@
{
"tutorial": "Testing a Trading Idea - The Other Stages",
"pageNumber": 28,
"type": "Tutorial Step - Phase 1",
"definition": {
"icon": {
"project": "Foundations",
"name": "phase-0"
},
"text": "There is enormous depth to the concept of managing positions and Superalgos offers robust and flexible tools for that matter!"
},
"paragraphs": [
{
"style": "Text",
"text": "However, we don't need to get into the details at this point, as&mdash;for the sake of our test&mdash;all we need to do is set up initial targets."
},
{
"style": "Callout",
"text": "Initial targets are set on Phase #1"
},
{
"style": "Success",
"text": "Later on, you will learn that you may manage your positions in phases, each with its formulas and events to switch back and forth to other phases."
}
]
}
@@ -0,0 +1,26 @@
{
"tutorial": "Testing a Trading Idea - The Other Stages",
"pageNumber": 29,
"type": "Tutorial Step - Managed Stop Loss",
"definition": {
"icon": {
"project": "Foundations",
"name": "stop-loss"
},
"text": "Let's prepare the syntax to use for the Phase #1 formula of the Managed Stop Loss!"
},
"paragraphs": [
{
"style": "Text",
"text": "We want to set a stop loss target 3% above the rate at which we entered the position. How do we do that?"
},
{
"style": "Callout",
"text": "Go to the Trading Engine and try to find the node that holds the information of the rate at which the position is entered."
},
{
"style": "Success",
"text": "Remember the logic to navigate the data structure! First, determine the context in which the information exists!"
}
]
}
@@ -0,0 +1,33 @@
{
"tutorial": "Testing a Trading Idea - The Other Stages",
"pageNumber": 30,
"type": "Tutorial Step - Entry Target Rate",
"definition": {
"icon": {
"project": "Foundations",
"name": "entry-target-rate"
},
"text": "We are in the Current > Position section of the Trading Engine and, to your left, the Entry Target Rate node!",
"updated": 1610472841926
},
"paragraphs": [
{
"style": "Callout",
"text": "Copy the node path from the menu!"
},
{
"style": "Text",
"text": "Now, let's add 3% to the node's value:",
"updated": 1610472749300
},
{
"style": "Javascript",
"text": "tradingEngine.tradingCurrent.position.entryTargetRate.value * 1.03"
},
{
"style": "Success",
"text": "Go ahead and use the above for the Phase #1 stop loss formula!",
"updated": 1610472786651
}
]
}
@@ -0,0 +1,33 @@
{
"tutorial": "Testing a Trading Idea - The Other Stages",
"pageNumber": 31,
"type": "Tutorial Step - Managed Take Profit",
"definition": {
"icon": {
"project": "Foundations",
"name": "managed-take-profit"
},
"text": "Now that we have a formula for a fixed stop loss target, it shouldn't be hard to come up with the formula for the take profit target!"
},
"paragraphs": [
{
"style": "Text",
"text": "We just need to subtract 10% to the entry target rate node's value:",
"updated": 1610472925103
},
{
"style": "Javascript",
"text": "tradingEngine.tradingCurrent.position.entryTargetRate.value * 0.9"
},
{
"style": "Callout",
"text": "Use is for the Phase #1 take profit formula!",
"updated": 1610472948413
},
{
"style": "Success",
"text": "We are done with the Manage Stage!",
"updated": 1610472960123
}
]
}
@@ -0,0 +1,26 @@
{
"tutorial": "Testing a Trading Idea - The Other Stages",
"pageNumber": 32,
"type": "Tutorial Step - Closing a Position",
"definition": {
"icon": {
"project": "Foundations",
"name": "close-stage"
},
"text": "Let's do some quick reading about the Close Stage! Take a look at this page!"
},
"paragraphs": [
{
"style": "Text",
"text": "The close stage features similar workings as the open stage, provides the same level of flexibility to define execution, and requires the same kind of definitions."
},
{
"style": "Callout",
"text": "Take a few minutes to think about how to close this position. Think about what our target rate and target size should be."
},
{
"style": "Note",
"text": "Also, think about what type of order we should use!"
}
]
}
@@ -0,0 +1,30 @@
{
"tutorial": "Testing a Trading Idea - The Other Stages",
"pageNumber": 33,
"type": "Tutorial Step - Initial Targets",
"definition": {
"icon": {
"project": "Foundations",
"name": "initial-targets"
},
"text": "For the target rate, we can use the same principle as earlier: chart.at01hs.candle.close Use it for the formula!"
},
"paragraphs": [
{
"style": "Text",
"text": "For the target size, we should consider the following:"
},
{
"style": "List",
"text": " We wish to use all the USDT we obtained upon entering the position."
},
{
"style": "List",
"text": " The exchange charges fees by subtracting from the asset we obtain on any given transaction."
},
{
"style": "Callout",
"text": "Consider the above and pay a visit to the Trading Engine. Find the nodes that store the information we need and try to come up with a formula for the target size!"
}
]
}
@@ -0,0 +1,36 @@
{
"tutorial": "Testing a Trading Idea - The Other Stages",
"pageNumber": 34,
"type": "Tutorial Step - How to Find Stuff",
"definition": {
"icon": {
"project": "Foundations",
"name": "trading-engine"
},
"text": "Let me walk you through the reasoning to find the required information on the Trading Engine"
},
"paragraphs": [
{
"style": "Text",
"text": "We are in the Trading Current > Strategy Open Stage > Stage Quoted Asset section. This is why:",
"updated": 1617205430340
},
{
"style": "List",
"text": "Trading Current: it's all about the current position.",
"updated": 1617205459033
},
{
"style": "List",
"text": "Strategy Open Stage : because the transaction to enter the position happened during this stage. We want to know how much USDT we got!"
},
{
"style": "List",
"text": "Stage Quoted Asset : because we sold the base asset and obtained the quoted asset, and it's the quoted asset we want to get rid of during the close stage! The question is how much of it!"
},
{
"style": "Text",
"text": "Any ideas for the formula?"
}
]
}
@@ -0,0 +1,30 @@
{
"tutorial": "Testing a Trading Idea - The Other Stages",
"pageNumber": 35,
"type": "Tutorial Step - And the Winner Is...",
"definition": {
"icon": {
"project": "Foundations",
"name": "target-size"
},
"text": "The answer is Size Filled minus Fees Paid! I'll explain why none of the other nodes fit the bill!"
},
"paragraphs": [
{
"style": "List",
"text": "Target Size: no, because this is just the target we defined!"
},
{
"style": "List",
"text": "Size Placed: closer, but no, because the order won't necessarily fill for the exact amount placed, due to decimal roundings or other reasons!"
},
{
"style": "List",
"text": "Size Filled: yes! But remember the exchange takes its cut too, so you must subtract the fees!"
},
{
"style": "Success",
"text": "Can you produce the correct syntax for the formula? Remember you can copy the paths of the nodes holding the data we need!"
}
]
}
@@ -0,0 +1,32 @@
{
"tutorial": "Testing a Trading Idea - The Other Stages",
"pageNumber": 36,
"type": "Tutorial Step - Target Size in Quoted Asset",
"definition": {
"icon": {
"project": "Foundations",
"name": "target-size-in-quoted-asset"
},
"text": "I didn't mention this earlier: we will define the target size in the quoted asset, not the base asset as we did for the open stage!"
},
"paragraphs": [
{
"style": "Text",
"text": "It's natural we do so, as that is the asset we now have!"
},
{
"style": "Callout",
"text": "Delete the Target Size In Base Asset node!"
},
{
"style": "Text",
"text": "I built this for the target size formula copying paths... Use it, making sure you don't introduce line breaks on the nodes' paths!",
"updated": 1610473186038
},
{
"style": "Javascript",
"text": "tradingEngine.tradingCurrent.strategyOpenStage.stageQuotedAsset.sizeFilled.value - \ntradingEngine.tradingCurrent.strategyOpenStage.stageQuotedAsset.feesPaid.value",
"updated": 1610473148011
}
]
}
@@ -0,0 +1,30 @@
{
"tutorial": "Testing a Trading Idea - The Other Stages",
"pageNumber": 37,
"type": "Tutorial Step - Market Buy Order",
"definition": {
"icon": {
"project": "Foundations",
"name": "market-buy-order"
},
"text": "Just like for the open stage, I created the execution algorithm and the market buy order..."
},
"paragraphs": [
{
"style": "Text",
"text": "Let's take care of a couple of things before we move on:"
},
{
"style": "List",
"text": "Delete the Simulated Exchange Events node! We are not going to use it for the time being..."
},
{
"style": "List",
"text": "Enter true in the JavaScript Code node of the Create Order Event condition."
},
{
"style": "Success",
"text": "Now you have to create the reference from the Market Buy Order node to the Market Order in the trading engine. I will show you which one in the next step!"
}
]
}
@@ -0,0 +1,34 @@
{
"tutorial": "Testing a Trading Idea - The Other Stages",
"pageNumber": 38,
"type": "Tutorial Step - This is it!",
"definition": {
"icon": {
"project": "Foundations",
"name": "market-order"
},
"text": "This is the node you have to create the reference to: Market Buy Order #1."
},
"paragraphs": [
{
"style": "Text",
"text": "Remember the tricks for the trip!"
},
{
"style": "List",
"text": "Use the design space map as many times as required to find your way from node to node."
},
{
"style": "List",
"text": "Pin the node you are going to move across the design space, so that you may drop it at any point to check the design space map for directions."
},
{
"style": "List",
"text": "Use Ctrl / Command + arrow keys to drag the node across the screen after clicking on it with the mouse. Keep keys pressed and the node flies!"
},
{
"style": "List",
"text": "Remove the pin once the reference is established so that the node goes back to its place."
}
]
}
@@ -0,0 +1,22 @@
{
"tutorial": "Testing a Trading Idea - The Other Stages",
"pageNumber": 39,
"type": "Tutorial Step - We're almost done!",
"definition": {
"icon": {
"project": "Foundations",
"name": "close-stage-event"
},
"text": "We're virtually ready to run a new backtest, this time, with complete definitions in all stages!"
},
"paragraphs": [
{
"style": "Callout",
"text": "Before we do that, let's delete the Close Stage Event as we are not going to use it either!"
},
{
"style": "Success",
"text": "That's it! It wasn't hard at all right? This basic set up is OK for testing simple trading ideas. In the next few tutorials, we're going to go through more elaborate management and execution setups!"
}
]
}
@@ -0,0 +1,26 @@
{
"tutorial": "Testing a Trading Idea - The Other Stages",
"pageNumber": 40,
"type": "Tutorial Step - First Backtest!",
"definition": {
"icon": {
"project": "Foundations",
"name": "backtesting-session"
},
"text": "Now that we have the basic definitions in all stages, we may do a first backtest!"
},
"paragraphs": [
{
"style": "Text",
"text": "We'll be using the same parameters we ended up with at the end of the previous tutorial. Feel free to go and check!"
},
{
"style": "Callout",
"text": "Start the task for BB Breakdown 2 and start the corresponding backtesting session too!"
},
{
"style": "Note",
"text": "I'm assuming you have the data we mined during the previous tutorial! If you don't this is unlikely to work!"
}
]
}
@@ -0,0 +1,35 @@
{
"tutorial": "Testing a Trading Idea - The Other Stages",
"pageNumber": 41,
"type": "Tutorial Step - Ready to Rock....?",
"definition": {
"icon": {
"project": "Foundations",
"name": "trading-strategy"
},
"text": "We are on a new chart! Let's set it up so that we may see the results of the backtest!"
},
"paragraphs": [
{
"style": "Text",
"text": "Make sure the following layers are turned on in each of the layer managers:"
},
{
"style": "List",
"text": "Masters Data: Candles and Bollinger Bands."
},
{
"style": "List",
"text": "Simulation Objects:Strategies, Market Buy Orders,Market Sell Orders,Position Base Asset,Stop Loss, and Take Profit.",
"updated": 1610473284506
},
{
"style": "List",
"text": "Trading System: Trading System Errors and Trading System Warnings."
},
{
"style": "Success",
"text": "The next step shows what you should see!"
}
]
}
@@ -0,0 +1,43 @@
{
"tutorial": "Testing a Trading Idea - The Other Stages",
"pageNumber": 42,
"type": "Tutorial Step - Ready to Rock....?",
"definition": {
"icon": {
"project": "Foundations",
"name": "trading-strategy"
},
"text": "We are on a new chart! Let's set it up so that we may see the results of the backtest!"
},
"paragraphs": [
{
"style": "Text",
"text": "Turn on the following layers in each of the layer managers (fell free to close all plotter panels):",
"updated": 1622549690952
},
{
"style": "List",
"text": "Candles Data: \"Candles\".",
"updated": 1622549387433
},
{
"style": "List",
"text": "Bollinger Data: \"Bollinger Bands\".",
"updated": 1622549394686
},
{
"style": "List",
"text": "Simulation Objects: \"Strategies\", \"Market Buy Orders\", \"Market Sell Orders\", \"Position Base Asset\", \"Stop Loss\", and \"Take Profit\".",
"updated": 1622549420151
},
{
"style": "List",
"text": "Trading System: \"Trading System Errors\" and \"Trading System Warnings\".",
"updated": 1622549431740
},
{
"style": "Success",
"text": "The next step shows what you should see!"
}
]
}
@@ -0,0 +1,14 @@
{
"tutorial": "Testing a Trading Idea - The Other Stages",
"pageNumber": 43,
"type": "Tutorial Step - Trading Systems Position",
"definition": {
"text": "This step will play a video in full screen mode."
},
"paragraphs": [
{
"style": "Gif",
"text": "GIFs/Foundations/Tutorials/trading-systems-position.gif"
}
]
}
@@ -0,0 +1,26 @@
{
"tutorial": "Testing a Trading Idea - The Other Stages",
"pageNumber": 44,
"type": "Tutorial Step - The First Position",
"definition": {
"icon": {
"project": "Foundations",
"name": "layer"
},
"text": "Remember the Feb 28th case we analyzed in the previous tutorial? This is it! This is the position we got from the rules defined!"
},
"paragraphs": [
{
"style": "Text",
"text": "Take a moment to study what the simulation object layers show!"
},
{
"style": "Callout",
"text": "Let's turn on a few more Simulation Object layers: Trigger, Open, Manage, and Close Stages!"
},
{
"style": "Text",
"text": "We can now see the four stages in action. Take a minute to read and interpret the graphics. Try to follow the timeline implicit in the drawings of the stages. See when and why each stage opens and closes..."
}
]
}
@@ -0,0 +1,27 @@
{
"tutorial": "Testing a Trading Idea - The Other Stages",
"pageNumber": 45,
"type": "Tutorial Step - Chronology of a Position",
"definition": {
"icon": {
"project": "Foundations",
"name": "position"
},
"text": "Let's take a few minutes to dissect this position, looking particularly into what makes each stage tick..."
},
"paragraphs": [
{
"style": "List",
"text": "Trigger Stage: Opens on Feb 27th at 0 hs because the 24H Bollinger SubChannel turned Down and not Side. Go check if that is the case! The stage closes on Feb 28th at 9 hs, after the second breakdown triggers the Take Position Event.",
"updated": 1622549831232
},
{
"style": "List",
"text": "Open Stage: Opens when the trigger stage closes, and closes one hour later (!?) after the market sell order is placed."
},
{
"style": "Note",
"text": "One hour later? Yes! Remember we are running the simulation on the 1H time frame! We'll discuss this matter in depth later on!"
}
]
}
@@ -0,0 +1,26 @@
{
"tutorial": "Testing a Trading Idea - The Other Stages",
"pageNumber": 46,
"type": "Tutorial Step - Manage and Close",
"definition": {
"icon": {
"project": "Foundations",
"name": "position"
},
"text": "Those were the trigger and open stages. Let's look into the manage and close stages!"
},
"paragraphs": [
{
"style": "List",
"text": "Manage Stage: Opens together with the open stage, and remains open while the price bounces around below the stop loss and above the take position target. When the 22 hs candle on Mar 2nd tags the stop loss target, the manage stage closes."
},
{
"style": "List",
"text": "Close Stage: Opens after the tagging of the stop loss, and closes one hour later (!?) after placing the market buy order!"
},
{
"style": "Note",
"text": "The one hour later mystery again... Take a minute to reflect on this behavior."
}
]
}
@@ -0,0 +1,22 @@
{
"tutorial": "Testing a Trading Idea - The Other Stages",
"pageNumber": 47,
"type": "Tutorial Step - Time Frame Matters!",
"definition": {
"icon": {
"project": "Foundations",
"name": "time-frame"
},
"text": "The Time Frame of the trading session determines how often the trading bot does what it does!"
},
"paragraphs": [
{
"style": "Callout",
"text": "Read this page about the time frame carefully!"
},
{
"style": "Note",
"text": "In one of the next tutorials, I'll teach you a trick to overcome this one negative aspect of running backtesting sessions on a time frame different than live sessions."
}
]
}
@@ -0,0 +1,30 @@
{
"tutorial": "Testing a Trading Idea - The Other Stages",
"pageNumber": 48,
"type": "Tutorial Step - Warning!",
"definition": {
"icon": {
"project": "Foundations",
"name": "bullet-warning"
},
"text": "I see three warning signs on Feb 28th at the 9 hs candle. We should take a look and see what the warnings are about!",
"updated": 1612712860187
},
"paragraphs": [
{
"style": "Text",
"text": "Like with errors, the number and size of bullets indicate the sequence in which warnings where recorded!",
"updated": 1612713206057
},
{
"style": "Callout",
"text": "Touch the first warning bullet with your mouse, the bigger one, on Feb 28th at 10 hs...",
"updated": 1622557759526
},
{
"style": "Success",
"text": "Warnings are created every time the trading bot makes adjustments to information that would otherwise not be obvious. It's like a verbose mode that the bot uses to leave a trace of its actions.",
"updated": 1612713241626
}
]
}
@@ -0,0 +1,25 @@
{
"tutorial": "Testing a Trading Idea - The Other Stages",
"pageNumber": 49,
"type": "Tutorial Step - Confusing?",
"definition": {
"icon": {
"project": "Foundations",
"name": "bullet-warning"
},
"text": "Don't worry! You'll get used to this level of feedback from the LF Trading Bot, and will certainly get to appreciate it!",
"updated": 1612715858929
},
"paragraphs": [
{
"style": "Text",
"text": "With this level of feedback, you won't ever need to dive into obscure log files or bang your head against the wall trying to figure out what the bot is doing, or why things don't happen as you would expect.",
"updated": 1612715954517
},
{
"style": "Note",
"text": "Intuitions about what the Trading Bot should or should not do are often simplistic. It took deep analysis and several iterations to get the bot to handle orders consistently in the myriads of situations that may emerge while trading.",
"updated": 1612716228900
}
]
}
@@ -0,0 +1,29 @@
{
"tutorial": "Testing a Trading Idea - The Other Stages",
"pageNumber": 50,
"type": "Tutorial Step - Slippage",
"definition": {
"icon": {
"project": "Foundations",
"name": "slippage"
},
"text": "This is the Market Sell Order #1 structure of nodes we referenced from the market sell order in the trading system.",
"updated": 1612714983003
},
"paragraphs": [
{
"style": "Text",
"text": "This is the structure of nodes that keeps track of all the variables associated with that order, remember?"
},
{
"style": "Callout",
"text": "Check the warning on the Rate node!",
"updated": 1612715013397
},
{
"style": "Note",
"text": "The slippage configured as a parameter of the trading session was subtracted from the order rate. This resulted in a lower actual rate. All good! The same message appears on the Slippage parameter of the trading session too... check it out!",
"updated": 1612715035149
}
]
}
@@ -0,0 +1,28 @@
{
"tutorial": "Testing a Trading Idea - The Other Stages",
"pageNumber": 51,
"type": "Tutorial Step - Actual Size",
"definition": {
"icon": {
"project": "Foundations",
"name": "actual-size"
},
"text": "What happens if the actual rate of the order is different than the rate established as a target? Time for the bot to do some calculations!",
"updated": 1612715192513
},
"paragraphs": [
{
"style": "Text",
"text": "When the trading bot adjusts a variable in an order, there's a ripple effect of further adjustments."
},
{
"style": "Callout",
"text": "Hover the mouse over the second warning on Feb 28th and read!",
"updated": 1622557906751
},
{
"style": "Note",
"text": "For the open stage, we defined the target size in the base asset. However, the system must keep track of variables in both assets! Because the order rate was adjusted, the size of the order in the quoted asset must be adjusted too!"
}
]
}
@@ -0,0 +1,23 @@
{
"tutorial": "Testing a Trading Idea - The Other Stages",
"pageNumber": 52,
"type": "Tutorial Step - Size Placed",
"definition": {
"icon": {
"project": "Foundations",
"name": "size-placed"
},
"text": "This is the Stage Quoted Asset bit of the Strategy Open Stage. If the actual size changes, what happens with the Size Placed?"
},
"paragraphs": [
{
"style": "Callout",
"text": "Touch the third error on Feb 28th and read!",
"updated": 1622557953891
},
{
"style": "Note",
"text": "In the context of either the open stage or the close stage, size placed is a variable that accumulates the total size placed during the stage, so it must be adjusted to!"
}
]
}
@@ -0,0 +1,28 @@
{
"tutorial": "Testing a Trading Idea - The Other Stages",
"pageNumber": 53,
"type": "Tutorial Step - Order Management",
"definition": {
"icon": {
"project": "Foundations",
"name": "trading-bot-instance"
},
"text": "Most warnings happen when the trading bot is handling orders, syncing with the exchange, or simulating the synchronization."
},
"paragraphs": [
{
"style": "Text",
"text": "Those operations feature great depth and some intricacy, which we'll cover in future tutorials. In this one, we're just scratching the surface!"
},
{
"style": "Callout",
"text": "If you wish to get to the bone on this matter, you should read the twelve pages on the Order Management topic of the Documentation.",
"updated": 1612715667430
},
{
"style": "Success",
"text": "You don't need to read it now, but feel free to dive into it if so you wish! ",
"updated": 1612715638597
}
]
}
@@ -0,0 +1,26 @@
{
"tutorial": "Testing a Trading Idea - The Other Stages",
"pageNumber": 54,
"type": "Tutorial Step - Back to the Position!",
"definition": {
"icon": {
"project": "Foundations",
"name": "fails"
},
"text": "Back to this first trade, we discussed how stages work and mentioned that the price tagged the stop loss target."
},
"paragraphs": [
{
"style": "Callout",
"text": "That means that this first position is a fail!"
},
{
"style": "Text",
"text": "To be fair, the trade went in our favor up to about 3%, but we didn't take profit and let it slip through our fingers. The entry wasn't awful and it may make sense once we start thinking about position management."
},
{
"style": "Success",
"text": "Let's take a little tour along the period tested and make a quick assessment of the rest of the positions taken!"
}
]
}
@@ -0,0 +1,26 @@
{
"tutorial": "Testing a Trading Idea - The Other Stages",
"pageNumber": 55,
"type": "Tutorial Step - The Key Moment",
"definition": {
"icon": {
"project": "Foundations",
"name": "hits"
},
"text": "This is the key moment in the period tested. March 2020 saw a clear downtrend that ended with a huge market crash!"
},
"paragraphs": [
{
"style": "Text",
"text": "The good news is that, as we'd seen in the previous tutorial, two good entries anticipated the crash, with the very simple rules we defined. If you ask me, this looks promising, but judge for yourself!"
},
{
"style": "Callout",
"text": "Take some time to fiddle with these positions! Start thinking about how you may manage these trades."
},
{
"style": "Success",
"text": "Once you're done feasting your eyes, we'll take a quick look at the rest of the period tested!"
}
]
}
@@ -0,0 +1,30 @@
{
"tutorial": "Testing a Trading Idea - The Other Stages",
"pageNumber": 56,
"type": "Tutorial Step - March 18th",
"definition": {
"icon": {
"project": "Foundations",
"name": "fails"
},
"text": "This position is a new fail, happening on March 18th, just a few days after one of the major market-crashes in recent history."
},
"paragraphs": [
{
"style": "Text",
"text": "What can we say about this entry?"
},
{
"style": "Callout",
"text": "Go to the 24H time frame and take a look at the overall context!"
},
{
"style": "Text",
"text": "What I see is a situation of extreme volatility amid a historic pandemic-induced global economic crash."
},
{
"style": "Success",
"text": "Maybe we shouldn't be trading in such conditions?! It certainly seems risky!"
}
]
}
@@ -0,0 +1,26 @@
{
"tutorial": "Testing a Trading Idea - The Other Stages",
"pageNumber": 57,
"type": "Tutorial Step - March 28th - April 1st",
"definition": {
"icon": {
"project": "Foundations",
"name": "fails"
},
"text": "We've got two more fails by the end of March and the beginning of April. What can we say about these?"
},
"paragraphs": [
{
"style": "Text",
"text": "The first position on the 28th seems like a decent entry, despite not reaching the 10% target. It did stay in profit for a while, and got to about 7% on March 30th at 0 hs. The second position is a clear fail!"
},
{
"style": "Callout",
"text": "Go check the context in the 24H time frame! What do you think?"
},
{
"style": "Note",
"text": "To me, it looks like a reasonable context to go short, but what do I know?!"
}
]
}
@@ -0,0 +1,26 @@
{
"tutorial": "Testing a Trading Idea - The Other Stages",
"pageNumber": 58,
"type": "Tutorial Step - Sep 5th - Sep 14th",
"definition": {
"icon": {
"project": "Foundations",
"name": "fails"
},
"text": "These are the last few trades in the period tested, and all three of them are clear fails."
},
"paragraphs": [
{
"style": "Callout",
"text": "Time to check the context in the 24H time frame!"
},
{
"style": "Note",
"text": "To me, it looks unclear whether the context is suitable for a swing short or not!"
},
{
"style": "Success",
"text": "So, what do we make of this first test? Let's compare the results with the hypothesis' predictions."
}
]
}
@@ -0,0 +1,26 @@
{
"tutorial": "Testing a Trading Idea - The Other Stages",
"pageNumber": 59,
"type": "Tutorial Step - The Prediction Game",
"definition": {
"icon": {
"project": "Foundations",
"name": "hit-ratio"
},
"text": "We expect the idea to trade at least twice per month, with a 50% hit ratio. That was our prediction! How did we do?"
},
"paragraphs": [
{
"style": "List",
"text": "Trading frequency: There were less than two months' worth of downtrends in the tested period and a total of 9 trades. In terms of trading frequency, the idea passed the test."
},
{
"style": "List",
"text": "Hit ratio: We've got 9 trades in total, with 2 hits and 7 fails, strictly speaking. That's a 22% hit ratio. In strict terms, the idea failed the test."
},
{
"style": "Callout",
"text": "Is there room for nuance in our analysis? Should we look past the hard numbers?"
}
]
}
@@ -0,0 +1,23 @@
{
"tutorial": "Testing a Trading Idea - The Other Stages",
"pageNumber": 60,
"type": "Tutorial Step - Is There Room For Nuance?",
"definition": {
"icon": {
"project": "Foundations",
"name": "space-style"
},
"text": "Should the testing of a trading idea output black or white results? That's a good question... one that only you may answer!"
},
"paragraphs": [
{
"style": "List",
"text": "Is your testing criteria rock-solid? If you trust the testing criteria and are confident the prediction must be fulfilled for the idea to be worth it, then you should probably stick to the hard numbers."
},
{
"style": "List",
"text": "Is your testing criteria more like a guideline or first assessment? In our case, I may openly confess that the testing criteria proposed is rather arbitrary, and doesn't hold water if questioned. I chose a simple criteria to make a point and facilitate the explanations, but I wouldn't defend it in a court of my peers! If you see the testing criteria as a first assessment only, then there should probably be room for a more nuanced analysis.",
"updated": 1610473653651
}
]
}
@@ -0,0 +1,26 @@
{
"tutorial": "Testing a Trading Idea - The Other Stages",
"pageNumber": 61,
"type": "Tutorial Step - What is the Nuance?",
"definition": {
"icon": {
"project": "Foundations",
"name": "space-style"
},
"text": "Let's attempt a more nuanced analysis using the elements observed during our tour of the tested period."
},
"paragraphs": [
{
"style": "List",
"text": "Potential hits: Two out of the seven fails could have been hits, or at least breakeven trades had we managed the trade and exited earlier, either via a trailing stop loss, partial profit-taking, or any other suitable risk-management strategy."
},
{
"style": "List",
"text": "Halt trading: One of the fails was likely to be avoidable had we incorporated a basic volatility envelope in the take position event conditions."
},
{
"style": "Note",
"text": "That would leave us with 4 fails, maybe one break-even, and 3 hits with a potential for 100% profit. Does that nuance work for you?"
}
]
}
@@ -0,0 +1,22 @@
{
"tutorial": "Testing a Trading Idea - The Other Stages",
"pageNumber": 62,
"type": "Tutorial Step - What's Next....?",
"definition": {
"icon": {
"project": "Foundations",
"name": "tutorial"
},
"text": "In the next tutorial, we'll keep working on this idea, incorporating a few more fundamental considerations left out until now."
},
"paragraphs": [
{
"style": "Text",
"text": "We are also going to test the idea in a more favorable environment, that is, a real bear market, so that we may better evaluate it's potential."
},
{
"style": "Success",
"text": "At this point, you have covered the very basics of building and testing strategies. While more tutorials will become available eventually, nothing stops you from pushing the envelope and keep learning on your own! The documentation is your friend, and covers the workings of Superalgos at a depth that tutorials can't reach!"
}
]
}
@@ -0,0 +1,37 @@
{
"tutorial": "Testing a Trading Idea - The Other Stages",
"pageNumber": 63,
"type": "Tutorial Step - In The Mean Time!",
"definition": {
"icon": {
"project": "Foundations",
"name": "scripts-library"
},
"text": "If you are willing to keep going on your own, mastering building strategies requires some reading and a lot of practice!"
},
"paragraphs": [
{
"style": "Text",
"text": "Continue your education by reading the following sections of the documentation:"
},
{
"style": "List",
"text": "The nuances of stages of Trading Strategies.",
"updated": 1610465367806
},
{
"style": "List",
"text": "The whole Trading Engine section.",
"updated": 1610465391868
},
{
"style": "List",
"text": "The whole topic on the Overview of the Management Issue.",
"updated": 1612723291316
},
{
"style": "Success",
"text": "You may keep developing what we started on this series, or go your own way and start implementing your own idea! Good luck, and see you on the next tutorial!"
}
]
}
@@ -0,0 +1,24 @@
{
"tutorial": "Testing a Trading Idea - The Trigger Stage",
"pageNumber": 1,
"type": "Testing a Trading Idea - The Trigger Stage Tutorial",
"definition": {
"text": "This tutorial walks you through the implementation of the trading idea defined in the previous tutorial, covering the definitions of the Trigger Stage.",
"updated": 1617118397821
},
"paragraphs": [
{
"style": "Title",
"text": "About This Tutorial",
"updated": 1617118440328
},
{
"style": "List",
"text": "Workspace: Trading System Design Tutorials."
},
{
"style": "List",
"text": "Maintainer: @julianmolina (Telegram)."
}
]
}
@@ -0,0 +1,26 @@
{
"tutorial": "Testing a Trading Idea - The Trigger Stage",
"pageNumber": 2,
"type": "Tutorial - Testing a Trading Idea",
"definition": {
"icon": {
"project": "Foundations",
"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,39 @@
{
"tutorial": "Testing a Trading Idea - The Trigger Stage",
"pageNumber": 3,
"type": "Tutorial Step - The Pipeline",
"definition": {
"icon": {
"project": "Foundations",
"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).",
"updated": 1610382946451
},
{
"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": "Testing a Trading Idea - The Trigger Stage",
"pageNumber": 4,
"type": "Tutorial Step - Do You Have The Data?",
"definition": {
"icon": {
"project": "Foundations",
"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,23 @@
{
"tutorial": "Testing a Trading Idea - The Trigger Stage",
"pageNumber": 5,
"type": "Tutorial Step - Let's Mine Some Data...",
"definition": {
"icon": {
"project": "Foundations",
"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!",
"updated": 1622462310245
},
{
"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": "Testing a Trading Idea - The Trigger Stage",
"pageNumber": 6,
"type": "Tutorial Step - Let's Start With the Basics!",
"definition": {
"icon": {
"project": "Foundations",
"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": "Testing a Trading Idea - The Trigger Stage",
"pageNumber": 7,
"type": "Tutorial Step - Trading Systems",
"definition": {
"icon": {
"project": "Foundations",
"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": "Testing a Trading Idea - The Trigger Stage",
"pageNumber": 8,
"type": "Tutorial Step - Right Out of the Box!",
"definition": {
"icon": {
"project": "Foundations",
"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": "Testing a Trading Idea - The Trigger Stage",
"pageNumber": 9,
"type": "Tutorial Step - Why Downtrends?",
"definition": {
"icon": {
"project": "Foundations",
"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,35 @@
{
"tutorial": "Testing a Trading Idea - The Trigger Stage",
"pageNumber": 10,
"type": "Tutorial Step - Trigger Stage Events",
"definition": {
"icon": {
"project": "Foundations",
"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! If you've read this page before, a refresher wouldn't hurt!",
"updated": 1617190236835
}
]
}
@@ -0,0 +1,28 @@
{
"tutorial": "Testing a Trading Idea - The Trigger Stage",
"pageNumber": 11,
"type": "Tutorial Step - Trigger On Event",
"definition": {
"icon": {
"project": "Foundations",
"name": "trigger-on-event"
},
"text": "The Trigger On Event defines the market Situation in which the Trading Strategy shall be triggered.",
"updated": 1617190348439
},
"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!",
"updated": 1617190335600
},
{
"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": "Testing a Trading Idea - The Trigger Stage",
"pageNumber": 12,
"type": "Tutorial Step - Situations, Conditions, and Formulas in Superalgos",
"definition": {
"icon": {
"project": "Foundations",
"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,27 @@
{
"tutorial": "Testing a Trading Idea - The Trigger Stage",
"pageNumber": 13,
"type": "Tutorial Step - Remember the Context?",
"definition": {
"icon": {
"project": "Foundations",
"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 ?",
"updated": 1617190454094
},
"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,27 @@
{
"tutorial": "Testing a Trading Idea - The Trigger Stage",
"pageNumber": 14,
"type": "Tutorial Step - Let's Study the Syntax!",
"definition": {
"icon": {
"project": "Foundations",
"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 this tutorial series!",
"updated": 1617190556168
}
]
}
@@ -0,0 +1,31 @@
{
"tutorial": "Testing a Trading Idea - The Trigger Stage",
"pageNumber": 15,
"type": "Tutorial Step - Reinforce The Learning!",
"definition": {
"icon": {
"project": "Foundations",
"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 in camel case, that is, altogether, with the first word in lowercase and the rest of the words capitalized! (forExampleLikeThis)",
"updated": 1610384140775
}
]
}
@@ -0,0 +1,26 @@
{
"tutorial": "Testing a Trading Idea - The Trigger Stage",
"pageNumber": 16,
"type": "Tutorial Step - We Need Data",
"definition": {
"icon": {
"project": "Foundations",
"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,27 @@
{
"tutorial": "Testing a Trading Idea - The Trigger Stage",
"pageNumber": 17,
"type": "Tutorial Step - Time to Work the Charts!",
"definition": {
"icon": {
"project": "Foundations",
"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 do we go about this?",
"updated": 1622480137957
},
{
"style": "Text",
"text": "We'll work on something around the Bollinger Bands, as you may imagine!"
}
]
}
@@ -0,0 +1,27 @@
{
"tutorial": "Testing a Trading Idea - The Trigger Stage",
"pageNumber": 18,
"type": "Tutorial Step - Determining the Trend",
"definition": {
"icon": {
"project": "Foundations",
"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 Bollinger Data Layer Manager and turn on the \"Bollinger Channels Objects\" Layer!",
"updated": 1622480213561
},
{
"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": "Testing a Trading Idea - The Trigger Stage",
"pageNumber": 19,
"type": "Tutorial Step - Is That Good Enough?",
"definition": {
"icon": {
"project": "Foundations",
"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": "Testing a Trading Idea - The Trigger Stage",
"pageNumber": 20,
"type": "Tutorial Step - An Extra Dimension!",
"definition": {
"icon": {
"project": "Foundations",
"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": "Testing a Trading Idea - The Trigger Stage",
"pageNumber": 21,
"type": "Tutorial Step - Bollinger Subchannels",
"definition": {
"icon": {
"project": "Foundations",
"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": "Testing a Trading Idea - The Trigger Stage",
"pageNumber": 22,
"type": "Tutorial Step - Products & Properties",
"definition": {
"icon": {
"project": "Foundations",
"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": "Testing a Trading Idea - The Trigger Stage",
"pageNumber": 23,
"type": "Tutorial Step - Let's Check Those Slopes",
"definition": {
"icon": {
"project": "Foundations",
"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,32 @@
{
"tutorial": "Testing a Trading Idea - The Trigger Stage",
"pageNumber": 24,
"type": "Tutorial Step - We Have Our Conditions!",
"definition": {
"icon": {
"project": "Foundations",
"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:",
"updated": 1610392891777
},
{
"style": "Javascript",
"text": "chart.at24hs.bollingerSubChannel.direction === 'Down'"
},
{
"style": "List",
"text": "Condition 2: The slope property of the bollingerSubChannel product is not Side in the 24H chart. Put in proper syntax:",
"updated": 1610392964616
},
{
"style": "Javascript",
"text": "chart.at24hs.bollingerSubChannel.slope != 'Side'"
}
]
}
@@ -0,0 +1,31 @@
{
"tutorial": "Testing a Trading Idea - The Trigger Stage",
"pageNumber": 25,
"type": "Tutorial Step - Set Up the First Condition!",
"definition": {
"icon": {
"project": "Foundations",
"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:",
"updated": 1610469943553
},
{
"style": "Javascript",
"text": "chart.at24hs.bollingerSubChannel.direction === 'Down'"
},
{
"style": "Text",
"text": "Label the condition node 24H Down to have a quick reference of what the condition is about."
}
]
}
@@ -0,0 +1,27 @@
{
"tutorial": "Testing a Trading Idea - The Trigger Stage",
"pageNumber": 26,
"type": "Tutorial Step - Now the Second Condition!",
"definition": {
"icon": {
"project": "Foundations",
"name": "javascript-code"
},
"text": "Select Add Condition on the situation's menu and paste the code in the Javascript Code node!"
},
"paragraphs": [
{
"style": "Javascript",
"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. I'll tell you why that is not a good idea in the next step!",
"updated": 1610470019656
}
]
}
@@ -0,0 +1,30 @@
{
"tutorial": "Testing a Trading Idea - The Trigger Stage",
"pageNumber": 27,
"type": "Tutorial Step - Never Forget Granularity!",
"definition": {
"icon": {
"project": "Foundations",
"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,33 @@
{
"tutorial": "Testing a Trading Idea - The Trigger Stage",
"pageNumber": 28,
"type": "Tutorial Step - Trigger Off Event",
"definition": {
"icon": {
"project": "Foundations",
"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": "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! Find conditions 1 and 2 below:",
"updated": 1610470163153
},
{
"style": "Javascript",
"text": "chart.at24hs.bollingerSubChannel.direction === 'Up'",
"updated": 1610470169627
},
{
"style": "Javascript",
"text": "chart.at24hs.bollingerSubChannel.slope === 'Side'",
"updated": 1610470175519
},
{
"style": "Text",
"text": "We should trigger off the stategy when either of these conditions validate true. How?"
}
]
}
@@ -0,0 +1,27 @@
{
"tutorial": "Testing a Trading Idea - The Trigger Stage",
"pageNumber": 29,
"type": "Tutorial Step - The Workings of Situations",
"definition": {
"icon": {
"project": "Foundations",
"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": "Success",
"text": "Can you tell how to set up this definition?",
"updated": 1610445299181
}
]
}
@@ -0,0 +1,33 @@
{
"tutorial": "Testing a Trading Idea - The Trigger Stage",
"pageNumber": 30,
"type": "Tutorial Step - Separate Situations!",
"definition": {
"icon": {
"project": "Foundations",
"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 condition in separate situation!",
"updated": 1610470622189
},
{
"style": "Callout",
"text": "Set up the first condition in the existing situation, and the second condition in a new situation (add a Situation using the menu of the Trigger Off Event).",
"updated": 1617190943631
},
{
"style": "Javascript",
"text": "chart.at24hs.bollingerSubChannel.direction === 'Up'",
"updated": 1610470580629
},
{
"style": "Javascript",
"text": "chart.at24hs.bollingerSubChannel.slope === 'Side'"
}
]
}
@@ -0,0 +1,26 @@
{
"tutorial": "Testing a Trading Idea - The Trigger Stage",
"pageNumber": 31,
"type": "Tutorial Step - Keep the Definitions Tidy!",
"definition": {
"icon": {
"project": "Foundations",
"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": "Testing a Trading Idea - The Trigger Stage",
"pageNumber": 32,
"type": "Tutorial Step - First Backtest...",
"definition": {
"icon": {
"project": "Foundations",
"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": "Testing a Trading Idea - The Trigger Stage",
"pageNumber": 33,
"type": "Tutorial Step - A Bit About Backtesting!",
"definition": {
"icon": {
"project": "Foundations",
"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,27 @@
{
"tutorial": "Testing a Trading Idea - The Trigger Stage",
"pageNumber": 34,
"type": "Tutorial Step - Let's Do This...",
"definition": {
"icon": {
"project": "Foundations",
"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 BB Breakdown Task menu and then select Run on the Backtesting Session menu.",
"updated": 1617191181250
},
{
"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,23 @@
{
"tutorial": "Testing a Trading Idea - The Trigger Stage",
"pageNumber": 35,
"type": "Tutorial Step - Let's See What We've Got!",
"definition": {
"icon": {
"project": "Foundations",
"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.",
"updated": 1622487006173
},
{
"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,14 @@
{
"tutorial": "Testing a Trading Idea - The Trigger Stage",
"pageNumber": 36,
"type": "Tutorial Step - Trading Systems Trigger Stage Test",
"definition": {
"text": "This step will play a video in full screen mode."
},
"paragraphs": [
{
"style": "Gif",
"text": "GIFs/Foundations/Tutorials/trading-systems-trigger-stage-test.gif"
}
]
}
@@ -0,0 +1,40 @@
{
"tutorial": "Testing a Trading Idea - The Trigger Stage",
"pageNumber": 37,
"type": "Tutorial Step - Can't See What's Expected?",
"definition": {
"icon": {
"project": "Foundations",
"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?",
"updated": 1622487112241
},
{
"style": "List",
"text": "Did you use two situations in the Trigger Off Event ?",
"updated": 1622488179340
},
{
"style": "Success",
"text": "Go backwards in the tutorial, step by step, and make sure you didn't skip any steps!"
}
]
}
Loaded 100 of 3557 files, more files were not shown because too many files have changed in this diff. Show more