{
  "includeFiles":[
  ],
  "metadata":{
    "customPrefsImportMode":"reject",
    "dm":{
    },
    "fileVersion":3,
    "menubarPosition":"top",
    "rt":{
      "processors":[
      ]
    },
    "stm":{
      "styles":[
        {
          "id":"LAYOUT_DEFAULT",
          "lb":"Layout Default",
          "pt":"DEFAULT"
        }
      ]
    },
    "transientIdPrefix":"TRANSIENT_"
  },
  "portletConfigs":[
    {
      "portletBuilderId":"amidesktop",
      "portletConfig":{
        "amiPanelId":"@DESKTOP",
        "amiStyle":{
          "pt":"LAYOUT_DEFAULT"
        },
        "windows":[
          {
            "header":true,
            "heightDflt":375,
            "hidden":false,
            "leftDflt":40,
            "portlet":"Html1",
            "pos":0,
            "stateDflt":"flt",
            "title":"Window",
            "topDflt":60,
            "widthDflt":687,
            "zindexDflt":1
          }
        ]
      }
    },
    {
      "portletBuilderId":"amiform",
      "portletConfig":{
        "amiPanelId":"Html1",
        "amiStyle":{
          "pt":"LAYOUT_DEFAULT"
        },
        "fields":[
          {
            "callbacks":{
              "entries":[
                {
                  "amiscript":[
                    "Table portfolioTable = new Table(\"Portfolio\", \"ticker String, amount double, price double\");\n",
                    "\n",
                    "portfolioTable.addRow(\"GOOG\", 100,  456.7);\n",
                    "portfolioTable.addRow(\"IBM\" , 1000, 56.78);\n",
                    "portfolioTable.addRow(\"NFLX\", 10000, 78.9);\n",
                    "portfolioTable.addRow(\"CSCO\", 100,  123.4);\n",
                    "\n",
                    "\n",
                    "CREATE TABLE Prices(ticker String, sellPrice Double, buyPrice Double, timestamp Long);\n",
                    "\n",
                    "List tickers = new List(\"IBM\", \"GOOG\", \"NFLX\", \"CSCO\", \"AMZN\", \"META\", \"MSFT\");\n",
                    "Long startInstant = 1736870400000L;\n",
                    "int days = 5;\n",
                    "Rand randomGen = new Rand(1);\n",
                    "Long millisInADay = 86400000;\n",
                    "    \n",
                    "for ( String ticker: tickers) {\n",
                    "  startInstant = 1736870400000L;\n",
                    "  Double randomSell = randomGen.nextDouble(10,500);\n",
                    "  Double randomBuy = randomSell * 0.99;\n",
                    "      \n",
                    "  for (int i = 0; i < days; ++i) {\n",
                    "    INSERT INTO Prices(ticker, sellPrice, buyPrice, timestamp) \n",
                    "      VALUES(ticker, randomSell, randomBuy, startInstant);\n",
                    "       \n",
                    "    randomSell = randomSell * 0.99;\n",
                    "    randomBuy = randomSell * 0.99;\n",
                    "    startInstant += millisInADay;\n",
                    "  }\n",
                    "}"
                  ],
                  "linkedVariables":[
                  ],
                  "name":"onChange",
                  "schema":{
                    "tbl":[
                      {
                        "cols":[
                          {
                            "nm":"ticker",
                            "tp":"String"
                          },
                          {
                            "nm":"sellPrice",
                            "tp":"Double"
                          },
                          {
                            "nm":"buyPrice",
                            "tp":"Double"
                          },
                          {
                            "nm":"timestamp",
                            "tp":"Long"
                          }
                        ],
                        "nm":"Prices",
                        "oc":"ask"
                      }
                    ]
                  }
                }
              ]
            },
            "heightPx":20,
            "l":"Button",
            "labelHidden":true,
            "leftPosPx":100,
            "n":"button",
            "t":"buttonField",
            "topPosPx":20,
            "widthPx":200,
            "zidx":1
          }
        ],
        "snap":20,
        "upid":"Html1"
      }
    }
  ]
}