Merge pull request #592 from cozed-gh/develop

Contribution: Debugging your indicator
This commit is contained in:
Luis Fernando Molina authored and GitHub committed 2021-02-26 12:12:43 +01:00
commit 934df54066
23 files changed
+275

No files matched your search

Binary file not shown.

After

Width:  |  Height:  |  Size: 62 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 45 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 84 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 83 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 78 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 45 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 106 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

@@ -0,0 +1,42 @@
{
"topic": "Debugging your indicator",
"pageNumber": "1",
"type": "Debugging your indicator",
"definition": {
"text": "Using an Integrated development environment (IDE) will help you catch bugs.",
"updated": 1614257102916
},
"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": 1614264361700
},
{
"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 come up with your new indicator idea, jotted down the outlines, translated it into code - Perfect!...then it stops with an error.",
"updated": 1614257276497
},
{
"style": "Text",
"text": "Grab some coffee and mosquito repellent - We're going bug hunting."
},
{
"style": "Text",
"text": "<a href=\"https://visualstudio.microsoft.com/free-developer-offers/\" target=\"_blank\">Get Visual Studio Code</a>"
}
]
}
@@ -0,0 +1,75 @@
{
"topic": "Debugging your indicator",
"pageNumber": "2",
"type": "Setting up your IDE",
"definition": {
"text": "Toggling Breakpoints is telling the the program where to slow down - Where we'd like to take control",
"updated": 1614264846619
},
"paragraphs": [
{
"style": "Text",
"text": "Start up your IDE and Add the \"TaskServer\" folder (../Superalgos/TaskServer) to your workspace.",
"updated": 1614331592978
},
{
"style": "Png",
"text": "PNGs/Superalgos/Docs/debugging-your-indicator/1_open-folder.png",
"updated": 1614329413344
},
{
"style": "Png",
"text": "PNGs/Superalgos/Docs/debugging-your-indicator/2_taskserver-folder.png",
"updated": 1614331239911
},
{
"style": "Text",
"text": "Also Add the \"Projects\" (../Superalgos/Projects) folder to your workspace.",
"updated": 1614331619021
},
{
"style": "Png",
"text": "PNGs/Superalgos/Docs/debugging-your-indicator/3_add-folder.png",
"updated": 1614331194799
},
{
"style": "Png",
"text": "PNGs/Superalgos/Docs/debugging-your-indicator/4_projects-folder.png",
"updated": 1614331302498
},
{
"style": "Text",
"text": "Locate and open the file \"SingleMarketFunctions.js\" (..Superalgos\\Projects\\Superalgos\\TS\\Function-Libraries\\SingleMarketFunctions.js)."
},
{
"style": "Png",
"text": "PNGs/Superalgos/Docs/debugging-your-indicator/5_locate-singlemarket-in-tree.png"
},
{
"style": "Text",
"text": "Now we will have to find the line in the code where we'd like the process to stop, and show us what's really happening.",
"updated": 1614331648050
},
{
"style": "Png",
"text": "PNGs/Superalgos/Docs/debugging-your-indicator/6_find-line-for-breakpoint.png"
},
{
"style": "Text",
"text": "This point would be the line that says:"
},
{
"style": "Text",
"text": "\"eval(dataBuildingProcedure.loop.procedureJavascriptCode.code)\""
},
{
"style": "Text",
"text": "Insert a breakpoint (F9) at this line."
},
{
"style": "Note",
"text": "Using \"CTRL+F\" allows us to find what we search for in the code.",
"updated": 1614265550399
}
]
}
@@ -0,0 +1,83 @@
{
"topic": "Debugging your indicator",
"pageNumber": "3",
"type": "Start your processes",
"definition": {
"text": "Start the Task in Debug mode while running a debug session in your IDE.",
"updated": 1614332155989
},
"paragraphs": [
{
"style": "Text",
"text": "Start your Superalgos UI by going to the terminal and enter \"node run\".",
"updated": 1614332264940
},
{
"style": "Png",
"text": "PNGs/Superalgos/Docs/debugging-your-indicator/8_node-run.png"
},
{
"style": "Text",
"text": "Start a Debug Session in your IDE by clicking \"Run -> Start Debugging\" (F5)",
"updated": 1614332454563
},
{
"style": "Png",
"text": "PNGs/Superalgos/Docs/debugging-your-indicator/9_start-debugging.png"
},
{
"style": "Text",
"text": "Go to your Network node and find the Data Task for your indicator.",
"updated": 1614332492978
},
{
"style": "Png",
"text": "PNGs/Superalgos/Docs/debugging-your-indicator/10_network.png"
},
{
"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": "Png",
"text": "PNGs/Superalgos/Docs/debugging-your-indicator/11_expand-data-tasks.png"
},
{
"style": "Png",
"text": "PNGs/Superalgos/Docs/debugging-your-indicator/12_debug-your-indicator-task.png",
"updated": 1614332699707
},
{
"style": "Png",
"text": "PNGs/Superalgos/Docs/debugging-your-indicator/13_check-your-indicator-starts.png"
},
{
"style": "Text",
"text": "Start the needed tasks connected to your indicator (i.e. Exchange Raw Data and Candle Volumes) by hovering over the nodes and click \"Run\".",
"updated": 1614332767583
},
{
"style": "Png",
"text": "PNGs/Superalgos/Docs/debugging-your-indicator/15_run-ohlcvs.png"
},
{
"style": "Png",
"text": "PNGs/Superalgos/Docs/debugging-your-indicator/16_run-dependencies.png"
},
{
"style": "Png",
"text": "PNGs/Superalgos/Docs/debugging-your-indicator/14_check-debug-terminal.png"
},
{
"style": "Note",
"text": "Check your Superalgos terminal to see if everything starts up as planned",
"updated": 1614333056827
},
{
"style": "Note",
"text": "Deleting existing data from your indicator in the..Superalgos/Data-Storage/ folder might speed up the data mining process",
"updated": 1614333417020
}
]
}
@@ -0,0 +1,54 @@
{
"topic": "Debugging your indicator",
"pageNumber": "4",
"type": "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
},
"paragraphs": [
{
"style": "Subtitle",
"text": "Ssssh, be quite... wait for it...",
"updated": 1614264973244
},
{
"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 (eval(dataBuildingProcedure.loop.procedureJavascriptCode.code)), 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/Superalgos/Docs/debugging-your-indicator/7_breaking-point-indication.png"
},
{
"style": "Png",
"text": "PNGs/Superalgos/Docs/debugging-your-indicator/17_stopped-at-breaking-point.png"
},
{
"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/Superalgos/Docs/debugging-your-indicator/18_zoomed-in-getting-values.png"
},
{
"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": 1614265790102
}
]
}
@@ -0,0 +1,21 @@
{
"topic": "Debugging your indicator",
"pageNumber": "5",
"type": "Found something!",
"definition": {
"text": "Rinse and repeat",
"updated": 1614333501847
},
"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": 1614333577089
}
]
}