Merge Develop into Master
This commit is contained in:
1 parent
2d7ed1d085
commit
2bb78c50fb
4223 files changed
+1207152
-16544
No files matched your search
+54
@@ -0,0 +1,54 @@
|
||||
{
|
||||
"topic": "Debugging Your Indicator",
|
||||
"pageNumber": 1,
|
||||
"type": "Debugging - Download and Install Visual Studio Code",
|
||||
"definition": {
|
||||
"text": "This process details how to use an Integrated Development Environment (IDE) to identify and fix bugs in the Superalgos code and help contribute! ",
|
||||
"updated": 1623400412309
|
||||
},
|
||||
"paragraphs": [
|
||||
{
|
||||
"style": "Note",
|
||||
"text": "For the following steps, we are going to show the concept of debugging using Visual Studio Code. You may use any other Integrated Development Environment (IDE) that you feel comfortable with. ",
|
||||
"updated": 1623400449204
|
||||
},
|
||||
{
|
||||
"style": "Subtitle",
|
||||
"text": "<hr>",
|
||||
"updated": 1614264382973
|
||||
},
|
||||
{
|
||||
"style": "Subtitle",
|
||||
"text": "\"Our greatest weakness lies in giving up. The most certain way to succeed is always to try just one more time.\" -Thomas Edison"
|
||||
},
|
||||
{
|
||||
"style": "Subtitle",
|
||||
"text": "<hr>"
|
||||
},
|
||||
{
|
||||
"style": "Text",
|
||||
"text": "So, you've run into issues creating an indicator, seen an error in the console or have encountered a Task that just won't run. Grab some coffee and mosquito repellent - we're going bug hunting!",
|
||||
"updated": 1623400585649
|
||||
},
|
||||
{
|
||||
"style": "Text",
|
||||
"text": "The first step is to download Microsoft Visual Studio Code, this is available for free at the link below:",
|
||||
"updated": 1623401539321
|
||||
},
|
||||
{
|
||||
"style": "Link",
|
||||
"text": "Download Microsoft Visual Studio Code->code.visualstudio.com/download",
|
||||
"updated": 1623401422825
|
||||
},
|
||||
{
|
||||
"style": "Png",
|
||||
"text": "PNGs/Foundations/Docs/debugging-your-indicator/0_download-visual-studio.png",
|
||||
"updated": 1623414213827
|
||||
},
|
||||
{
|
||||
"style": "Text",
|
||||
"text": "After you've installed Visual Studio Code, click Next to go through the process of configuring it so that you can access the Superalgos directory.",
|
||||
"updated": 1623407789702
|
||||
}
|
||||
]
|
||||
}
|
||||
+119
@@ -0,0 +1,119 @@
|
||||
{
|
||||
"topic": "Debugging Your Indicator",
|
||||
"pageNumber": 2,
|
||||
"type": "Debugging - Setting up your IDE",
|
||||
"definition": {
|
||||
"text": "The first step is to set up Visual Studio Code so that it has access to the Superalgos directory and that it knows what file to run, attach to and monitor for debugging.",
|
||||
"updated": 1623402147604,
|
||||
"translations": [
|
||||
{
|
||||
"language": "CN",
|
||||
"text": "Toggling Breakpoints is telling the the program where to slow down - Where we'd like to take control.",
|
||||
"updated": 1614338778954,
|
||||
"style": "Definition"
|
||||
}
|
||||
]
|
||||
},
|
||||
"paragraphs": [
|
||||
{
|
||||
"style": "Title",
|
||||
"text": "Overview",
|
||||
"updated": 1623402158529
|
||||
},
|
||||
{
|
||||
"style": "Text",
|
||||
"text": "Superalgos has three core components, the Client, TS and the UI.",
|
||||
"updated": 1623402455917
|
||||
},
|
||||
{
|
||||
"style": "Success",
|
||||
"text": "Hover over (or click) each word above above to learn more regarding each component.",
|
||||
"updated": 1623402349861
|
||||
},
|
||||
{
|
||||
"style": "Text",
|
||||
"text": "For debugging purposes we already want to have the Client and UI running. This process details how to set up Visual Studio Code to run a debug instance of the TS.",
|
||||
"updated": 1623404705493
|
||||
},
|
||||
{
|
||||
"style": "Text",
|
||||
"text": "First we need to set up our Visual Studio Code workspace so we can see the Superalgos directory.",
|
||||
"updated": 1623404725437
|
||||
},
|
||||
{
|
||||
"style": "Title",
|
||||
"text": "Configuring Visual Studio Code",
|
||||
"updated": 1623402750807
|
||||
},
|
||||
{
|
||||
"style": "Text",
|
||||
"text": "Start up Visual Studio Code and click on the Explorer icon to open the Explorer left hand panel."
|
||||
},
|
||||
{
|
||||
"style": "Png",
|
||||
"text": "PNGs/Foundations/Docs/debugging-your-indicator/1_open-explorer.png",
|
||||
"updated": 1623407107099
|
||||
},
|
||||
{
|
||||
"style": "Text",
|
||||
"text": "As we are just running the TS in debug mode, we start with the \"TaskServer\" folder.",
|
||||
"updated": 1623404758089
|
||||
},
|
||||
{
|
||||
"style": "Text",
|
||||
"text": "Click on the Add Folder button and open the \"TaskServer\" folder (../Superalgos/TaskServer) to add this to your Visual Studio Code workspace."
|
||||
},
|
||||
{
|
||||
"style": "Png",
|
||||
"text": "PNGs/Foundations/Docs/debugging-your-indicator/2_open-folder.png",
|
||||
"updated": 1623407112534
|
||||
},
|
||||
{
|
||||
"style": "Png",
|
||||
"text": "PNGs/Foundations/Docs/debugging-your-indicator/3_taskserver-folder.png",
|
||||
"updated": 1623407118113
|
||||
},
|
||||
{
|
||||
"style": "Text",
|
||||
"text": "Next we add the \"Projects\" folder so that we can analyse the rest of the Superalgos files.",
|
||||
"updated": 1623405000959
|
||||
},
|
||||
{
|
||||
"style": "Text",
|
||||
"text": "Right-click in the empty space of the Explorer left-hand panel and click on Add Folder to Workspace and also add the \"Projects\" (../Superalgos/Projects) folder to your workspace."
|
||||
},
|
||||
{
|
||||
"style": "Png",
|
||||
"text": "PNGs/Foundations/Docs/debugging-your-indicator/4_add-folder.png",
|
||||
"updated": 1623407412773
|
||||
},
|
||||
{
|
||||
"style": "Png",
|
||||
"text": "PNGs/Foundations/Docs/debugging-your-indicator/5_projects-folder.png",
|
||||
"updated": 1623407419399
|
||||
},
|
||||
{
|
||||
"style": "Text",
|
||||
"text": "The Explorer left-hand panel should now have the two folders \"TaskServer\" and \"Projects\" like below.",
|
||||
"updated": 1623408055408
|
||||
},
|
||||
{
|
||||
"style": "Png",
|
||||
"text": "PNGs/Foundations/Docs/debugging-your-indicator/6_explorer-folders.png",
|
||||
"updated": 1623408036777
|
||||
},
|
||||
{
|
||||
"style": "Text",
|
||||
"text": "If this matches let's save our Workspace so the next time we open Visual Studio Code this loads automatically. Click on File then Save Workspace As and give it a name.",
|
||||
"updated": 1623408092688
|
||||
},
|
||||
{
|
||||
"style": "Png",
|
||||
"text": "PNGs/Foundations/Docs/debugging-your-indicator/7_save-workspace.png"
|
||||
},
|
||||
{
|
||||
"style": "Text",
|
||||
"text": "Awesome! That's all there is to setting up Visual Studio Code so it can access the Superalgos directory. Next we are going to dive into the code and talk about breakpoints."
|
||||
}
|
||||
]
|
||||
}
|
||||
+65
@@ -0,0 +1,65 @@
|
||||
{
|
||||
"topic": "Debugging Your Indicator",
|
||||
"pageNumber": 3,
|
||||
"type": "Debugging - Setting a Breakpoint",
|
||||
"definition": {
|
||||
"text": "A breakpoint is a user defined place in the code where the debugger will pause and allow you to examine the state of affairs! This means you can analyse the current state of variables and inputs and outputs of functions to help try determine where the cause of a problem might be.",
|
||||
"updated": 1623408792317
|
||||
},
|
||||
"paragraphs": [
|
||||
{
|
||||
"style": "Text",
|
||||
"text": "For this example we are going to be debugging an indicator, therefore we expand into the Projects folder and find the file with the code which builds indicators. In this file we will place a breakpoint.",
|
||||
"updated": 1623405682457
|
||||
},
|
||||
{
|
||||
"style": "Success",
|
||||
"text": "A breakpoint is an intentional stopping or pausing place in a program, put in place for debugging purposes. It's where the code execution pauses and you can check on the status of things!",
|
||||
"updated": 1623405106048
|
||||
},
|
||||
{
|
||||
"style": "Text",
|
||||
"text": ""
|
||||
},
|
||||
{
|
||||
"style": "Text",
|
||||
"text": "Expand the Projects folder and open the file \"SingleMarketFunctions.js\" (..Superalgos/Projects/Superalgos/TS/Function-Libraries/SingleMarketFunctions.js).",
|
||||
"updated": 1623414479019
|
||||
},
|
||||
{
|
||||
"style": "Png",
|
||||
"text": "PNGs/Foundations/Docs/debugging-your-indicator/8_locate-singlemarket-in-tree.png",
|
||||
"updated": 1623409023676
|
||||
},
|
||||
{
|
||||
"style": "Text",
|
||||
"text": "Now we will have to find the line in the code where we'd like the process to pause, and show us what's really happening. This point would be the line that says:",
|
||||
"updated": 1623405827603
|
||||
},
|
||||
{
|
||||
"style": "Javascript",
|
||||
"text": "eval(dataBuildingProcedure.loop.procedureJavascriptCode.code)",
|
||||
"updated": 1623409950310
|
||||
},
|
||||
{
|
||||
"style": "Png",
|
||||
"text": "PNGs/Foundations/Docs/debugging-your-indicator/9_find-line-for-breakpoint.png",
|
||||
"updated": 1623409045497
|
||||
},
|
||||
{
|
||||
"style": "Text",
|
||||
"text": "Click just to the left of the line number, or press F9 to insert a breakpoint at this line.",
|
||||
"updated": 1623405851133
|
||||
},
|
||||
{
|
||||
"style": "Note",
|
||||
"text": "Using \"CTRL+F\" allows us to find what we search for in the code.",
|
||||
"updated": 1614265550399
|
||||
},
|
||||
{
|
||||
"style": "Text",
|
||||
"text": "Now we have a breakpoint configured, we can try running a Task. Click Next to go through the process of how to start the TS and trigger your breakpoint.",
|
||||
"updated": 1623409257540
|
||||
}
|
||||
]
|
||||
}
|
||||
+131
@@ -0,0 +1,131 @@
|
||||
{
|
||||
"topic": "Debugging Your Indicator",
|
||||
"pageNumber": 4,
|
||||
"type": "Debugging - Start Your Processes",
|
||||
"definition": {
|
||||
"text": "Now we have a breakpoint configured we can start the TS in Visual Studio Code. Then in the Superalgos UI we can find a Task and start this using Debug mode.",
|
||||
"updated": 1623409454402,
|
||||
"translations": [
|
||||
{
|
||||
"language": "CN",
|
||||
"text": "Start the Task in Debug mode while running a debug session in your IDE. ",
|
||||
"updated": 1614338791705,
|
||||
"style": "Definition"
|
||||
}
|
||||
]
|
||||
},
|
||||
"paragraphs": [
|
||||
{
|
||||
"style": "Text",
|
||||
"text": "As we covered before there are three core components to Superalgos, the Client, TS and UI. ",
|
||||
"updated": 1623409529218
|
||||
},
|
||||
{
|
||||
"style": "Text",
|
||||
"text": "First, we need to make sure the Client and UI are running. If they are not already running, you can start the UI by going to the terminal, ensuring you are in the Superalgos root directory and enter \"node run\".",
|
||||
"updated": 1623409611552
|
||||
},
|
||||
{
|
||||
"style": "Success",
|
||||
"text": "If the Terminal is not visible click on View -> Terminal and it should appear at the bottom.",
|
||||
"updated": 1623410067613
|
||||
},
|
||||
{
|
||||
"style": "Note",
|
||||
"text": "If needed you can run this with any parameters like \"node run minMemo noBrowser\" as required."
|
||||
},
|
||||
{
|
||||
"style": "Png",
|
||||
"text": "PNGs/Foundations/Docs/debugging-your-indicator/10_node-run.png",
|
||||
"updated": 1623409808656
|
||||
},
|
||||
{
|
||||
"style": "Text",
|
||||
"text": "At this stage you should be able to access Superalgos in the browser using http://localhost:34248/ (or the particular hostname and port you use).",
|
||||
"updated": 1623409750881
|
||||
},
|
||||
{
|
||||
"style": "Text",
|
||||
"text": "Next we are going to start the TS in debug mode. To do this start a Debug Session in Visual Studio Code by clicking \"Run -> Start Debugging\" F5",
|
||||
"updated": 1623410434222
|
||||
},
|
||||
{
|
||||
"style": "Png",
|
||||
"text": "PNGs/Foundations/Docs/debugging-your-indicator/11_start-debugging.png",
|
||||
"updated": 1623409861513
|
||||
},
|
||||
{
|
||||
"style": "Text",
|
||||
"text": "To confirm the TS is running, you can click on the Run and Debug icon which will open a new left-hand panel. In here under the Call Stack you should be able to see the TaskServer running.",
|
||||
"updated": 1623410288365
|
||||
},
|
||||
{
|
||||
"style": "Png",
|
||||
"text": "PNGs/Foundations/Docs/debugging-your-indicator/12_run-and-debug.png"
|
||||
},
|
||||
{
|
||||
"style": "Text",
|
||||
"text": "Now the TS is running we can start a Task via the Debug action.",
|
||||
"updated": 1623410467602
|
||||
},
|
||||
{
|
||||
"style": "Text",
|
||||
"text": "Go to your Network node and find the Data Task for your indicator."
|
||||
},
|
||||
{
|
||||
"style": "Png",
|
||||
"text": "PNGs/Foundations/Docs/debugging-your-indicator/13_network.png",
|
||||
"updated": 1623410476464
|
||||
},
|
||||
{
|
||||
"style": "Text",
|
||||
"text": "Expand the Data Tasks and hover over the Task node for your indicator and click \"Debug\" (the Task will start up, but in Debug mode).",
|
||||
"updated": 1614332581381
|
||||
},
|
||||
{
|
||||
"style": "Important",
|
||||
"text": "If you receive an error stating \"Parent Task Not Running\" this can be ignored. As we are using the Debug action the task will start anyway.",
|
||||
"updated": 1623410561295
|
||||
},
|
||||
{
|
||||
"style": "Png",
|
||||
"text": "PNGs/Foundations/Docs/debugging-your-indicator/14_expand-data-tasks.png",
|
||||
"updated": 1623410569919
|
||||
},
|
||||
{
|
||||
"style": "Png",
|
||||
"text": "PNGs/Foundations/Docs/debugging-your-indicator/15_debug-your-indicator-task.png",
|
||||
"updated": 1623410589000
|
||||
},
|
||||
{
|
||||
"style": "Text",
|
||||
"text": "If your Task has dependencies (for example above we are debugging Resistances and Supports, but these need the Exchange Raw Data and Candles running before they will run) start the needed tasks connected to your indicator by hovering over the nodes and click \"Run\".",
|
||||
"updated": 1623410869266
|
||||
},
|
||||
{
|
||||
"style": "Png",
|
||||
"text": "PNGs/Foundations/Docs/debugging-your-indicator/16_run-ohlcvs.png",
|
||||
"updated": 1623411034335
|
||||
},
|
||||
{
|
||||
"style": "Png",
|
||||
"text": "PNGs/Foundations/Docs/debugging-your-indicator/17_run-dependencies.png",
|
||||
"updated": 1623411039717
|
||||
},
|
||||
{
|
||||
"style": "Text",
|
||||
"text": "If you have a look in the Debug Code terminal you should now see your indicator running as normal.",
|
||||
"updated": 1623410912711
|
||||
},
|
||||
{
|
||||
"style": "Png",
|
||||
"text": "PNGs/Foundations/Docs/debugging-your-indicator/18_check-debug-terminal.png",
|
||||
"updated": 1623411066811
|
||||
},
|
||||
{
|
||||
"style": "Note",
|
||||
"text": "Deleting existing data from your indicator in the ..Superalgos/Data-Storage/ folder might speed up the data mining process.",
|
||||
"updated": 1623410940602
|
||||
}
|
||||
]
|
||||
}
|
||||
+74
@@ -0,0 +1,74 @@
|
||||
{
|
||||
"topic": "Debugging Your Indicator",
|
||||
"pageNumber": 5,
|
||||
"type": "Debugging - Let The Hunt Begin!",
|
||||
"definition": {
|
||||
"text": "Use F11 to zoom in to the code once it stops at the breaking point, and use F5 to take it step by step forward.",
|
||||
"updated": 1614333358461,
|
||||
"translations": [
|
||||
{
|
||||
"language": "CN",
|
||||
"text": "Use F11 to zoom in to the code once it stops at the breaking point, and use F5 to take it step by step forward. ",
|
||||
"updated": 1614338803641,
|
||||
"style": "Definition"
|
||||
}
|
||||
]
|
||||
},
|
||||
"paragraphs": [
|
||||
{
|
||||
"style": "Title",
|
||||
"text": "Ssssh, be quiet... wait for it...",
|
||||
"updated": 1614512153973
|
||||
},
|
||||
{
|
||||
"style": "Text",
|
||||
"text": "As soon as the data for your indicator is being processed, your IDE will pause the process at the break point we set earlier...",
|
||||
"updated": 1614512188902
|
||||
},
|
||||
{
|
||||
"style": "Javascript",
|
||||
"text": "(eval(dataBuildingProcedure.loop.procedureJavascriptCode.code))"
|
||||
},
|
||||
{
|
||||
"style": "Text",
|
||||
"text": "... allowing you to zoom in to the details what's really going on."
|
||||
},
|
||||
{
|
||||
"style": "Text",
|
||||
"text": "Keep an eye out for when your Breaking point changes from a dot to an arrow.",
|
||||
"updated": 1614334261604
|
||||
},
|
||||
{
|
||||
"style": "Png",
|
||||
"text": "PNGs/Foundations/Docs/debugging-your-indicator/19_breaking-point-indication.png",
|
||||
"updated": 1623411413725
|
||||
},
|
||||
{
|
||||
"style": "Png",
|
||||
"text": "PNGs/Foundations/Docs/debugging-your-indicator/20_stopped-at-breaking-point.png",
|
||||
"updated": 1623411419203
|
||||
},
|
||||
{
|
||||
"style": "Text",
|
||||
"text": "Use F11 to zoom into the code and F5 to step forward."
|
||||
},
|
||||
{
|
||||
"style": "Text",
|
||||
"text": "Keep stepping forward to follow the flow of data."
|
||||
},
|
||||
{
|
||||
"style": "Text",
|
||||
"text": "Monitor what's going on in the code, and hover over your variables to check what values they get."
|
||||
},
|
||||
{
|
||||
"style": "Png",
|
||||
"text": "PNGs/Foundations/Docs/debugging-your-indicator/21_zoomed-in-getting-values.png",
|
||||
"updated": 1623411423507
|
||||
},
|
||||
{
|
||||
"style": "Note",
|
||||
"text": "Tip: In cases where the values turn to \"NaN\" or stays \"undefined\" without a logical reason - There's a point to raise doubt.",
|
||||
"updated": 1614512232138
|
||||
}
|
||||
]
|
||||
}
|
||||
+29
@@ -0,0 +1,29 @@
|
||||
{
|
||||
"topic": "Debugging Your Indicator",
|
||||
"pageNumber": 6,
|
||||
"type": "Debugging - Found Something!",
|
||||
"definition": {
|
||||
"text": "Rinse and repeat.",
|
||||
"updated": 1614512264174,
|
||||
"translations": [
|
||||
{
|
||||
"language": "CN",
|
||||
"text": "Rinse and repeat.",
|
||||
"updated": 1614338812128,
|
||||
"style": "Definition"
|
||||
}
|
||||
]
|
||||
},
|
||||
"paragraphs": [
|
||||
{
|
||||
"style": "Text",
|
||||
"text": "When you've spotted what may be the cause of the error, stop all processes in the UI, modify the code for your indicator and re-debug your code.",
|
||||
"updated": 1614265041452
|
||||
},
|
||||
{
|
||||
"style": "Note",
|
||||
"text": "Use \"if/else\" statements or assign values to variables that get questionable values and re-test your indicator, ruling out possible causes - one by one.",
|
||||
"updated": 1614512286715
|
||||
}
|
||||
]
|
||||
}
|
||||
Reference in new issue
Block a user