{ "cells": [ { "cell_type": "markdown", "id": "2d0e8e6e", "metadata": {}, "source": [ "# Eseguire la classe trader" ] }, { "cell_type": "markdown", "id": "c1ee6ef4", "metadata": {}, "source": [ "Copiare nel file trader.py:\n", "- tutti gli import\n", "- tutta la classe\n", "- alla fine il codice di esecuzione ma preceduto da
if \\_\\_name\\_\\_ == \"\\_\\_main\\_\\_\":per evitare che venga eseguito anche quanto importato" ] }, { "cell_type": "code", "execution_count": 1, "id": "033bfeb3", "metadata": {}, "outputs": [], "source": [ "import trader" ] }, { "cell_type": "code", "execution_count": 2, "id": "814b7a5e", "metadata": {}, "outputs": [], "source": [ "a = trader.Trader(\"oandaMY.cfg\",\"EUR_USD\",\"1min\", window=1, units=100000)" ] }, { "cell_type": "code", "execution_count": 3, "id": "e5869bb3", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "1 2 3 4 \n", "-------------------------------------------------\n", "2021-11-10T22:09:45.837842736Z | VADO CORTO\n", "quantita= -100000.0 | prezzo= 1.14765 | profit/loss= 0.0 | profitto totale= 0.0\n", "-------------------------------------------------\n", "5 6 7 8 9 10 \n", "-------------------------------------------------\n", "2021-11-10T22:09:56.027892640Z | CHIUDO TUTTO\n", "quantita= 100000.0 | prezzo= 1.14788 | profit/loss= -20.1405 | profitto totale= -20.1405\n", "-------------------------------------------------\n" ] } ], "source": [ "a.getMostRecent()\n", "a.stream_data(stop=10)" ] }, { "cell_type": "code", "execution_count": null, "id": "d217fe79", "metadata": {}, "outputs": [], "source": [] } ], "metadata": { "kernelspec": { "display_name": "Python 3 (ipykernel)", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.8.11" } }, "nbformat": 4, "nbformat_minor": 5 }