Advertisement
StartledMonkey

node-red flow for crypto-signals webhook

Mar 20th, 2019
217
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. [
  2.     {
  3.         "id": "ab7e43a5.143d6",
  4.         "type": "http in",
  5.         "z": "b7afe2b6.e3355",
  6.         "name": "Crypto-Signals",
  7.         "url": "/cryptosignals",
  8.         "method": "post",
  9.         "upload": false,
  10.         "swaggerDoc": "",
  11.         "x": 163.24996948242188,
  12.         "y": 952.0833129882812,
  13.         "wires": [
  14.             [
  15.                 "8c1c6745.ef5438",
  16.                 "5bd0126c.0c434c"
  17.             ]
  18.         ]
  19.     },
  20.     {
  21.         "id": "8c1c6745.ef5438",
  22.         "type": "http response",
  23.         "z": "b7afe2b6.e3355",
  24.         "name": "",
  25.         "statusCode": "",
  26.         "headers": {},
  27.         "x": 400.2499694824219,
  28.         "y": 952.0833129882812,
  29.         "wires": []
  30.     },
  31.     {
  32.         "id": "5bd0126c.0c434c",
  33.         "type": "function",
  34.         "z": "b7afe2b6.e3355",
  35.         "name": "Parser",
  36.         "func": "var string = msg.payload.messages;\nvar obj = JSON.parse(string);\nmsg.payload = obj;\nreturn msg;",
  37.         "outputs": 1,
  38.         "noerr": 0,
  39.         "x": 130.25,
  40.         "y": 1039.0833129882812,
  41.         "wires": [
  42.             [
  43.                 "132b2c67.e1e234",
  44.                 "efa559b6.2f8998"
  45.             ]
  46.         ]
  47.     },
  48.     {
  49.         "id": "132b2c67.e1e234",
  50.         "type": "split",
  51.         "z": "b7afe2b6.e3355",
  52.         "name": "Splitter",
  53.         "splt": "\\n",
  54.         "spltType": "str",
  55.         "arraySplt": 1,
  56.         "arraySpltType": "len",
  57.         "stream": false,
  58.         "addname": "",
  59.         "x": 276.25,
  60.         "y": 1039.0833129882812,
  61.         "wires": [
  62.             [
  63.                 "477339de.8e5298"
  64.             ]
  65.         ]
  66.     },
  67.     {
  68.         "id": "477339de.8e5298",
  69.         "type": "switch",
  70.         "z": "b7afe2b6.e3355",
  71.         "name": "IndicatorType",
  72.         "property": "payload.indicator",
  73.         "propertyType": "msg",
  74.         "rules": [
  75.             {
  76.                 "t": "eq",
  77.                 "v": "rsi",
  78.                 "vt": "str"
  79.             },
  80.             {
  81.                 "t": "eq",
  82.                 "v": "stoch_rsi",
  83.                 "vt": "str"
  84.             },
  85.             {
  86.                 "t": "eq",
  87.                 "v": "momentum",
  88.                 "vt": "str"
  89.             },
  90.             {
  91.                 "t": "eq",
  92.                 "v": "mfi",
  93.                 "vt": "str"
  94.             }
  95.         ],
  96.         "checkall": "true",
  97.         "repair": false,
  98.         "outputs": 4,
  99.         "x": 454.25,
  100.         "y": 1039.0833129882812,
  101.         "wires": [
  102.             [
  103.                 "903b52e1.3d16a"
  104.             ],
  105.             [
  106.                 "cebe3a72.7e8098"
  107.             ],
  108.             [
  109.                 "78af4274.d5dc6c"
  110.             ],
  111.             [
  112.                 "79627b30.85b8f4"
  113.             ]
  114.         ]
  115.     },
  116.     {
  117.         "id": "903b52e1.3d16a",
  118.         "type": "change",
  119.         "z": "b7afe2b6.e3355",
  120.         "name": "Convert RSI  to number",
  121.         "rules": [
  122.             {
  123.                 "t": "set",
  124.                 "p": "payload.values.rsi",
  125.                 "pt": "msg",
  126.                 "to": "$number(payload.values.rsi)",
  127.                 "tot": "jsonata"
  128.             }
  129.         ],
  130.         "action": "",
  131.         "property": "",
  132.         "from": "",
  133.         "to": "",
  134.         "reg": false,
  135.         "x": 733.5000076293945,
  136.         "y": 980.3333187103271,
  137.         "wires": [
  138.             [
  139.                 "5af9bf29.e7de8"
  140.             ]
  141.         ]
  142.     },
  143.     {
  144.         "id": "cebe3a72.7e8098",
  145.         "type": "change",
  146.         "z": "b7afe2b6.e3355",
  147.         "name": "Convert Stoch_RSI to number",
  148.         "rules": [
  149.             {
  150.                 "t": "set",
  151.                 "p": "payload.values.stoch_rsi",
  152.                 "pt": "msg",
  153.                 "to": "$number(payload.values.stoch_rsi)",
  154.                 "tot": "jsonata"
  155.             }
  156.         ],
  157.         "action": "",
  158.         "property": "",
  159.         "from": "",
  160.         "to": "",
  161.         "reg": false,
  162.         "x": 763.5000076293945,
  163.         "y": 1032.3333187103271,
  164.         "wires": [
  165.             [
  166.                 "7d7d2a67.d91a64"
  167.             ]
  168.         ]
  169.     },
  170.     {
  171.         "id": "5af9bf29.e7de8",
  172.         "type": "change",
  173.         "z": "b7afe2b6.e3355",
  174.         "name": "Set flow variables for Current Prices and RSI",
  175.         "rules": [
  176.             {
  177.                 "t": "set",
  178.                 "p": "currentprices",
  179.                 "pt": "flow",
  180.                 "to": "payload.prices",
  181.                 "tot": "jsonata"
  182.             },
  183.             {
  184.                 "t": "set",
  185.                 "p": "currentrsivalue",
  186.                 "pt": "flow",
  187.                 "to": "payload.values.rsi",
  188.                 "tot": "jsonata"
  189.             }
  190.         ],
  191.         "action": "",
  192.         "property": "",
  193.         "from": "",
  194.         "to": "",
  195.         "reg": false,
  196.         "x": 1114.5000076293945,
  197.         "y": 980.3333187103271,
  198.         "wires": [
  199.             [
  200.                 "ff518b3e.779dc8"
  201.             ]
  202.         ]
  203.     },
  204.     {
  205.         "id": "7d7d2a67.d91a64",
  206.         "type": "change",
  207.         "z": "b7afe2b6.e3355",
  208.         "name": "Set flow variable for Stoch_RSI",
  209.         "rules": [
  210.             {
  211.                 "t": "set",
  212.                 "p": "currentstochrsivalue",
  213.                 "pt": "flow",
  214.                 "to": "\"Stoch_RSI : \" & msg.payload.values.stoch_rsi",
  215.                 "tot": "jsonata"
  216.             }
  217.         ],
  218.         "action": "",
  219.         "property": "",
  220.         "from": "",
  221.         "to": "",
  222.         "reg": false,
  223.         "x": 1074.500015258789,
  224.         "y": 1032.333324432373,
  225.         "wires": [
  226.             [
  227.                 "fd3d040b.a0e4c8"
  228.             ]
  229.         ]
  230.     },
  231.     {
  232.         "id": "78af4274.d5dc6c",
  233.         "type": "change",
  234.         "z": "b7afe2b6.e3355",
  235.         "name": "Convert momentum to number",
  236.         "rules": [
  237.             {
  238.                 "t": "set",
  239.                 "p": "payload.values.momentum",
  240.                 "pt": "msg",
  241.                 "to": "$number(payload.values.momentum)",
  242.                 "tot": "jsonata"
  243.             }
  244.         ],
  245.         "action": "",
  246.         "property": "",
  247.         "from": "",
  248.         "to": "",
  249.         "reg": false,
  250.         "x": 761.5000076293945,
  251.         "y": 1081.3333187103271,
  252.         "wires": [
  253.             [
  254.                 "9f07f057.a5afd"
  255.             ]
  256.         ]
  257.     },
  258.     {
  259.         "id": "79627b30.85b8f4",
  260.         "type": "change",
  261.         "z": "b7afe2b6.e3355",
  262.         "name": "Convert mfi to number",
  263.         "rules": [
  264.             {
  265.                 "t": "set",
  266.                 "p": "payload.values.mfi",
  267.                 "pt": "msg",
  268.                 "to": "$number(payload.values.mfi)",
  269.                 "tot": "jsonata"
  270.             }
  271.         ],
  272.         "action": "",
  273.         "property": "",
  274.         "from": "",
  275.         "to": "",
  276.         "reg": false,
  277.         "x": 732.5000076293945,
  278.         "y": 1133.3333187103271,
  279.         "wires": [
  280.             [
  281.                 "f2422a9f.afa9b8"
  282.             ]
  283.         ]
  284.     },
  285.     {
  286.         "id": "9f07f057.a5afd",
  287.         "type": "change",
  288.         "z": "b7afe2b6.e3355",
  289.         "name": "Set flow variable for momentum",
  290.         "rules": [
  291.             {
  292.                 "t": "set",
  293.                 "p": "currentmomentumvalue",
  294.                 "pt": "flow",
  295.                 "to": "\"Momentum : \" & msg.payload.values.momentum",
  296.                 "tot": "jsonata"
  297.             }
  298.         ],
  299.         "action": "",
  300.         "property": "",
  301.         "from": "",
  302.         "to": "",
  303.         "reg": false,
  304.         "x": 1074.5000076293945,
  305.         "y": 1081.3333187103271,
  306.         "wires": [
  307.             [
  308.                 "e2d80738.bbd1d8"
  309.             ]
  310.         ]
  311.     },
  312.     {
  313.         "id": "f2422a9f.afa9b8",
  314.         "type": "change",
  315.         "z": "b7afe2b6.e3355",
  316.         "name": "Set flow variable for mfi",
  317.         "rules": [
  318.             {
  319.                 "t": "set",
  320.                 "p": "currentmfivalue",
  321.                 "pt": "flow",
  322.                 "to": "\"MFI : \" & msg.payload.values.mfi",
  323.                 "tot": "jsonata"
  324.             }
  325.         ],
  326.         "action": "",
  327.         "property": "",
  328.         "from": "",
  329.         "to": "",
  330.         "reg": false,
  331.         "x": 1056.5000076293945,
  332.         "y": 1132.3333187103271,
  333.         "wires": [
  334.             [
  335.                 "b2d0a349.aa184"
  336.             ]
  337.         ]
  338.     },
  339.     {
  340.         "id": "7122e1e3.f30a8",
  341.         "type": "comment",
  342.         "z": "b7afe2b6.e3355",
  343.         "name": "Flow for Crypto Signals",
  344.         "info": "Signals received from Crypto-Signals webhook",
  345.         "x": 183.5,
  346.         "y": 902.3333129882812,
  347.         "wires": []
  348.     },
  349.     {
  350.         "id": "efa559b6.2f8998",
  351.         "type": "debug",
  352.         "z": "b7afe2b6.e3355",
  353.         "name": "",
  354.         "active": true,
  355.         "tosidebar": true,
  356.         "console": false,
  357.         "tostatus": false,
  358.         "complete": "false",
  359.         "x": 289.5,
  360.         "y": 1128,
  361.         "wires": []
  362.     },
  363.     {
  364.         "id": "b2d0a349.aa184",
  365.         "type": "debug",
  366.         "z": "b7afe2b6.e3355",
  367.         "name": "",
  368.         "active": true,
  369.         "tosidebar": true,
  370.         "console": false,
  371.         "tostatus": false,
  372.         "complete": "false",
  373.         "x": 1283.5,
  374.         "y": 1132,
  375.         "wires": []
  376.     },
  377.     {
  378.         "id": "e2d80738.bbd1d8",
  379.         "type": "debug",
  380.         "z": "b7afe2b6.e3355",
  381.         "name": "",
  382.         "active": true,
  383.         "tosidebar": true,
  384.         "console": false,
  385.         "tostatus": false,
  386.         "complete": "false",
  387.         "x": 1320.5,
  388.         "y": 1081,
  389.         "wires": []
  390.     },
  391.     {
  392.         "id": "fd3d040b.a0e4c8",
  393.         "type": "debug",
  394.         "z": "b7afe2b6.e3355",
  395.         "name": "",
  396.         "active": true,
  397.         "tosidebar": true,
  398.         "console": false,
  399.         "tostatus": false,
  400.         "complete": "false",
  401.         "x": 1320.5,
  402.         "y": 1032,
  403.         "wires": []
  404.     },
  405.     {
  406.         "id": "ff518b3e.779dc8",
  407.         "type": "debug",
  408.         "z": "b7afe2b6.e3355",
  409.         "name": "",
  410.         "active": true,
  411.         "tosidebar": true,
  412.         "console": false,
  413.         "tostatus": false,
  414.         "complete": "false",
  415.         "x": 1411.5,
  416.         "y": 980,
  417.         "wires": []
  418.     }
  419. ]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement