ok
This commit is contained in:
3
.gitignore
vendored
3
.gitignore
vendored
@ -30,4 +30,5 @@ share/python-wheels/
|
|||||||
*.egg-info/
|
*.egg-info/
|
||||||
.installed.cfg
|
.installed.cfg
|
||||||
*.egg
|
*.egg
|
||||||
MANIFEST
|
MANIFEST
|
||||||
|
strat.log
|
||||||
|
|||||||
@ -1,8 +0,0 @@
|
|||||||
INFO: Started server process [56033]
|
|
||||||
INFO: Waiting for application startup.
|
|
||||||
INFO: Application startup complete.
|
|
||||||
INFO: Uvicorn running on http://0.0.0.0:8000 (Press CTRL+C to quit)
|
|
||||||
INFO: Shutting down
|
|
||||||
INFO: Waiting for application shutdown.
|
|
||||||
INFO: Application shutdown complete.
|
|
||||||
INFO: Finished server process [56033]
|
|
||||||
@ -7,243 +7,240 @@
|
|||||||
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>
|
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>
|
||||||
<link href="https://cdn.datatables.net/1.13.4/css/jquery.dataTables.min.css" rel="stylesheet">
|
<link href="https://cdn.datatables.net/1.13.4/css/jquery.dataTables.min.css" rel="stylesheet">
|
||||||
<script src="/static/js/jquery.dataTables.min.js"></script>
|
<script src="/static/js/jquery.dataTables.min.js"></script>
|
||||||
|
<link rel="stylesheet" href="/static/main.css">
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div class="mainConteiner">
|
<div id="main" class="mainConteiner flex-container">
|
||||||
<div class="realtime">
|
<div id="chartContainer" class="flex-items">
|
||||||
<h1>Realtime chart</h1>
|
<h4>Status: <span id="status">Not connected</span></h4>
|
||||||
<h2>Your ID: <span id="ws-id"></span></h2>
|
<div id="formular">
|
||||||
<h3>Status: <span id="status">Not connected</span></h3>
|
<form action="">
|
||||||
<form action="" onsubmit="sendMessage(event)">
|
<input type="text" id="runnerId" autocomplete="off" placeholder="StrategyID" value=""/>
|
||||||
<label>Runner ID: <input type="text" id="runnerId" autocomplete="off" value=""/></label>
|
<button onclick="connect(event)" id="bt-conn" class="btn btn-success">Connect</button>
|
||||||
<button onclick="connect(event)" id="bt-conn">Connect</button>
|
<button onclick="disconnect(event)" id="bt-disc" style="display: None" class="btn btn-success">Disconnect</button>
|
||||||
<button onclick="disconnect(event)" id="bt-disc" style="display: None">Disconnect</button>
|
<!-- <label>Message: --> <input type="text" id="messageText" autocomplete="off" placeholder="WS out message"/>
|
||||||
<hr>
|
<button onclick="sendMessage(event)" id="bt.send" class="btn btn-success">Send</button>
|
||||||
<label>Message: <input type="text" id="messageText" autocomplete="off"/></label>
|
|
||||||
<button>Send</button>
|
|
||||||
</form>
|
|
||||||
<ul id='messages'>
|
|
||||||
</ul>
|
|
||||||
<div id="chart"></div>
|
|
||||||
<div id="conteiner"></div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div id="controls">
|
|
||||||
<label>API-KEY: <input type="password" id="api-key" autocomplete="off"/></label>
|
|
||||||
<button onclick="store_api_key(event)" id="bt-store">Store</button>
|
|
||||||
</div>
|
|
||||||
<div id="runner-table">
|
|
||||||
<button id="button_pause" class="btn btn-success">Pause/Unpause</button>
|
|
||||||
<button id="button_stop" class="btn btn-success">Stop</button>
|
|
||||||
<button id="button_stopall" class="btn btn-success">Stop All</button>
|
|
||||||
<button id="button_refresh" class="btn btn-success">Refresh</button>
|
|
||||||
|
|
||||||
<table id="runnerTable" class="display" style="width:100%">
|
|
||||||
<thead>
|
|
||||||
<tr>
|
|
||||||
<th>Id</th>
|
|
||||||
<th>Started</th>
|
|
||||||
<th>Mode</th>
|
|
||||||
<th>Account</th>
|
|
||||||
<th>Paused</th>
|
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
<tbody></tbody>
|
|
||||||
</table>
|
|
||||||
</div>
|
|
||||||
<div id="runnerModal" class="modal fade">
|
|
||||||
<div class="modal-dialog">
|
|
||||||
<form method="post" id="stopForm">
|
|
||||||
<div class="modal-content">
|
|
||||||
<div class="modal-header">
|
|
||||||
<button type="button" class="close" data-dismiss="modal">×</button>
|
|
||||||
<h4 class="modal-title"><i class="fa fa-plus"></i> Stop Strategy</h4>
|
|
||||||
</div>
|
|
||||||
<div class="modal-body">
|
|
||||||
<div class="form-group"
|
|
||||||
<label for="runnerid" class="control-label">Id</label>
|
|
||||||
<input type="text" class="form-control" id="runnerid" name="runnerid" placeholder="id">
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="modal-footer">
|
|
||||||
<input type="submit" name="stop" id="stop" class="btn btn-info" value="stop" />
|
|
||||||
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</form>
|
</form>
|
||||||
|
</div>
|
||||||
|
<ul id='messages'>
|
||||||
|
</ul>
|
||||||
|
<div id="chart"></div>
|
||||||
|
<div class="legend" id="legend"></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
<div id="runner-table" class="flex-items">
|
||||||
|
<div id="controls">
|
||||||
|
<label>API-KEY: <input type="password" id="api-key" autocomplete="off"/></label>
|
||||||
|
<button onclick="store_api_key(event)" id="bt-store" class="btn btn-success">Store</button>
|
||||||
<div id="stratin-table">
|
<button id="button_pause" class="btn btn-success">Pause/Unpause</button>
|
||||||
<button id="button_add" class="btn btn-success">Add</button><button id="button_edit" class="btn btn-success">Edit</button><button id="button_delete" class="btn btn-success">Delete</button><button id="button_run" class="btn btn-success">Run Strategy</button>
|
<button id="button_stop" class="btn btn-success">Stop</button>
|
||||||
<table id="stratinTable" class="display" style="width:100%">
|
<button id="button_stopall" class="btn btn-success">Stop All</button>
|
||||||
<thead>
|
<button id="button_refresh" class="btn btn-success">Refresh</button>
|
||||||
<tr>
|
</div>
|
||||||
<th>Id</th>
|
<div id="runner-table">
|
||||||
<th>Id2</th>
|
<table id="runnerTable" class="display" style="width:100%">
|
||||||
<th>Name</th>
|
<thead>
|
||||||
<th>Symbol</th>
|
<tr>
|
||||||
<th>class</th>
|
<th>Id</th>
|
||||||
<th>script</th>
|
<th>Started</th>
|
||||||
<th>OR</th>
|
<th>Mode</th>
|
||||||
<th>CR</th>
|
<th>Account</th>
|
||||||
<th>Stratvars</th>
|
<th>Paused</th>
|
||||||
<th>add_data</th>
|
</tr>
|
||||||
<th>note</th>
|
</thead>
|
||||||
<th>history</th>
|
<tbody></tbody>
|
||||||
<th></th>
|
</table>
|
||||||
<th></th>
|
</div>
|
||||||
</tr>
|
<div id="runnerModal" class="modal fade">
|
||||||
</thead>
|
<div class="modal-dialog">
|
||||||
<tbody></tbody>
|
<form method="post" id="stopForm">
|
||||||
</table>
|
<div class="modal-content">
|
||||||
</div>
|
<div class="modal-header">
|
||||||
<div id="recordModal" class="modal fade">
|
<button type="button" class="close" data-dismiss="modal">×</button>
|
||||||
<div class="modal-dialog">
|
<h4 class="modal-title"><i class="fa fa-plus"></i> Stop Strategy</h4>
|
||||||
<form method="post" id="recordForm">
|
</div>
|
||||||
<div class="modal-content">
|
<div class="modal-body">
|
||||||
<div class="modal-header">
|
<div class="form-group">
|
||||||
<button type="button" class="close" data-dismiss="modal">×</button>
|
<label for="runnerid" class="control-label">Id</label>
|
||||||
<h4 class="modal-title"><i class="fa fa-plus"></i> Add Record</h4>
|
<input type="text" class="form-control" id="runnerid" name="runnerid" placeholder="id">
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-body">
|
</div>
|
||||||
<div class="form-group"
|
<div class="modal-footer">
|
||||||
<label for="id" class="control-label">Id</label>
|
<input type="submit" name="stop" id="stop" class="btn btn-info" value="stop" />
|
||||||
<input type="text" class="form-control" id="id" name="id" placeholder="id" readonly>
|
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group"
|
</form>
|
||||||
<label for="id2" class="control-label">Id2</label>
|
|
||||||
<input type="text" class="form-control" id="id2" name="id2" placeholder="id2" required>
|
|
||||||
</div>
|
|
||||||
<div class="form-group"
|
|
||||||
<label for="name" class="control-label">Name</label>
|
|
||||||
<input type="text" class="form-control" id="name" name="name" placeholder="Name" required>
|
|
||||||
</div>
|
|
||||||
<div class="form-group">
|
|
||||||
<label for="symbol" class="control-label">symbol</label>
|
|
||||||
<input type="text" class="form-control" id="symbol" name="symbol" placeholder="Symbol" required>
|
|
||||||
</div>
|
|
||||||
<div class="form-group">
|
|
||||||
<label for="class_name" class="control-label">class_name</label>
|
|
||||||
<input type="text" class="form-control" id="class_name" name="class_name" placeholder="class_name" required>
|
|
||||||
</div>
|
|
||||||
<div class="form-group">
|
|
||||||
<label for="script" class="control-label">script</label>
|
|
||||||
<input type="text" class="form-control" id="script" name="script" placeholder="script" required>
|
|
||||||
</div>
|
|
||||||
<div class="form-group">
|
|
||||||
<label for="open_rush" class="control-label">open_rush</label>
|
|
||||||
<input type="number" class="form-control" id="open_rush" name="open_rush" placeholder="open_rush" value=0 required>
|
|
||||||
</div>
|
|
||||||
<div class="form-group">
|
|
||||||
<label for="close_rush" class="control-label">close_rush</label>
|
|
||||||
<input type="number" class="form-control" id="close_rush" name="close_rush" placeholder="close_rush" value=0 required>
|
|
||||||
</div>
|
|
||||||
<div class="form-group">
|
|
||||||
<label for="stratvars_conf" class="control-label">stratvars_conf</label>
|
|
||||||
<textarea class="form-control" rows="8" id="stratvars_conf" name="stratvars_conf" required></textarea>
|
|
||||||
</div>
|
|
||||||
<div class="form-group">
|
|
||||||
<label for="add_data_conf" class="control-label">add_data_conf</label>
|
|
||||||
<textarea class="form-control" rows="7" id="add_data_conf" name="add_data_conf" required></textarea>
|
|
||||||
</div>
|
|
||||||
<div class="form-group">
|
|
||||||
<label for="note" class="control-label">note</label>
|
|
||||||
<textarea class="form-control" rows="2" id="note" name="note"></textarea>
|
|
||||||
</div>
|
|
||||||
<div class="form-group">
|
|
||||||
<label for="history" class="control-label">history</label>
|
|
||||||
<textarea class="form-control" rows="3" id="history" name="history"></textarea>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="modal-footer">
|
|
||||||
<!--<input type="hidden" name="id" id="id" />-->
|
|
||||||
<!--<input type="hidden" name="action" id="action" value="" />-->
|
|
||||||
<input type="submit" name="save" id="save" class="btn btn-info" value="Save" />
|
|
||||||
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
<div id="stratin-table" class="flex-items">
|
||||||
<div id="delModal" class="modal fade">
|
<div id="stratin-table">
|
||||||
<div class="modal-dialog">
|
<button id="button_add" class="btn btn-success">Add</button><button id="button_edit" class="btn btn-success">Edit</button><button id="button_delete" class="btn btn-success">Delete</button><button id="button_run" class="btn btn-success">Run Strategy</button>
|
||||||
<form method="post" id="delForm">
|
<table id="stratinTable" class="display" style="width:100%">
|
||||||
<div class="modal-content">
|
<thead>
|
||||||
<div class="modal-header">
|
<tr>
|
||||||
<button type="button" class="close" data-dismiss="modal">×</button>
|
<th>Id</th>
|
||||||
<h4 class="modal-title"><i class="fa fa-plus"></i> Delete Record</h4>
|
<th>Id2</th>
|
||||||
</div>
|
<th>Name</th>
|
||||||
<div class="modal-body">
|
<th>Symbol</th>
|
||||||
<div class="form-group"
|
<th>class</th>
|
||||||
<label for="delid" class="control-label">Id</label>
|
<th>script</th>
|
||||||
<input type="text" class="form-control" id="delid" name="delid" placeholder="id">
|
<th>OR</th>
|
||||||
</div>
|
<th>CR</th>
|
||||||
</div>
|
<th>Stratvars</th>
|
||||||
<div class="modal-footer">
|
<th>add_data</th>
|
||||||
<input type="submit" name="delete" id="delete" class="btn btn-info" value="Delete" />
|
<th>note</th>
|
||||||
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
|
<th>history</th>
|
||||||
</div>
|
<th></th>
|
||||||
|
<th></th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody></tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
<div id="recordModal" class="modal fade">
|
||||||
|
<div class="modal-dialog">
|
||||||
|
<form method="post" id="recordForm">
|
||||||
|
<div class="modal-content">
|
||||||
|
<div class="modal-header">
|
||||||
|
<button type="button" class="close" data-dismiss="modal">×</button>
|
||||||
|
<h4 class="modal-title"><i class="fa fa-plus"></i> Add Record</h4>
|
||||||
|
</div>
|
||||||
|
<div class="modal-body">
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="id" class="control-label">Id</label>
|
||||||
|
<input type="text" class="form-control" id="id" name="id" placeholder="id" readonly>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="id2" class="control-label">Id2</label>
|
||||||
|
<input type="text" class="form-control" id="id2" name="id2" placeholder="id2" required>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="name" class="control-label">Name</label>
|
||||||
|
<input type="text" class="form-control" id="name" name="name" placeholder="Name" required>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="symbol" class="control-label">symbol</label>
|
||||||
|
<input type="text" class="form-control" id="symbol" name="symbol" placeholder="Symbol" required>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="class_name" class="control-label">class_name</label>
|
||||||
|
<input type="text" class="form-control" id="class_name" name="class_name" placeholder="class_name" required>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="script" class="control-label">script</label>
|
||||||
|
<input type="text" class="form-control" id="script" name="script" placeholder="script" required>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="open_rush" class="control-label">open_rush</label>
|
||||||
|
<input type="number" class="form-control" id="open_rush" name="open_rush" placeholder="open_rush" value=0 required>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="close_rush" class="control-label">close_rush</label>
|
||||||
|
<input type="number" class="form-control" id="close_rush" name="close_rush" placeholder="close_rush" value=0 required>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="stratvars_conf" class="control-label">stratvars_conf</label>
|
||||||
|
<textarea class="form-control" rows="8" id="stratvars_conf" name="stratvars_conf" required></textarea>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="add_data_conf" class="control-label">add_data_conf</label>
|
||||||
|
<textarea class="form-control" rows="7" id="add_data_conf" name="add_data_conf" required></textarea>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="note" class="control-label">note</label>
|
||||||
|
<textarea class="form-control" rows="2" id="note" name="note"></textarea>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="history" class="control-label">history</label>
|
||||||
|
<textarea class="form-control" rows="3" id="history" name="history"></textarea>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="modal-footer">
|
||||||
|
<!--<input type="hidden" name="id" id="id" />-->
|
||||||
|
<!--<input type="hidden" name="action" id="action" value="" />-->
|
||||||
|
<input type="submit" name="save" id="save" class="btn btn-info" value="Save" />
|
||||||
|
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</div>
|
||||||
</div>
|
<div id="delModal" class="modal fade">
|
||||||
</div>
|
<div class="modal-dialog">
|
||||||
|
<form method="post" id="delForm">
|
||||||
<div id="runModal" class="modal fade">
|
<div class="modal-content">
|
||||||
<div class="modal-dialog">
|
<div class="modal-header">
|
||||||
<form method="post" id="runForm">
|
<button type="button" class="close" data-dismiss="modal">×</button>
|
||||||
<div class="modal-content">
|
<h4 class="modal-title"><i class="fa fa-plus"></i> Delete Record</h4>
|
||||||
<div class="modal-header">
|
</div>
|
||||||
<button type="button" class="close" data-dismiss="modal">×</button>
|
<div class="modal-body">
|
||||||
<h4 class="modal-title"><i class="fa fa-plus"></i> Run strategy</h4>
|
<div class="form-group">
|
||||||
</div>
|
<label for="delid" class="control-label">Id</label>
|
||||||
<div class="modal-body">
|
<input type="text" class="form-control" id="delid" name="delid" placeholder="id">
|
||||||
<div class="form-group"
|
</div>
|
||||||
<label for="runid" class="control-label">Id</label>
|
</div>
|
||||||
<input type="text" class="form-control" id="runid" name="runid" placeholder="id" readonly>
|
<div class="modal-footer">
|
||||||
|
<input type="submit" name="delete" id="delete" class="btn btn-info" value="Delete" />
|
||||||
|
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group"
|
</form>
|
||||||
<label for="mode" class="control-label">Mode</label>
|
|
||||||
<select class="form-control" id="mode" name="mode"><option value="paper">paper</option><option value="live">live</option><option value="backtest">backtest</option></select>
|
|
||||||
</div>
|
|
||||||
<div class="form-group"
|
|
||||||
<label for="account" class="control-label">Account</label>
|
|
||||||
<select class="form-control" id="account" name="account"><option value="ACCOUNT1">ACCOUNT1</option><option value="ACCOUNT2">ACCOUNT2</option></select>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="form-group">
|
|
||||||
<label for="debug" class="control-label">debug</label>
|
|
||||||
<select class="form-control" id="debug" name="debug"><option value="true">true</option><option value="false" selected>false</option></select>
|
|
||||||
</div>
|
|
||||||
<div class="form-group">
|
|
||||||
<label for="bt_from" class="control-label">bt_from</label>
|
|
||||||
<input type="datetime-local" class="form-control" id="bt_from" name="bt_from" placeholder="2023-04-06T09:00:00Z">
|
|
||||||
</div>
|
|
||||||
<div class="form-group">
|
|
||||||
<label for="bt_to" class="control-label">bt_to</label>
|
|
||||||
<input type="datetime-local" class="form-control" id="bt_to" name="bt_to" placeholder="2023-04-06T09:00:00Z">
|
|
||||||
</div>
|
|
||||||
<div class="form-group">
|
|
||||||
<label for="cash" class="control-label">cash</label>
|
|
||||||
<input type="number" class="form-control" id="cash" name="cash" placeholder="cash" value=0>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="modal-footer">
|
|
||||||
<!--<input type="hidden" name="id" id="id" />-->
|
|
||||||
<!--<input type="hidden" name="action" id="action" value="" />-->
|
|
||||||
<input type="submit" name="run" id="run" class="btn btn-info" value="Run" />
|
|
||||||
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</div>
|
||||||
|
<div id="runModal" class="modal fade">
|
||||||
|
<div class="modal-dialog">
|
||||||
|
<form method="post" id="runForm">
|
||||||
|
<div class="modal-content">
|
||||||
|
<div class="modal-header">
|
||||||
|
<button type="button" class="close" data-dismiss="modal">×</button>
|
||||||
|
<h4 class="modal-title"><i class="fa fa-plus"></i> Run strategy</h4>
|
||||||
|
</div>
|
||||||
|
<div class="modal-body">
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="runid" class="control-label">Id</label>
|
||||||
|
<input type="text" class="form-control" id="runid" name="runid" placeholder="id" readonly>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="mode" class="control-label">Mode</label>
|
||||||
|
<select class="form-control" id="mode" name="mode"><option value="paper">paper</option><option value="live">live</option><option value="backtest">backtest</option></select>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="account" class="control-label">Account</label>
|
||||||
|
<select class="form-control" id="account" name="account"><option value="ACCOUNT1">ACCOUNT1</option><option value="ACCOUNT2">ACCOUNT2</option></select>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="debug" class="control-label">debug</label>
|
||||||
|
<select class="form-control" id="debug" name="debug"><option value="true">true</option><option value="false" selected>false</option></select>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="bt_from" class="control-label">bt_from</label>
|
||||||
|
<input type="datetime-local" class="form-control" id="bt_from" name="bt_from" placeholder="2023-04-06T09:00:00Z">
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="bt_to" class="control-label">bt_to</label>
|
||||||
|
<input type="datetime-local" class="form-control" id="bt_to" name="bt_to" placeholder="2023-04-06T09:00:00Z">
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="cash" class="control-label">cash</label>
|
||||||
|
<input type="number" class="form-control" id="cash" name="cash" placeholder="cash" value=0>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="modal-footer">
|
||||||
|
<!--<input type="hidden" name="id" id="id" />-->
|
||||||
|
<!--<input type="hidden" name="action" id="action" value="" />-->
|
||||||
|
<input type="submit" name="run" id="run" class="btn btn-info" value="Run" />
|
||||||
|
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<script type="text/javascript" src="https://unpkg.com/lightweight-charts/dist/lightweight-charts.standalone.production.js"
|
<script type="text/javascript" src="https://unpkg.com/lightweight-charts/dist/lightweight-charts.standalone.production.js"></script>
|
||||||
></script>
|
|
||||||
<script src="/static/js/mywebsocket.js"></script>
|
<script src="/static/js/mywebsocket.js"></script>
|
||||||
<script src="/static/js/mychart.js"></script>
|
<script src="/static/js/mychart.js"></script>
|
||||||
<script src="/static/js/mytables.js"></script>
|
<script src="/static/js/mytables.js"></script>
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
//const chartOptions = { layout: { textColor: 'black', background: { type: 'solid', color: 'white' } } };
|
//const chartOptions = { layout: { textColor: 'black', background: { type: 'solid', color: 'white' } } };
|
||||||
const chartOptions = { width: 800, height: 600}
|
const chartOptions = { width: 1200, height: 600}
|
||||||
const chart = LightweightCharts.createChart(document.getElementById('conteiner'), chartOptions);
|
const chart = LightweightCharts.createChart(document.getElementById('chart'), chartOptions);
|
||||||
chart.applyOptions({ timeScale: { visible: true, timeVisible: true, secondsVisible: true }, crosshair: {
|
chart.applyOptions({ timeScale: { visible: true, timeVisible: true, secondsVisible: true }, crosshair: {
|
||||||
mode: LightweightCharts.CrosshairMode.Normal, labelVisible: true
|
mode: LightweightCharts.CrosshairMode.Normal, labelVisible: true
|
||||||
}})
|
}})
|
||||||
@ -28,15 +28,12 @@ const vwapSeries = chart.addLineSeries({
|
|||||||
|
|
||||||
|
|
||||||
//TBD dynamicky zobrazovat vsechny indikatory
|
//TBD dynamicky zobrazovat vsechny indikatory
|
||||||
document.getElementById('conteiner').style.display = 'inline-block';
|
//document.getElementById('chart').style.display = 'inline-block';
|
||||||
var cont = document.getElementById('conteiner');
|
var legendlist = document.getElementById('legend');
|
||||||
var legend = document.createElement('div');
|
|
||||||
legend.classList.add('legend');
|
|
||||||
cont.appendChild(legend);
|
|
||||||
var firstRow = document.createElement('div');
|
var firstRow = document.createElement('div');
|
||||||
firstRow.innerText = '-';
|
firstRow.innerText = '-';
|
||||||
// firstRow.style.color = 'white';
|
// firstRow.style.color = 'white';
|
||||||
legend.appendChild(firstRow);
|
legendlist.appendChild(firstRow);
|
||||||
|
|
||||||
function pad(n) {
|
function pad(n) {
|
||||||
var s = ('0' + n);
|
var s = ('0' + n);
|
||||||
@ -49,7 +46,15 @@ chart.subscribeCrosshairMove((param) => {
|
|||||||
const vwap = data.value !== undefined ? data.value : data.close;
|
const vwap = data.value !== undefined ? data.value : data.close;
|
||||||
const bars = param.seriesData.get(candlestickSeries);
|
const bars = param.seriesData.get(candlestickSeries);
|
||||||
const volumes = param.seriesData.get(volumeSeries);
|
const volumes = param.seriesData.get(volumeSeries);
|
||||||
firstRow.innerText = 'VWAP' + ' ' + vwap.toFixed(2) + " O" + bars.open + " H" + bars.high + " L" + bars.low + " C" + bars.close + " V" + volumes.value;
|
firstRow.innerText = "";
|
||||||
|
//iterate of custom indicators dictionary to get values of custom lines
|
||||||
|
// var customIndicator = {name: key, series: null}
|
||||||
|
indList.forEach(function (item) {
|
||||||
|
const ind = param.seriesData.get(item.series)
|
||||||
|
firstRow.innerText += item.name + " " + ind.value + " ";
|
||||||
|
});
|
||||||
|
|
||||||
|
firstRow.innerText += 'vwap' + ' ' + vwap.toFixed(2) + " o" + bars.open + " h" + bars.high + " l" + bars.low + " c" + bars.close + " v" + volumes.value;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
firstRow.innerText = '-';
|
firstRow.innerText = '-';
|
||||||
|
|||||||
@ -9,10 +9,6 @@ function store_api_key(event) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function get_status(id) {
|
function get_status(id) {
|
||||||
|
|
||||||
// for (val of stratinRecords.rows().iterator()) {
|
|
||||||
// window.alert(JSON.stringify(val))
|
|
||||||
// }
|
|
||||||
var status = "stopped"
|
var status = "stopped"
|
||||||
runnerRecords.rows().iterator('row', function ( context, index ) {
|
runnerRecords.rows().iterator('row', function ( context, index ) {
|
||||||
var data = this.row(index).data();
|
var data = this.row(index).data();
|
||||||
@ -32,6 +28,18 @@ function get_status(id) {
|
|||||||
return status
|
return status
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function is_running(id) {
|
||||||
|
var running = false
|
||||||
|
runnerRecords.rows().iterator('row', function ( context, index ) {
|
||||||
|
var data = this.row(index).data();
|
||||||
|
//window.alert(JSON.stringify(data))
|
||||||
|
if (data.id == id) {
|
||||||
|
running = true
|
||||||
|
}
|
||||||
|
//window.alert("found") }
|
||||||
|
});
|
||||||
|
return running
|
||||||
|
}
|
||||||
// alert(JSON.stringify(stratinRecords.data()))
|
// alert(JSON.stringify(stratinRecords.data()))
|
||||||
// arr = stratinRecords.data()
|
// arr = stratinRecords.data()
|
||||||
// foreach(row in arr.rows) {
|
// foreach(row in arr.rows) {
|
||||||
@ -263,7 +271,13 @@ var stratinRecords =
|
|||||||
return '<i class="fas fa-check-circle">'+status+'</i>'
|
return '<i class="fas fa-check-circle">'+status+'</i>'
|
||||||
},
|
},
|
||||||
}],
|
}],
|
||||||
paging: false
|
paging: false,
|
||||||
|
// createdRow: function( row, data, dataIndex){
|
||||||
|
// if (is_running(data.id) ){
|
||||||
|
// alert("runner");
|
||||||
|
// $(row).addClass('highlight');
|
||||||
|
// }
|
||||||
|
//}
|
||||||
} );
|
} );
|
||||||
|
|
||||||
//runner table
|
//runner table
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
|
var indList = []
|
||||||
var ws = null;
|
var ws = null;
|
||||||
function connect(event) {
|
function connect(event) {
|
||||||
var runnerId = document.getElementById("runnerId")
|
var runnerId = document.getElementById("runnerId")
|
||||||
var indList = []
|
|
||||||
try {
|
try {
|
||||||
ws = new WebSocket("ws://localhost:8000/runners/" + runnerId.value + "/ws?api_key=" + API_KEY);
|
ws = new WebSocket("ws://localhost:8000/runners/" + runnerId.value + "/ws?api_key=" + API_KEY);
|
||||||
}
|
}
|
||||||
@ -10,7 +10,7 @@ function connect(event) {
|
|||||||
}
|
}
|
||||||
ws.onopen = function(event) {
|
ws.onopen = function(event) {
|
||||||
document.getElementById("status").textContent = "Connected to" + runnerId.value
|
document.getElementById("status").textContent = "Connected to" + runnerId.value
|
||||||
document.getElementById("bt-disc").style.display = "block"
|
document.getElementById("bt-disc").style.display = "initial"
|
||||||
document.getElementById("bt-conn").style.display = "none"
|
document.getElementById("bt-conn").style.display = "none"
|
||||||
}
|
}
|
||||||
ws.onmessage = function(event) {
|
ws.onmessage = function(event) {
|
||||||
@ -89,7 +89,7 @@ function connect(event) {
|
|||||||
ws.onclose = function(event) {
|
ws.onclose = function(event) {
|
||||||
document.getElementById("status").textContent = "Disconnected from" + runnerId.value
|
document.getElementById("status").textContent = "Disconnected from" + runnerId.value
|
||||||
document.getElementById("bt-disc").style.display = "none"
|
document.getElementById("bt-disc").style.display = "none"
|
||||||
document.getElementById("bt-conn").style.display = "block"
|
document.getElementById("bt-conn").style.display = "initial"
|
||||||
}
|
}
|
||||||
event.preventDefault()
|
event.preventDefault()
|
||||||
}
|
}
|
||||||
|
|||||||
33
v2realbot/static/main.css
Normal file
33
v2realbot/static/main.css
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
.flex-container {
|
||||||
|
display: inline-grid;
|
||||||
|
flex-direction: row;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
justify-content: flex-start;
|
||||||
|
align-items: stretch;
|
||||||
|
align-content: normal;
|
||||||
|
}
|
||||||
|
|
||||||
|
.flex-items{
|
||||||
|
display: block;
|
||||||
|
flex-grow: 0;
|
||||||
|
flex-shrink: 1;
|
||||||
|
flex-basis: auto;
|
||||||
|
align-self: auto;
|
||||||
|
order: 0;
|
||||||
|
margin-inline-start: 50px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.chartContainer {
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
|
||||||
|
.legend {
|
||||||
|
position: absolute;
|
||||||
|
color: #050505;
|
||||||
|
left: 60px;
|
||||||
|
top: 99px;
|
||||||
|
z-index: 1;
|
||||||
|
font-size: 16px;
|
||||||
|
line-height: 18px;
|
||||||
|
font-weight: 300;
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user