├── .editorconfig
├── .env.example
├── .gitattributes
├── .gitignore
├── README.md
├── TODO
├── app
├── Console
│ ├── Commands
│ │ ├── HealthCheck.php
│ │ ├── Orders.php
│ │ ├── Signals.php
│ │ └── Ticker.php
│ └── Kernel.php
├── Exceptions
│ └── Handler.php
├── Http
│ ├── Controllers
│ │ ├── ApiController.php
│ │ ├── Auth
│ │ │ ├── ForgotPasswordController.php
│ │ │ ├── LoginController.php
│ │ │ ├── RegisterController.php
│ │ │ ├── ResetPasswordController.php
│ │ │ └── VerificationController.php
│ │ ├── Controller.php
│ │ └── HomeController.php
│ ├── Kernel.php
│ └── Middleware
│ │ ├── Authenticate.php
│ │ ├── CheckForMaintenanceMode.php
│ │ ├── EncryptCookies.php
│ │ ├── RedirectIfAuthenticated.php
│ │ ├── TrimStrings.php
│ │ ├── TrustProxies.php
│ │ └── VerifyCsrfToken.php
├── Mail
│ └── SignalReceived.php
├── Modules.php
├── Modules
│ ├── CoinMarketCap.php
│ ├── CoinMarketCap
│ │ └── view
│ │ │ └── cmt_table.blade.php
│ ├── MiningHamsterSignals.php
│ ├── MiningHamsterSignals
│ │ └── view
│ │ │ └── setting.blade.php
│ ├── Statistics.php
│ └── Statistics
│ │ └── view
│ │ ├── signalStats.blade.php
│ │ └── stats.blade.php
├── Order.php
├── Price.php
├── Providers
│ ├── AppServiceProvider.php
│ ├── AuthServiceProvider.php
│ ├── BroadcastServiceProvider.php
│ ├── EventServiceProvider.php
│ └── RouteServiceProvider.php
├── Setting.php
├── Signal.php
├── Ticker.php
├── TradeHelper.php
└── User.php
├── artisan
├── bootstrap
├── app.php
└── cache
│ └── .gitignore
├── ca.pem
├── composer.json
├── composer.lock
├── config
├── app.php
├── auth.php
├── bot.php
├── broadcasting.php
├── cache.php
├── database.php
├── filesystems.php
├── hashing.php
├── logging.php
├── mail.php
├── queue.php
├── services.php
├── session.php
└── view.php
├── database
├── .gitignore
├── factories
│ └── UserFactory.php
├── migrations
│ ├── 2014_10_12_000000_create_users_table.php
│ ├── 2014_10_12_100000_create_password_resets_table.php
│ ├── 2018_12_11_141628_create_prices_table.php
│ ├── 2018_12_11_174522_create_signals_table.php
│ ├── 2018_12_11_204242_create_orders_table.php
│ ├── 2018_12_13_201621_create_modules_table.php
│ ├── 2018_12_14_162134_create_settings_table.php
│ ├── 2018_12_19_203741_add_comment_field_to_order_table.php
│ ├── 2018_12_21_144414_add_min_field_to_orders_table.php
│ ├── 2018_12_24_230217_add_rl_field_to_signals_table.php
│ ├── 2018_12_24_232542_add_starter_field_to_orders_table.php
│ ├── 2018_12_28_103218_create_ticker_table.php
│ ├── 2018_12_28_193922_add_pl_field_to_orders_table.php
│ └── 2018_12_29_203000_add_favorites_field_to_users_table.php
└── seeds
│ └── DatabaseSeeder.php
├── package-lock.json
├── package.json
├── phpunit.xml
├── public
├── .htaccess
├── ca.pem
├── css
│ └── app.css
├── favicon.ico
├── fonts
│ ├── fontawesome-webfont.eot
│ ├── fontawesome-webfont.svg
│ ├── fontawesome-webfont.ttf
│ ├── fontawesome-webfont.woff
│ ├── fontawesome-webfont.woff2
│ └── vendor
│ │ └── @fortawesome
│ │ └── fontawesome-free
│ │ ├── webfa-brands-400.eot
│ │ ├── webfa-brands-400.svg
│ │ ├── webfa-brands-400.ttf
│ │ ├── webfa-brands-400.woff
│ │ ├── webfa-brands-400.woff2
│ │ ├── webfa-regular-400.eot
│ │ ├── webfa-regular-400.svg
│ │ ├── webfa-regular-400.ttf
│ │ ├── webfa-regular-400.woff
│ │ ├── webfa-regular-400.woff2
│ │ ├── webfa-solid-900.eot
│ │ ├── webfa-solid-900.svg
│ │ ├── webfa-solid-900.ttf
│ │ ├── webfa-solid-900.woff
│ │ └── webfa-solid-900.woff2
├── images
│ └── vendor
│ │ └── jquery-ui
│ │ └── themes
│ │ └── base
│ │ ├── ui-icons_444444_256x240.png
│ │ ├── ui-icons_555555_256x240.png
│ │ ├── ui-icons_777620_256x240.png
│ │ ├── ui-icons_777777_256x240.png
│ │ ├── ui-icons_cc0000_256x240.png
│ │ └── ui-icons_ffffff_256x240.png
├── index.php
├── js
│ ├── app.js
│ └── utils.js
├── mix-manifest.json
├── robots.txt
└── svg
│ ├── 403.svg
│ ├── 404.svg
│ ├── 500.svg
│ └── 503.svg
├── resources
├── .DS_Store
├── js
│ ├── app.js
│ ├── bootstrap.js
│ └── components
│ │ └── ExampleComponent.vue
├── lang
│ └── en
│ │ ├── auth.php
│ │ ├── pagination.php
│ │ ├── passwords.php
│ │ └── validation.php
├── sass
│ ├── _variables.scss
│ ├── app.scss
│ ├── font-awesome-4.7.0
│ │ ├── HELP-US-OUT.txt
│ │ ├── css
│ │ │ ├── font-awesome.css
│ │ │ └── font-awesome.min.css
│ │ ├── fonts
│ │ │ ├── FontAwesome.otf
│ │ │ ├── fontawesome-webfont.eot
│ │ │ ├── fontawesome-webfont.svg
│ │ │ ├── fontawesome-webfont.ttf
│ │ │ ├── fontawesome-webfont.woff
│ │ │ └── fontawesome-webfont.woff2
│ │ ├── less
│ │ │ ├── animated.less
│ │ │ ├── bordered-pulled.less
│ │ │ ├── core.less
│ │ │ ├── fixed-width.less
│ │ │ ├── font-awesome.less
│ │ │ ├── icons.less
│ │ │ ├── larger.less
│ │ │ ├── list.less
│ │ │ ├── mixins.less
│ │ │ ├── path.less
│ │ │ ├── rotated-flipped.less
│ │ │ ├── screen-reader.less
│ │ │ ├── stacked.less
│ │ │ └── variables.less
│ │ └── scss
│ │ │ ├── _animated.scss
│ │ │ ├── _bordered-pulled.scss
│ │ │ ├── _core.scss
│ │ │ ├── _fixed-width.scss
│ │ │ ├── _icons.scss
│ │ │ ├── _larger.scss
│ │ │ ├── _list.scss
│ │ │ ├── _mixins.scss
│ │ │ ├── _path.scss
│ │ │ ├── _rotated-flipped.scss
│ │ │ ├── _screen-reader.scss
│ │ │ ├── _stacked.scss
│ │ │ ├── _variables.scss
│ │ │ └── font-awesome.scss
│ └── theme
│ │ ├── _bootswatch.scss
│ │ └── _variables.scss
└── views
│ ├── auth
│ ├── login.blade.php
│ ├── passwords
│ │ ├── email.blade.php
│ │ └── reset.blade.php
│ ├── register.blade.php
│ └── verify.blade.php
│ ├── css.blade.php
│ ├── email
│ └── signalReceived.blade.php
│ ├── layouts
│ ├── app.blade.php
│ ├── favorites.blade.php
│ └── menu.blade.php
│ ├── modulePage.blade.php
│ ├── pages
│ ├── history.blade.php
│ ├── modules.blade.php
│ ├── positions.blade.php
│ ├── signals.blade.php
│ └── system.blade.php
│ ├── parts
│ ├── newPosition.blade.php
│ ├── openTable.blade.php
│ ├── openTable1.blade.php
│ ├── recentPairs.blade.php
│ └── tv.blade.php
│ └── welcome.blade.php
├── routes
├── api.php
├── channels.php
├── console.php
└── web.php
├── server.php
├── services.sh
├── storage
├── app
│ ├── .gitignore
│ └── public
│ │ └── .gitignore
├── framework
│ ├── .gitignore
│ ├── cache
│ │ ├── .gitignore
│ │ └── data
│ │ │ └── .gitignore
│ ├── sessions
│ │ └── .gitignore
│ ├── testing
│ │ └── .gitignore
│ └── views
│ │ └── .gitignore
└── logs
│ └── .gitignore
├── tests
├── CreatesApplication.php
├── Feature
│ └── ExampleTest.php
├── TestCase.php
└── Unit
│ └── ExampleTest.php
└── webpack.mix.js
/.editorconfig:
--------------------------------------------------------------------------------
1 | root = true
2 |
3 | [*]
4 | charset = utf-8
5 | end_of_line = lf
6 | insert_final_newline = true
7 | indent_style = space
8 | indent_size = 4
9 | trim_trailing_whitespace = true
10 |
11 | [*.md]
12 | trim_trailing_whitespace = false
13 |
14 | [*.yml]
15 | indent_size = 2
16 |
--------------------------------------------------------------------------------
/.env.example:
--------------------------------------------------------------------------------
1 | APP_NAME=Laravel
2 | APP_ENV=local
3 | APP_KEY=
4 | APP_DEBUG=true
5 | APP_URL=http://localhost
6 |
7 | LOG_CHANNEL=stack
8 |
9 | DB_CONNECTION=mysql
10 | DB_HOST=127.0.0.1
11 | DB_PORT=3306
12 | DB_DATABASE=homestead
13 | DB_USERNAME=homestead
14 | DB_PASSWORD=secret
15 |
16 | BROADCAST_DRIVER=log
17 | CACHE_DRIVER=file
18 | QUEUE_CONNECTION=sync
19 | SESSION_DRIVER=file
20 | SESSION_LIFETIME=120
21 |
22 | REDIS_HOST=127.0.0.1
23 | REDIS_PASSWORD=null
24 | REDIS_PORT=6379
25 |
26 | MAIL_DRIVER=smtp
27 | MAIL_HOST=smtp.mailtrap.io
28 | MAIL_PORT=2525
29 | MAIL_USERNAME=null
30 | MAIL_PASSWORD=null
31 | MAIL_ENCRYPTION=null
32 |
33 | PUSHER_APP_ID=
34 | PUSHER_APP_KEY=
35 | PUSHER_APP_SECRET=
36 | PUSHER_APP_CLUSTER=mt1
37 |
38 | MIX_PUSHER_APP_KEY="${PUSHER_APP_KEY}"
39 | MIX_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}"
40 |
--------------------------------------------------------------------------------
/.gitattributes:
--------------------------------------------------------------------------------
1 | * text=auto
2 | *.css linguist-vendored
3 | *.scss linguist-vendored
4 | *.js linguist-vendored
5 | CHANGELOG.md export-ignore
6 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | /node_modules
2 | /public/hot
3 | /public/storage
4 | /storage/*.key
5 | /vendor
6 | .env
7 | .phpunit.result.cache
8 | Homestead.json
9 | Homestead.yaml
10 | npm-debug.log
11 | yarn-error.log
12 | .idea
13 | /database/database.sqlite3
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # PHPTradingBot
2 |
3 |
4 | PHPTradingBot is a modular platform written in php using Laravel to automatically trade on popuplar cryptocurrency exchanges
5 |
6 | # Features
7 |
8 | - Trade Signals API (Mining Hamster)
9 | - Floating StopLoss/TakeProfit
10 | - Binance Exchange support
11 | - Daemonized (order Daemon, Price Daemon, Signal Daemon, optional socks5 proxy daemon for binance)
12 | - Module Hook Functions
13 | -- onTick()
14 | -- OnSignalReceived()
15 | -- beforeSell()
16 | -- beforeBuy()
17 | -- AfterSell()
18 | -- AfterBuy()
19 | See /App/Modules/ProfitClone.php for example usage
20 |
21 | # Screenshots
22 | #### Signals Page
23 | 
24 | #### Order History Page
25 | 
26 | #### System Settings Page
27 | 
28 | #### Modules Page
29 | 
30 | #### Profitable Trade Cloner
31 | 
32 |
33 |
34 | ### Installation
35 |
36 | PHPTradingBot requires PHP v7.x to run.
37 |
38 | Enter these commands to install
39 |
40 | ```sh
41 | $ git clone https://github.com/kavehs87/PHPTradingBot.git
42 | $ cd PHPTradingBot
43 | $ composer install
44 | $ cp .env.example .env
45 | # set your database parameters in the .env file if you get error about APP_KEY try running this command
46 | $ php artisan key:generate
47 | ```
48 |
49 | To Start Daemons
50 |
51 | ```sh
52 | $ cd PHPTradingBot
53 | $ sh services.sh
54 | # runs and watches following commands
55 | # php artisan daemon:signals
56 | # php artisan daemon:price
57 | # php artisan daemon:orders
58 | ```
59 |
60 | To Run Development Server
61 |
62 | ```sh
63 | php artisan serve
64 | ```
65 |
66 | Verify the deployment by navigating to your server address in your preferred browser.
67 |
68 | ```sh
69 | 127.0.0.1:8000
70 | ```
71 |
72 | ### Todos
73 |
74 | - More exchanges support
75 | - More Trade Signal provider support
76 |
77 | License
78 | ----
79 |
80 | MIT
81 |
82 |
83 | **Free Software, Hell Yeah!**
84 |
--------------------------------------------------------------------------------
/TODO:
--------------------------------------------------------------------------------
1 | - [ ] Data Cleaner - garbage collection
2 | - [ ] bug with SL to TP reversal (reset trailing)
3 | - [ ] Stats module
4 | - [ ] Mining Hamster Sell Signal intervention
5 | - [ ] Modules can stop sell/buy
6 |
--------------------------------------------------------------------------------
/app/Console/Commands/HealthCheck.php:
--------------------------------------------------------------------------------
1 | exchangeInfo();
48 | $this->info('Binance is ok');
49 | } catch (\Exception $e) {
50 | $this->error('failed to communicate with binance : ' . $e->getMessage());
51 | }
52 |
53 | // signals Daemon running
54 |
55 |
56 | // orders Daemon running
57 |
58 |
59 | // Cache config is correct
60 | try {
61 | Cache::put('health', time(), now()->addMinutes(5));
62 | $this->info('Redis is ok');
63 | } catch (\Exception $exception) {
64 | $this->error('Redis is not working : ' . $exception->getMessage());
65 | }
66 | }
67 | }
68 |
--------------------------------------------------------------------------------
/app/Console/Commands/Orders.php:
--------------------------------------------------------------------------------
1 | updateState();
47 | }
48 |
49 | sleep($this->sleepInterval);
50 | }
51 | }
52 | }
53 |
--------------------------------------------------------------------------------
/app/Console/Commands/Signals.php:
--------------------------------------------------------------------------------
1 | getFactory(), 'signalLoop')) {
60 | $module->getFactory()->signalLoop();
61 | }
62 | }
63 | }
64 |
65 |
66 | // $uri = "https://www.mininghamster.com/api/v2/$apikey";
67 | // $sign = hash_hmac('sha512', $uri, $apikey);
68 | // $ch = curl_init($uri);
69 | // curl_setopt($ch, CURLOPT_HTTPHEADER, array('apisign:' . $sign));
70 | // curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
71 | // $execResult = curl_exec($ch);
72 | // $obj = json_decode($execResult);
73 | // if ($obj) {
74 | // foreach ($obj as $signal) {
75 | // Signal::firstOrCreate([
76 | // 'market' => $signal->market,
77 | // 'lastprice' => $signal->lastprice,
78 | // 'signalmode' => $signal->signalmode
79 | // ], (array)$signal);
80 | // }
81 | // Cache::put('signal', json_encode($obj), Carbon::now()->addSeconds(10));
82 | // }
83 | //
84 | //
85 | // /**
86 | // * Risk Level
87 | // */
88 | //
89 | // $urlRL = "https://www.mininghamster.com/api/v2/risklevel/ticker";
90 | // $riskLevelRawContent = file_get_contents($urlRL);
91 | // $riskLevels = json_decode($riskLevelRawContent);
92 | // Cache::put('riskLevels', $riskLevels, Carbon::now()->addMinutes(5));
93 | //
94 |
95 | sleep($this->sleepInterval);
96 | }
97 | return 0;
98 | }
99 |
100 |
101 | }
102 |
--------------------------------------------------------------------------------
/app/Console/Commands/Ticker.php:
--------------------------------------------------------------------------------
1 | getFactory();
58 | if (method_exists($_module, 'signalLoop')) {
59 | $eligibleModules[] = $_module;
60 | }
61 | }
62 | }
63 | if ($tickerType == 'full') {
64 | $this->info('WSS : Full Ticker');
65 | $binance->ticker(false, function ($api, $symbol, $tick) use ($saveTicker,$eligibleModules) {
66 | try {
67 | if ($saveTicker) {
68 | \App\Ticker::create($tick);
69 | }
70 | Cache::put($tick['symbol'], $tick, now()->addHour(1));
71 | $this->onTickEvent($tick,$eligibleModules);
72 | } catch (\Exception $exception) {
73 | $this->alert($exception->getMessage());
74 | }
75 |
76 | Cache::forever('lastTick', time());
77 | });
78 |
79 | } else {
80 | $this->info('WSS : Mini Ticker');
81 | $binance->miniTicker(function ($api, $ticker) use ($saveTicker,$eligibleModules) {
82 | try {
83 | if ($saveTicker)
84 | \App\Ticker::create($ticker);
85 | foreach ($ticker as $tick) {
86 | Cache::put($tick['symbol'], $tick, now()->addHour(1));
87 | $this->onTickEvent($tick,$eligibleModules);
88 | }
89 | } catch (\Exception $exception) {
90 | $this->alert($exception->getMessage());
91 | }
92 |
93 | Cache::forever('lastTick', time());
94 | });
95 | }
96 |
97 | unset($binance);
98 |
99 | return 0;
100 | }
101 |
102 | public function onTickEvent($tick, $eligibleModules)
103 | {
104 | foreach ($eligibleModules as $module) {
105 | $module->onTick($tick);
106 | }
107 | }
108 | }
109 |
--------------------------------------------------------------------------------
/app/Console/Kernel.php:
--------------------------------------------------------------------------------
1 | command('inspire')
36 | // ->hourly();
37 | }
38 |
39 | /**
40 | * Register the commands for the application.
41 | *
42 | * @return void
43 | */
44 | protected function commands()
45 | {
46 | $this->load(__DIR__ . '/Commands');
47 |
48 | require base_path('routes/console.php');
49 | }
50 | }
51 |
--------------------------------------------------------------------------------
/app/Exceptions/Handler.php:
--------------------------------------------------------------------------------
1 | $open->id,
23 | 'symbol' => $open->symbol,
24 | 'pl' => round($open->getPL(),2),
25 | 'qty' => $open->origQty,
26 | ];
27 | }
28 | return $positions;
29 | }
30 | }
--------------------------------------------------------------------------------
/app/Http/Controllers/Auth/ForgotPasswordController.php:
--------------------------------------------------------------------------------
1 | middleware('guest');
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/app/Http/Controllers/Auth/LoginController.php:
--------------------------------------------------------------------------------
1 | middleware('guest')->except('logout');
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/app/Http/Controllers/Auth/RegisterController.php:
--------------------------------------------------------------------------------
1 | middleware('guest');
41 | }
42 |
43 | /**
44 | * Get a validator for an incoming registration request.
45 | *
46 | * @param array $data
47 | * @return \Illuminate\Contracts\Validation\Validator
48 | */
49 | protected function validator(array $data)
50 | {
51 | return Validator::make($data, [
52 | 'name' => ['required', 'string', 'max:255'],
53 | 'email' => ['required', 'string', 'email', 'max:255', 'unique:users'],
54 | 'password' => ['required', 'string', 'min:6', 'confirmed'],
55 | ]);
56 | }
57 |
58 | /**
59 | * Create a new user instance after a valid registration.
60 | *
61 | * @param array $data
62 | * @return \App\User
63 | */
64 | protected function create(array $data)
65 | {
66 | return User::create([
67 | 'name' => $data['name'],
68 | 'email' => $data['email'],
69 | 'password' => Hash::make($data['password']),
70 | ]);
71 | }
72 | }
73 |
--------------------------------------------------------------------------------
/app/Http/Controllers/Auth/ResetPasswordController.php:
--------------------------------------------------------------------------------
1 | middleware('guest');
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/app/Http/Controllers/Auth/VerificationController.php:
--------------------------------------------------------------------------------
1 | middleware('auth');
38 | $this->middleware('signed')->only('verify');
39 | $this->middleware('throttle:6,1')->only('verify', 'resend');
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/app/Http/Controllers/Controller.php:
--------------------------------------------------------------------------------
1 | [
31 | \App\Http\Middleware\EncryptCookies::class,
32 | \Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::class,
33 | \Illuminate\Session\Middleware\StartSession::class,
34 | // \Illuminate\Session\Middleware\AuthenticateSession::class,
35 | \Illuminate\View\Middleware\ShareErrorsFromSession::class,
36 | \App\Http\Middleware\VerifyCsrfToken::class,
37 | \Illuminate\Routing\Middleware\SubstituteBindings::class,
38 | ],
39 |
40 | 'api' => [
41 | 'throttle:60,1',
42 | 'bindings',
43 | ],
44 | ];
45 |
46 | /**
47 | * The application's route middleware.
48 | *
49 | * These middleware may be assigned to groups or used individually.
50 | *
51 | * @var array
52 | */
53 | protected $routeMiddleware = [
54 | 'auth' => \App\Http\Middleware\Authenticate::class,
55 | 'auth.basic' => \Illuminate\Auth\Middleware\AuthenticateWithBasicAuth::class,
56 | 'bindings' => \Illuminate\Routing\Middleware\SubstituteBindings::class,
57 | 'cache.headers' => \Illuminate\Http\Middleware\SetCacheHeaders::class,
58 | 'can' => \Illuminate\Auth\Middleware\Authorize::class,
59 | 'guest' => \App\Http\Middleware\RedirectIfAuthenticated::class,
60 | 'signed' => \Illuminate\Routing\Middleware\ValidateSignature::class,
61 | 'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class,
62 | 'verified' => \Illuminate\Auth\Middleware\EnsureEmailIsVerified::class,
63 | ];
64 |
65 | /**
66 | * The priority-sorted list of middleware.
67 | *
68 | * This forces non-global middleware to always be in the given order.
69 | *
70 | * @var array
71 | */
72 | protected $middlewarePriority = [
73 | \Illuminate\Session\Middleware\StartSession::class,
74 | \Illuminate\View\Middleware\ShareErrorsFromSession::class,
75 | \App\Http\Middleware\Authenticate::class,
76 | \Illuminate\Session\Middleware\AuthenticateSession::class,
77 | \Illuminate\Routing\Middleware\SubstituteBindings::class,
78 | \Illuminate\Auth\Middleware\Authorize::class,
79 | ];
80 | }
81 |
--------------------------------------------------------------------------------
/app/Http/Middleware/Authenticate.php:
--------------------------------------------------------------------------------
1 | expectsJson()) {
18 | return route('login');
19 | }
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/app/Http/Middleware/CheckForMaintenanceMode.php:
--------------------------------------------------------------------------------
1 | check()) {
21 | return redirect('/home');
22 | }
23 |
24 | return $next($request);
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/app/Http/Middleware/TrimStrings.php:
--------------------------------------------------------------------------------
1 | signal = $signal;
25 | }
26 |
27 | /**
28 | * Build the message.
29 | *
30 | * @return $this
31 | */
32 | public function build()
33 | {
34 | return $this->from('kaveh.s@live.com')->view('email.signalReceived',[
35 | 'signal' => $this->signal
36 | ]);
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/app/Modules/CoinMarketCap.php:
--------------------------------------------------------------------------------
1 | 'coinMarketCap',
28 | 'text' => 'CoinMarketCap',
29 | 'module' => 'CoinMarketCap'
30 | ]];
31 | }
32 |
33 | public function coinMarketCapPage()
34 | {
35 | $coins = $this->loadCoinMarketCap();
36 |
37 |
38 | view()->addNamespace('CoinMarketCap', app_path('Modules/CoinMarketCap/view'));
39 | return view('CoinMarketCap::cmt_table', [
40 | 'coins' => $coins
41 | ]);
42 | }
43 |
44 |
45 | public function loadCoinMarketCap()
46 | {
47 | $binance_pairs = \App\TradeHelper::getSymbols() ?? [];
48 |
49 | libxml_use_internal_errors(true);
50 |
51 | if (!Cache::has('cmk')) {
52 | $url = 'https://coinmarketcap.com/coins/views/all/';
53 | $content = file_get_contents($url);
54 | Cache::put('cmk', $content, Carbon::now()->addMinutes(5));
55 | } else {
56 | $content = Cache::get('cmk');
57 | }
58 |
59 | $dom = new DOMDocument();
60 | $dom->loadHTML($content);
61 |
62 | $allCoinsTable = $dom->getElementById('currencies-all');
63 | $tbody = $allCoinsTable->getElementsByTagName('tbody');
64 | $r = 1;
65 | $row = [];
66 | foreach ($tbody->item(0)->childNodes as $tr) {
67 |
68 | $nodeType = $tr->nodeType;
69 | if ($nodeType == 1) {
70 | $tds = $tr->getElementsByTagName('td');
71 | $coin = trim($tds->item(2)->nodeValue) . 'BTC';
72 | for ($i = 0; $i < $tds->length; $i++) {
73 | if (in_array($coin, $binance_pairs) || $coin == 'BTCBTC') {
74 | if ($i != 10) {
75 | $row[$r][] = trim($tds->item($i)->nodeValue);
76 | }
77 | }
78 | }
79 | }
80 | $r++;
81 | }
82 | return $row;
83 | }
84 | }
--------------------------------------------------------------------------------
/app/Modules/CoinMarketCap/view/cmt_table.blade.php:
--------------------------------------------------------------------------------
1 |
2 |
3 | Coin Market Cap coins for Binance
4 |
5 |
6 |
7 |
8 |
9 |
10 | Symbol
11 | Market Cap
12 | Price
13 | Supply
14 | Volume (24h)
15 | % 1h
16 | % 24h
17 | % 7d
18 |
19 |
20 |
21 | @foreach($coins as $coin)
22 |
23 | {{$coin[2]}}
24 | {{$coin[3]}}
25 | {{$coin[4]}}
26 | {{$coin[5]}}
27 | {{$coin[6]}}
28 | 0) class="bg-success" @else class="bg-danger" @endif>{{$coin[7]}}
29 | 0) class="bg-success" @else class="bg-danger" @endif>{{$coin[8]}}
30 | 0) class="bg-success" @else class="bg-danger" @endif>{{$coin[9]}}
31 |
32 | @endforeach
33 |
34 |
35 |
36 |
--------------------------------------------------------------------------------
/app/Modules/MiningHamsterSignals.php:
--------------------------------------------------------------------------------
1 | 'MiningHamsterSignals',
27 | 'text' => 'Mining Hamster',
28 | 'module' => 'MiningHamsterSignals'
29 | ],
30 | ];
31 | }
32 |
33 | public function MiningHamsterSignalsPage(Request $request)
34 | {
35 | if ($request->isMethod('post')) {
36 | if ($request->get('exchange') == null) {
37 | return redirect()->back()->withErrors('at least one exchange should be selected');
38 | }
39 | $exchange = array_keys($request->get('exchange'));
40 | $volume = $request->get('volume');
41 | $apiKey = $request->get('apiKey');
42 |
43 | $this->setConfig([
44 | 'exchange' => $exchange,
45 | 'volume' => $volume,
46 | 'apiKey' => $apiKey
47 | ]);
48 |
49 | return redirect()->back();
50 |
51 | } else {
52 | view()->addNamespace('MiningHamsterSignals', app_path('Modules/MiningHamsterSignals/view'));
53 | return view('MiningHamsterSignals::setting', [
54 | 'config' => $this->getConfig(),
55 | 'signals' => $this->getSignals()
56 | ]);
57 | }
58 | }
59 |
60 | public function signalLoop()
61 | {
62 | $this->_getRiskLevels();
63 | $this->_getSignals();
64 |
65 | $config = $this->getConfig();
66 | if (!$config)
67 | return false;
68 |
69 |
70 | if (!empty($signals = $this->getSignals())) {
71 | foreach ($signals as $signal) {
72 | if ($config['volume'] > $signal['basevolume'])
73 | continue;
74 |
75 | if (!in_array($signal['exchange'], $config['exchange'] ?? []))
76 | continue;
77 |
78 | $signal['module'] = 'MiningHamster';
79 | Signal::firstOrCreate([
80 | 'market' => $signal['market'],
81 | 'lastprice' => $signal['lastprice'],
82 | 'signalmode' => $signal['signalmode']
83 | ], (array)$signal);
84 | }
85 | }
86 | }
87 |
88 | public function getSignals()
89 | {
90 | $signals = json_decode(Cache::get('signal'), true) ?? null;
91 | $riskLevels = Cache::get('riskLevels') ?? null;
92 | $signalsWithRiskLevels = [];
93 | if ($signals) {
94 | foreach ($signals as $i => $signal) {
95 | $signalsWithRiskLevels[$i] = $signal;
96 | if (isset($riskLevels[$signal['exchange'] . '-' . $signal['market']])) {
97 | $signalsWithRiskLevels[$i]['rl'] = $riskLevels[$signal['exchange'] . '-' . $signal['market']]->risklevel;
98 | } else {
99 | $signalsWithRiskLevels[$i]['rl'] = 0;
100 | }
101 | }
102 | }
103 | return $signalsWithRiskLevels;
104 | }
105 |
106 |
107 | protected function _getSignals()
108 | {
109 | $config = $this->getConfig();
110 | $apikey = $config['apiKey'] ?? null;
111 | $uri = "https://www.mininghamster.com/api/v2/" . $apikey;
112 | $sign = hash_hmac('sha512', $uri, $apikey);
113 | $ch = curl_init($uri);
114 | curl_setopt($ch, CURLOPT_HTTPHEADER, array('apisign:' . $sign));
115 | curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
116 | $execResult = curl_exec($ch);
117 | $obj = json_decode($execResult);
118 | if ($obj) {
119 | Cache::put('signal', json_encode($obj), Carbon::now()->addSeconds(10));
120 | }
121 | return $obj;
122 | }
123 |
124 | protected function _getRiskLevels()
125 | {
126 | $urlRL = "https://www.mininghamster.com/api/v2/risklevel/ticker";
127 | $riskLevelRawContent = file_get_contents($urlRL);
128 | $riskLevels = json_decode($riskLevelRawContent);
129 | $riskLevelsAssoc = [];
130 | foreach ($riskLevels->risklevel as $riskLevel) {
131 | $riskLevelsAssoc[$riskLevel->exchange . '-' . $riskLevel->market] = $riskLevel;
132 | }
133 | Cache::put('riskLevels', $riskLevelsAssoc, Carbon::now()->addMinutes(5));
134 | return $riskLevels;
135 | }
136 | }
--------------------------------------------------------------------------------
/app/Modules/MiningHamsterSignals/view/setting.blade.php:
--------------------------------------------------------------------------------
1 |
81 |
82 |
83 |
--------------------------------------------------------------------------------
/app/Modules/Statistics/view/signalStats.blade.php:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Signal Performance Today
5 |
6 |
7 |
8 |
13 |
14 |
15 | Total successful trades : {{$profitCount}}
16 |
17 |
18 | Total USDT : {{$totalProfit}}
19 |
20 |
21 | Total Percentage : {{$totalProfitPercent}}
22 |
23 |
24 | Highest profit : {{$highestProfit->symbol ?? 'N/A'}} : {{$highestProfit ? $highestProfit->getPL(true) : '-'}}
25 |
26 |
27 |
28 |
29 |
30 |
35 |
36 |
37 | Total failed trades : {{$lossCount}}
38 |
39 |
40 | Total USDT : {{$totalLoss}}
41 |
42 |
43 | Total Percentage : {{$totalLossPercent}}
44 |
45 |
46 | Highest loss :{{$highestLoss->symbol ?? 'N/A'}} : {{$highestLoss ? $highestLoss->getPL(true) : '-'}}
47 |
48 |
49 |
50 |
51 |
52 |
57 |
58 |
59 | Overall Performance :
60 |
61 |
62 | Day Income : {{round($totalProfit - abs($totalLoss),3)}} USDT
63 |
64 |
65 | Total Money Used : {{$totalMoneyUsed}} USDT
66 |
67 |
68 | binance fee : {{$totalMoneyUsed - \App\TradeHelper::calcPercent($totalMoneyUsed,0.2)}} USDT
69 |
70 |
71 |
72 |
73 |
--------------------------------------------------------------------------------
/app/Modules/Statistics/view/stats.blade.php:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Statistics for Today
5 |
6 |
7 |
8 |
13 |
14 |
15 | Total successful trades : {{$profitCount}}
16 |
17 |
18 | Total USDT : {{$totalProfit}}
19 |
20 |
21 | Total Percentage : {{$totalProfitPercent}}
22 |
23 |
24 | Highest profit : {{$highestProfit->symbol ?? 'N/A'}} : {{$highestProfit ? $highestProfit->getPL(true) : '-'}}
25 |
26 |
27 |
28 |
29 |
30 |
35 |
36 |
37 | Total failed trades : {{$lossCount}}
38 |
39 |
40 | Total USDT : {{$totalLoss}}
41 |
42 |
43 | Total Percentage : {{$totalLossPercent}}
44 |
45 |
46 | Highest loss :{{$highestLoss->symbol ?? 'N/A'}} : {{$highestLoss ? $highestLoss->getPL(true) : '-'}}
47 |
48 |
49 |
50 |
51 |
52 |
57 |
58 |
59 | Overall Performance :
60 |
61 |
62 | Day Income : {{round($totalProfit - abs($totalLoss),3)}} USDT
63 |
64 |
65 | Total Money Used : {{$totalMoneyUsed}} USDT
66 |
67 |
68 | binance fee : {{$totalMoneyUsed - \App\TradeHelper::calcPercent($totalMoneyUsed,0.2)}} USDT
69 |
70 |
71 |
72 |
73 |
--------------------------------------------------------------------------------
/app/Price.php:
--------------------------------------------------------------------------------
1 | 'App\Policies\ModelPolicy',
17 | ];
18 |
19 | /**
20 | * Register any authentication / authorization services.
21 | *
22 | * @return void
23 | */
24 | public function boot()
25 | {
26 | $this->registerPolicies();
27 |
28 | //
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/app/Providers/BroadcastServiceProvider.php:
--------------------------------------------------------------------------------
1 | [
19 | SendEmailVerificationNotification::class,
20 | ],
21 | ];
22 |
23 | /**
24 | * Register any events for your application.
25 | *
26 | * @return void
27 | */
28 | public function boot()
29 | {
30 | parent::boot();
31 |
32 | //
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/app/Providers/RouteServiceProvider.php:
--------------------------------------------------------------------------------
1 | mapApiRoutes();
39 |
40 | $this->mapWebRoutes();
41 |
42 | //
43 | }
44 |
45 | /**
46 | * Define the "web" routes for the application.
47 | *
48 | * These routes all receive session state, CSRF protection, etc.
49 | *
50 | * @return void
51 | */
52 | protected function mapWebRoutes()
53 | {
54 | Route::middleware('web')
55 | ->namespace($this->namespace)
56 | ->group(base_path('routes/web.php'));
57 | }
58 |
59 | /**
60 | * Define the "api" routes for the application.
61 | *
62 | * These routes are typically stateless.
63 | *
64 | * @return void
65 | */
66 | protected function mapApiRoutes()
67 | {
68 | Route::prefix('api')
69 | ->middleware('api')
70 | ->namespace($this->namespace)
71 | ->group(base_path('routes/api.php'));
72 | }
73 | }
74 |
--------------------------------------------------------------------------------
/app/Setting.php:
--------------------------------------------------------------------------------
1 | first();
22 | if (isset($record) && !empty($record)) {
23 | return json_decode($record->value,true);
24 | }
25 | return $default;
26 | }
27 |
28 | public static function hasValue($key)
29 | {
30 | $record = self::where('key', $key)->count();
31 | return $record;
32 | }
33 |
34 | public static function setValue($key, $value)
35 | {
36 | if (self::hasValue($key)) {
37 | $record = self::where('key', $key)->first();
38 | $record->value = json_encode($value);
39 | return $record->save();
40 | } else {
41 | return self::create([
42 | 'key' => $key,
43 | 'value' => json_encode($value)
44 | ]);
45 | }
46 | }
47 |
48 | }
--------------------------------------------------------------------------------
/app/Signal.php:
--------------------------------------------------------------------------------
1 | signalmode == 'buy') {
27 | $symbol = TradeHelper::market2symbol($model->market);
28 |
29 | /*
30 | * Module Signals received hook
31 | */
32 | $activeModules = Modules::getActiveModules();
33 | if ($activeModules) {
34 | foreach ($activeModules as $module) {
35 | $module->getFactory()->onSignalReceived($model);
36 | }
37 | }
38 | $defaultQuantity = Setting::getValue('orderDefaults')['amount'];
39 | Order::buy($symbol, $defaultQuantity, '', [
40 | 'signal_id' => $model->signalID
41 | ]);
42 | }
43 | });
44 | }
45 | }
--------------------------------------------------------------------------------
/app/Ticker.php:
--------------------------------------------------------------------------------
1 | make(Illuminate\Contracts\Console\Kernel::class);
34 |
35 | $status = $kernel->handle(
36 | $input = new Symfony\Component\Console\Input\ArgvInput,
37 | new Symfony\Component\Console\Output\ConsoleOutput
38 | );
39 |
40 | /*
41 | |--------------------------------------------------------------------------
42 | | Shutdown The Application
43 | |--------------------------------------------------------------------------
44 | |
45 | | Once Artisan has finished running, we will fire off the shutdown events
46 | | so that any final work may be done by the application before we shut
47 | | down the process. This is the last thing to happen to the request.
48 | |
49 | */
50 |
51 | $kernel->terminate($input, $status);
52 |
53 | exit($status);
54 |
--------------------------------------------------------------------------------
/bootstrap/app.php:
--------------------------------------------------------------------------------
1 | singleton(
30 | Illuminate\Contracts\Http\Kernel::class,
31 | App\Http\Kernel::class
32 | );
33 |
34 | $app->singleton(
35 | Illuminate\Contracts\Console\Kernel::class,
36 | App\Console\Kernel::class
37 | );
38 |
39 | $app->singleton(
40 | Illuminate\Contracts\Debug\ExceptionHandler::class,
41 | App\Exceptions\Handler::class
42 | );
43 |
44 | /*
45 | |--------------------------------------------------------------------------
46 | | Return The Application
47 | |--------------------------------------------------------------------------
48 | |
49 | | This script returns the application instance. The instance is given to
50 | | the calling script so we can separate the building of the instances
51 | | from the actual running of the application and sending responses.
52 | |
53 | */
54 |
55 | return $app;
56 |
--------------------------------------------------------------------------------
/bootstrap/cache/.gitignore:
--------------------------------------------------------------------------------
1 | *
2 | !.gitignore
3 |
--------------------------------------------------------------------------------
/composer.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "kavehs87/php-trading-bot",
3 | "type": "project",
4 | "description": "Php Laravel Crypto-currency trading robot",
5 | "keywords": [
6 | "mininghamster",
7 | "crypto",
8 | "robot",
9 | "trade"
10 | ],
11 | "license": "MIT",
12 | "require": {
13 | "php": "^7.1.3",
14 | "fideloper/proxy": "^4.0",
15 | "jaggedsoft/php-binance-api": "@dev",
16 | "laravel/framework": "5.7.*",
17 | "laravel/tinker": "^1.0",
18 | "predis/predis": "^1.1"
19 | },
20 | "require-dev": {
21 | "beyondcode/laravel-dump-server": "^1.0",
22 | "filp/whoops": "^2.0",
23 | "fzaninotto/faker": "^1.4",
24 | "mockery/mockery": "^1.0",
25 | "nunomaduro/collision": "^2.0",
26 | "phpunit/phpunit": "^7.0"
27 | },
28 | "config": {
29 | "optimize-autoloader": true,
30 | "preferred-install": "dist",
31 | "sort-packages": true
32 | },
33 | "extra": {
34 | "laravel": {
35 | "dont-discover": []
36 | }
37 | },
38 | "autoload": {
39 | "psr-4": {
40 | "App\\": "app/"
41 | },
42 | "classmap": [
43 | "database/seeds",
44 | "database/factories"
45 | ]
46 | },
47 | "autoload-dev": {
48 | "psr-4": {
49 | "Tests\\": "tests/"
50 | }
51 | },
52 | "minimum-stability": "dev",
53 | "prefer-stable": true,
54 | "scripts": {
55 | "post-autoload-dump": [
56 | "Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
57 | "@php artisan package:discover --ansi"
58 | ],
59 | "post-root-package-install": [
60 | "@php -r \"file_exists('.env') || copy('.env.example', '.env');\""
61 | ],
62 | "post-create-project-cmd": [
63 | "@php artisan key:generate --ansi"
64 | ]
65 | }
66 | }
67 |
--------------------------------------------------------------------------------
/config/auth.php:
--------------------------------------------------------------------------------
1 | [
17 | 'guard' => 'web',
18 | 'passwords' => 'users',
19 | ],
20 |
21 | /*
22 | |--------------------------------------------------------------------------
23 | | Authentication Guards
24 | |--------------------------------------------------------------------------
25 | |
26 | | Next, you may define every authentication guard for your application.
27 | | Of course, a great default configuration has been defined for you
28 | | here which uses session storage and the Eloquent user provider.
29 | |
30 | | All authentication drivers have a user provider. This defines how the
31 | | users are actually retrieved out of your database or other storage
32 | | mechanisms used by this application to persist your user's data.
33 | |
34 | | Supported: "session", "token"
35 | |
36 | */
37 |
38 | 'guards' => [
39 | 'web' => [
40 | 'driver' => 'session',
41 | 'provider' => 'users',
42 | ],
43 |
44 | 'api' => [
45 | 'driver' => 'token',
46 | 'provider' => 'users',
47 | ],
48 | ],
49 |
50 | /*
51 | |--------------------------------------------------------------------------
52 | | User Providers
53 | |--------------------------------------------------------------------------
54 | |
55 | | All authentication drivers have a user provider. This defines how the
56 | | users are actually retrieved out of your database or other storage
57 | | mechanisms used by this application to persist your user's data.
58 | |
59 | | If you have multiple user tables or models you may configure multiple
60 | | sources which represent each model / table. These sources may then
61 | | be assigned to any extra authentication guards you have defined.
62 | |
63 | | Supported: "database", "eloquent"
64 | |
65 | */
66 |
67 | 'providers' => [
68 | 'users' => [
69 | 'driver' => 'eloquent',
70 | 'model' => App\User::class,
71 | ],
72 |
73 | // 'users' => [
74 | // 'driver' => 'database',
75 | // 'table' => 'users',
76 | // ],
77 | ],
78 |
79 | /*
80 | |--------------------------------------------------------------------------
81 | | Resetting Passwords
82 | |--------------------------------------------------------------------------
83 | |
84 | | You may specify multiple password reset configurations if you have more
85 | | than one user table or model in the application and you want to have
86 | | separate password reset settings based on the specific user types.
87 | |
88 | | The expire time is the number of minutes that the reset token should be
89 | | considered valid. This security feature keeps tokens short-lived so
90 | | they have less time to be guessed. You may change this as needed.
91 | |
92 | */
93 |
94 | 'passwords' => [
95 | 'users' => [
96 | 'provider' => 'users',
97 | 'table' => 'password_resets',
98 | 'expire' => 60,
99 | ],
100 | ],
101 |
102 | ];
103 |
--------------------------------------------------------------------------------
/config/bot.php:
--------------------------------------------------------------------------------
1 | '0.3dev'
5 | ];
--------------------------------------------------------------------------------
/config/broadcasting.php:
--------------------------------------------------------------------------------
1 | env('BROADCAST_DRIVER', 'null'),
19 |
20 | /*
21 | |--------------------------------------------------------------------------
22 | | Broadcast Connections
23 | |--------------------------------------------------------------------------
24 | |
25 | | Here you may define all of the broadcast connections that will be used
26 | | to broadcast events to other systems or over websockets. Samples of
27 | | each available type of connection are provided inside this array.
28 | |
29 | */
30 |
31 | 'connections' => [
32 |
33 | 'pusher' => [
34 | 'driver' => 'pusher',
35 | 'key' => env('PUSHER_APP_KEY'),
36 | 'secret' => env('PUSHER_APP_SECRET'),
37 | 'app_id' => env('PUSHER_APP_ID'),
38 | 'options' => [
39 | 'cluster' => env('PUSHER_APP_CLUSTER'),
40 | 'encrypted' => true,
41 | ],
42 | ],
43 |
44 | 'redis' => [
45 | 'driver' => 'redis',
46 | 'connection' => 'default',
47 | ],
48 |
49 | 'log' => [
50 | 'driver' => 'log',
51 | ],
52 |
53 | 'null' => [
54 | 'driver' => 'null',
55 | ],
56 |
57 | ],
58 |
59 | ];
60 |
--------------------------------------------------------------------------------
/config/cache.php:
--------------------------------------------------------------------------------
1 | env('CACHE_DRIVER', 'file'),
21 |
22 | /*
23 | |--------------------------------------------------------------------------
24 | | Cache Stores
25 | |--------------------------------------------------------------------------
26 | |
27 | | Here you may define all of the cache "stores" for your application as
28 | | well as their drivers. You may even define multiple stores for the
29 | | same cache driver to group types of items stored in your caches.
30 | |
31 | */
32 |
33 | 'stores' => [
34 |
35 | 'apc' => [
36 | 'driver' => 'apc',
37 | ],
38 |
39 | 'array' => [
40 | 'driver' => 'array',
41 | ],
42 |
43 | 'database' => [
44 | 'driver' => 'database',
45 | 'table' => 'cache',
46 | 'connection' => null,
47 | ],
48 |
49 | 'file' => [
50 | 'driver' => 'file',
51 | 'path' => storage_path('framework/cache/data'),
52 | ],
53 |
54 | 'memcached' => [
55 | 'driver' => 'memcached',
56 | 'persistent_id' => env('MEMCACHED_PERSISTENT_ID'),
57 | 'sasl' => [
58 | env('MEMCACHED_USERNAME'),
59 | env('MEMCACHED_PASSWORD'),
60 | ],
61 | 'options' => [
62 | // Memcached::OPT_CONNECT_TIMEOUT => 2000,
63 | ],
64 | 'servers' => [
65 | [
66 | 'host' => env('MEMCACHED_HOST', '127.0.0.1'),
67 | 'port' => env('MEMCACHED_PORT', 11211),
68 | 'weight' => 100,
69 | ],
70 | ],
71 | ],
72 |
73 | 'redis' => [
74 | 'driver' => 'redis',
75 | 'connection' => 'cache',
76 | ],
77 |
78 | ],
79 |
80 | /*
81 | |--------------------------------------------------------------------------
82 | | Cache Key Prefix
83 | |--------------------------------------------------------------------------
84 | |
85 | | When utilizing a RAM based store such as APC or Memcached, there might
86 | | be other applications utilizing the same cache. So, we'll specify a
87 | | value to get prefixed to all our keys so we can avoid collisions.
88 | |
89 | */
90 |
91 | 'prefix' => env('CACHE_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_').'_cache'),
92 |
93 | ];
94 |
--------------------------------------------------------------------------------
/config/database.php:
--------------------------------------------------------------------------------
1 | env('DB_CONNECTION', 'mysql'),
17 |
18 | /*
19 | |--------------------------------------------------------------------------
20 | | Database Connections
21 | |--------------------------------------------------------------------------
22 | |
23 | | Here are each of the database connections setup for your application.
24 | | Of course, examples of configuring each database platform that is
25 | | supported by Laravel is shown below to make development simple.
26 | |
27 | |
28 | | All database work in Laravel is done through the PHP PDO facilities
29 | | so make sure you have the driver for your particular database of
30 | | choice installed on your machine before you begin development.
31 | |
32 | */
33 |
34 | 'connections' => [
35 |
36 | 'sqlite' => [
37 | 'driver' => 'sqlite',
38 | 'database' => env('DB_DATABASE', database_path('database.sqlite')),
39 | 'prefix' => '',
40 | 'foreign_key_constraints' => env('DB_FOREIGN_KEYS', true),
41 | ],
42 |
43 | 'mysql' => [
44 | 'driver' => 'mysql',
45 | 'host' => env('DB_HOST', '127.0.0.1'),
46 | 'port' => env('DB_PORT', '3306'),
47 | 'database' => env('DB_DATABASE', 'forge'),
48 | 'username' => env('DB_USERNAME', 'forge'),
49 | 'password' => env('DB_PASSWORD', ''),
50 | 'unix_socket' => env('DB_SOCKET', ''),
51 | 'charset' => 'utf8mb4',
52 | 'collation' => 'utf8mb4_unicode_ci',
53 | 'prefix' => '',
54 | 'prefix_indexes' => true,
55 | 'strict' => true,
56 | 'engine' => null,
57 | ],
58 |
59 | 'pgsql' => [
60 | 'driver' => 'pgsql',
61 | 'host' => env('DB_HOST', '127.0.0.1'),
62 | 'port' => env('DB_PORT', '5432'),
63 | 'database' => env('DB_DATABASE', 'forge'),
64 | 'username' => env('DB_USERNAME', 'forge'),
65 | 'password' => env('DB_PASSWORD', ''),
66 | 'charset' => 'utf8',
67 | 'prefix' => '',
68 | 'prefix_indexes' => true,
69 | 'schema' => 'public',
70 | 'sslmode' => 'prefer',
71 | ],
72 |
73 | 'sqlsrv' => [
74 | 'driver' => 'sqlsrv',
75 | 'host' => env('DB_HOST', 'localhost'),
76 | 'port' => env('DB_PORT', '1433'),
77 | 'database' => env('DB_DATABASE', 'forge'),
78 | 'username' => env('DB_USERNAME', 'forge'),
79 | 'password' => env('DB_PASSWORD', ''),
80 | 'charset' => 'utf8',
81 | 'prefix' => '',
82 | 'prefix_indexes' => true,
83 | ],
84 |
85 | ],
86 |
87 | /*
88 | |--------------------------------------------------------------------------
89 | | Migration Repository Table
90 | |--------------------------------------------------------------------------
91 | |
92 | | This table keeps track of all the migrations that have already run for
93 | | your application. Using this information, we can determine which of
94 | | the migrations on disk haven't actually been run in the database.
95 | |
96 | */
97 |
98 | 'migrations' => 'migrations',
99 |
100 | /*
101 | |--------------------------------------------------------------------------
102 | | Redis Databases
103 | |--------------------------------------------------------------------------
104 | |
105 | | Redis is an open source, fast, and advanced key-value store that also
106 | | provides a richer body of commands than a typical key-value system
107 | | such as APC or Memcached. Laravel makes it easy to dig right in.
108 | |
109 | */
110 |
111 | 'redis' => [
112 |
113 | 'client' => 'predis',
114 |
115 | 'default' => [
116 | 'host' => env('REDIS_HOST', '127.0.0.1'),
117 | 'password' => env('REDIS_PASSWORD', null),
118 | 'port' => env('REDIS_PORT', 6379),
119 | 'database' => env('REDIS_DB', 0),
120 | ],
121 |
122 | 'cache' => [
123 | 'host' => env('REDIS_HOST', '127.0.0.1'),
124 | 'password' => env('REDIS_PASSWORD', null),
125 | 'port' => env('REDIS_PORT', 6379),
126 | 'database' => env('REDIS_CACHE_DB', 1),
127 | ],
128 |
129 | ],
130 |
131 | ];
132 |
--------------------------------------------------------------------------------
/config/filesystems.php:
--------------------------------------------------------------------------------
1 | env('FILESYSTEM_DRIVER', 'local'),
17 |
18 | /*
19 | |--------------------------------------------------------------------------
20 | | Default Cloud Filesystem Disk
21 | |--------------------------------------------------------------------------
22 | |
23 | | Many applications store files both locally and in the cloud. For this
24 | | reason, you may specify a default "cloud" driver here. This driver
25 | | will be bound as the Cloud disk implementation in the container.
26 | |
27 | */
28 |
29 | 'cloud' => env('FILESYSTEM_CLOUD', 's3'),
30 |
31 | /*
32 | |--------------------------------------------------------------------------
33 | | Filesystem Disks
34 | |--------------------------------------------------------------------------
35 | |
36 | | Here you may configure as many filesystem "disks" as you wish, and you
37 | | may even configure multiple disks of the same driver. Defaults have
38 | | been setup for each driver as an example of the required options.
39 | |
40 | | Supported Drivers: "local", "ftp", "sftp", "s3", "rackspace"
41 | |
42 | */
43 |
44 | 'disks' => [
45 |
46 | 'local' => [
47 | 'driver' => 'local',
48 | 'root' => storage_path('app'),
49 | ],
50 |
51 | 'public' => [
52 | 'driver' => 'local',
53 | 'root' => storage_path('app/public'),
54 | 'url' => env('APP_URL').'/storage',
55 | 'visibility' => 'public',
56 | ],
57 |
58 | 's3' => [
59 | 'driver' => 's3',
60 | 'key' => env('AWS_ACCESS_KEY_ID'),
61 | 'secret' => env('AWS_SECRET_ACCESS_KEY'),
62 | 'region' => env('AWS_DEFAULT_REGION'),
63 | 'bucket' => env('AWS_BUCKET'),
64 | 'url' => env('AWS_URL'),
65 | ],
66 |
67 | ],
68 |
69 | ];
70 |
--------------------------------------------------------------------------------
/config/hashing.php:
--------------------------------------------------------------------------------
1 | 'bcrypt',
19 |
20 | /*
21 | |--------------------------------------------------------------------------
22 | | Bcrypt Options
23 | |--------------------------------------------------------------------------
24 | |
25 | | Here you may specify the configuration options that should be used when
26 | | passwords are hashed using the Bcrypt algorithm. This will allow you
27 | | to control the amount of time it takes to hash the given password.
28 | |
29 | */
30 |
31 | 'bcrypt' => [
32 | 'rounds' => env('BCRYPT_ROUNDS', 10),
33 | ],
34 |
35 | /*
36 | |--------------------------------------------------------------------------
37 | | Argon Options
38 | |--------------------------------------------------------------------------
39 | |
40 | | Here you may specify the configuration options that should be used when
41 | | passwords are hashed using the Argon algorithm. These will allow you
42 | | to control the amount of time it takes to hash the given password.
43 | |
44 | */
45 |
46 | 'argon' => [
47 | 'memory' => 1024,
48 | 'threads' => 2,
49 | 'time' => 2,
50 | ],
51 |
52 | ];
53 |
--------------------------------------------------------------------------------
/config/logging.php:
--------------------------------------------------------------------------------
1 | env('LOG_CHANNEL', 'stack'),
20 |
21 | /*
22 | |--------------------------------------------------------------------------
23 | | Log Channels
24 | |--------------------------------------------------------------------------
25 | |
26 | | Here you may configure the log channels for your application. Out of
27 | | the box, Laravel uses the Monolog PHP logging library. This gives
28 | | you a variety of powerful log handlers / formatters to utilize.
29 | |
30 | | Available Drivers: "single", "daily", "slack", "syslog",
31 | | "errorlog", "monolog",
32 | | "custom", "stack"
33 | |
34 | */
35 |
36 | 'channels' => [
37 | 'stack' => [
38 | 'driver' => 'stack',
39 | 'channels' => ['daily'],
40 | ],
41 |
42 | 'single' => [
43 | 'driver' => 'single',
44 | 'path' => storage_path('logs/laravel.log'),
45 | 'level' => 'debug',
46 | ],
47 |
48 | 'daily' => [
49 | 'driver' => 'daily',
50 | 'path' => storage_path('logs/laravel.log'),
51 | 'level' => 'debug',
52 | 'days' => 14,
53 | ],
54 |
55 | 'slack' => [
56 | 'driver' => 'slack',
57 | 'url' => env('LOG_SLACK_WEBHOOK_URL'),
58 | 'username' => 'Laravel Log',
59 | 'emoji' => ':boom:',
60 | 'level' => 'critical',
61 | ],
62 |
63 | 'papertrail' => [
64 | 'driver' => 'monolog',
65 | 'level' => 'debug',
66 | 'handler' => SyslogUdpHandler::class,
67 | 'handler_with' => [
68 | 'host' => env('PAPERTRAIL_URL'),
69 | 'port' => env('PAPERTRAIL_PORT'),
70 | ],
71 | ],
72 |
73 | 'stderr' => [
74 | 'driver' => 'monolog',
75 | 'handler' => StreamHandler::class,
76 | 'with' => [
77 | 'stream' => 'php://stderr',
78 | ],
79 | ],
80 |
81 | 'syslog' => [
82 | 'driver' => 'syslog',
83 | 'level' => 'debug',
84 | ],
85 |
86 | 'errorlog' => [
87 | 'driver' => 'errorlog',
88 | 'level' => 'debug',
89 | ],
90 | ],
91 |
92 | ];
93 |
--------------------------------------------------------------------------------
/config/queue.php:
--------------------------------------------------------------------------------
1 | env('QUEUE_CONNECTION', 'sync'),
17 |
18 | /*
19 | |--------------------------------------------------------------------------
20 | | Queue Connections
21 | |--------------------------------------------------------------------------
22 | |
23 | | Here you may configure the connection information for each server that
24 | | is used by your application. A default configuration has been added
25 | | for each back-end shipped with Laravel. You are free to add more.
26 | |
27 | | Drivers: "sync", "database", "beanstalkd", "sqs", "redis", "null"
28 | |
29 | */
30 |
31 | 'connections' => [
32 |
33 | 'sync' => [
34 | 'driver' => 'sync',
35 | ],
36 |
37 | 'database' => [
38 | 'driver' => 'database',
39 | 'table' => 'jobs',
40 | 'queue' => 'default',
41 | 'retry_after' => 90,
42 | ],
43 |
44 | 'beanstalkd' => [
45 | 'driver' => 'beanstalkd',
46 | 'host' => 'localhost',
47 | 'queue' => 'default',
48 | 'retry_after' => 90,
49 | ],
50 |
51 | 'sqs' => [
52 | 'driver' => 'sqs',
53 | 'key' => env('SQS_KEY', 'your-public-key'),
54 | 'secret' => env('SQS_SECRET', 'your-secret-key'),
55 | 'prefix' => env('SQS_PREFIX', 'https://sqs.us-east-1.amazonaws.com/your-account-id'),
56 | 'queue' => env('SQS_QUEUE', 'your-queue-name'),
57 | 'region' => env('SQS_REGION', 'us-east-1'),
58 | ],
59 |
60 | 'redis' => [
61 | 'driver' => 'redis',
62 | 'connection' => 'default',
63 | 'queue' => env('REDIS_QUEUE', 'default'),
64 | 'retry_after' => 90,
65 | 'block_for' => null,
66 | ],
67 |
68 | ],
69 |
70 | /*
71 | |--------------------------------------------------------------------------
72 | | Failed Queue Jobs
73 | |--------------------------------------------------------------------------
74 | |
75 | | These options configure the behavior of failed queue job logging so you
76 | | can control which database and table are used to store the jobs that
77 | | have failed. You may change them to any database / table you wish.
78 | |
79 | */
80 |
81 | 'failed' => [
82 | 'database' => env('DB_CONNECTION', 'mysql'),
83 | 'table' => 'failed_jobs',
84 | ],
85 |
86 | ];
87 |
--------------------------------------------------------------------------------
/config/services.php:
--------------------------------------------------------------------------------
1 | [
18 | 'domain' => env('MAILGUN_DOMAIN'),
19 | 'secret' => env('MAILGUN_SECRET'),
20 | 'endpoint' => env('MAILGUN_ENDPOINT', 'api.mailgun.net'),
21 | ],
22 |
23 | 'ses' => [
24 | 'key' => env('SES_KEY'),
25 | 'secret' => env('SES_SECRET'),
26 | 'region' => env('SES_REGION', 'us-east-1'),
27 | ],
28 |
29 | 'sparkpost' => [
30 | 'secret' => env('SPARKPOST_SECRET'),
31 | ],
32 |
33 | 'stripe' => [
34 | 'model' => App\User::class,
35 | 'key' => env('STRIPE_KEY'),
36 | 'secret' => env('STRIPE_SECRET'),
37 | 'webhook' => [
38 | 'secret' => env('STRIPE_WEBHOOK_SECRET'),
39 | 'tolerance' => env('STRIPE_WEBHOOK_TOLERANCE', 300),
40 | ],
41 | ],
42 |
43 | ];
44 |
--------------------------------------------------------------------------------
/config/view.php:
--------------------------------------------------------------------------------
1 | [
17 | resource_path('views'),
18 | ],
19 |
20 | /*
21 | |--------------------------------------------------------------------------
22 | | Compiled View Path
23 | |--------------------------------------------------------------------------
24 | |
25 | | This option determines where all the compiled Blade templates will be
26 | | stored for your application. Typically, this is within the storage
27 | | directory. However, as usual, you are free to change this value.
28 | |
29 | */
30 |
31 | 'compiled' => env(
32 | 'VIEW_COMPILED_PATH',
33 | realpath(storage_path('framework/views'))
34 | ),
35 |
36 | ];
37 |
--------------------------------------------------------------------------------
/database/.gitignore:
--------------------------------------------------------------------------------
1 | *.sqlite
2 |
--------------------------------------------------------------------------------
/database/factories/UserFactory.php:
--------------------------------------------------------------------------------
1 | define(App\User::class, function (Faker $faker) {
17 | return [
18 | 'name' => $faker->name,
19 | 'email' => $faker->unique()->safeEmail,
20 | 'email_verified_at' => now(),
21 | 'password' => '$2y$10$TKh8H1.PfQx37YgCzwiKb.KjNyWgaHb9cbcoQgdIVFlYg7B77UdFm', // secret
22 | 'remember_token' => str_random(10),
23 | ];
24 | });
25 |
--------------------------------------------------------------------------------
/database/migrations/2014_10_12_000000_create_users_table.php:
--------------------------------------------------------------------------------
1 | increments('id');
18 | $table->string('name');
19 | $table->string('email')->unique();
20 | $table->timestamp('email_verified_at')->nullable();
21 | $table->string('password');
22 | $table->rememberToken();
23 | $table->timestamps();
24 | });
25 | }
26 |
27 | /**
28 | * Reverse the migrations.
29 | *
30 | * @return void
31 | */
32 | public function down()
33 | {
34 | Schema::dropIfExists('users');
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/database/migrations/2014_10_12_100000_create_password_resets_table.php:
--------------------------------------------------------------------------------
1 | string('email')->index();
18 | $table->string('token');
19 | $table->timestamp('created_at')->nullable();
20 | });
21 | }
22 |
23 | /**
24 | * Reverse the migrations.
25 | *
26 | * @return void
27 | */
28 | public function down()
29 | {
30 | Schema::dropIfExists('password_resets');
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/database/migrations/2018_12_11_141628_create_prices_table.php:
--------------------------------------------------------------------------------
1 | increments('id');
18 | $table->string('symbol');
19 | $table->float("price", 10, 0);
20 | $table->timestamps();
21 | });
22 | }
23 |
24 | /**
25 | * Reverse the migrations.
26 | *
27 | * @return void
28 | */
29 | public function down()
30 | {
31 | Schema::dropIfExists('prices');
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/database/migrations/2018_12_11_174522_create_signals_table.php:
--------------------------------------------------------------------------------
1 | increments('id');
18 | $table->string('market')->nullable();
19 | $table->float('lastprice',10,0)->nullable();
20 | $table->string('signalmode')->default('buy');
21 | $table->string('exchange')->default('binance');
22 | $table->timestamp('time')->nullable();
23 | $table->float('basevolume',10,0)->nullable();
24 | $table->string('signalID')->nullable();
25 | $table->timestamps();
26 | });
27 | }
28 |
29 | /**
30 | * Reverse the migrations.
31 | *
32 | * @return void
33 | */
34 | public function down()
35 | {
36 | Schema::dropIfExists('signals');
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/database/migrations/2018_12_11_204242_create_orders_table.php:
--------------------------------------------------------------------------------
1 | increments('id');
18 | $table->integer('buyId')->nullable();
19 | $table->string('symbol');
20 | $table->integer('orderId');
21 | $table->string('clientOrderId');
22 | $table->bigInteger('transactTime');
23 | $table->float('price', 10, 0);
24 | $table->float('origQty', 10, 0);
25 | $table->float('executedQty', 10, 0);
26 | $table->float('cummulativeQuoteQty', 10, 0);
27 | $table->string('status');
28 | $table->string('timeInForce')->default('GTC');
29 | $table->string('type');
30 | $table->string('side');
31 | $table->boolean('trailing')->default(0);
32 | $table->float('maxFloated')->default(0);
33 | $table->float('takeProfit')->nullable();
34 | $table->float('stopLoss')->nullable();
35 | $table->float('trailingTakeProfit')->nullable();
36 | $table->float('trailingStopLoss')->nullable();
37 | $table->timestamps();
38 | });
39 | }
40 |
41 | /**
42 | * Reverse the migrations.
43 | *
44 | * @return void
45 | */
46 | public function down()
47 | {
48 | Schema::dropIfExists('orders');
49 | }
50 | }
51 |
--------------------------------------------------------------------------------
/database/migrations/2018_12_13_201621_create_modules_table.php:
--------------------------------------------------------------------------------
1 | increments('id');
18 | $table->boolean('active')->default(0);
19 | $table->string('class');
20 | $table->text('config')->nullable();
21 | $table->timestamps();
22 | });
23 | }
24 |
25 | /**
26 | * Reverse the migrations.
27 | *
28 | * @return void
29 | */
30 | public function down()
31 | {
32 | Schema::dropIfExists('modules');
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/database/migrations/2018_12_14_162134_create_settings_table.php:
--------------------------------------------------------------------------------
1 | increments('id');
18 | $table->string('key');
19 | $table->text('value')->nullable();
20 | $table->timestamps();
21 | });
22 | }
23 |
24 | /**
25 | * Reverse the migrations.
26 | *
27 | * @return void
28 | */
29 | public function down()
30 | {
31 | Schema::dropIfExists('settings');
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/database/migrations/2018_12_19_203741_add_comment_field_to_order_table.php:
--------------------------------------------------------------------------------
1 | text('comment')->nullable();
18 | });
19 | }
20 |
21 | /**
22 | * Reverse the migrations.
23 | *
24 | * @return void
25 | */
26 | public function down()
27 | {
28 | Schema::table('orders', function (Blueprint $table) {
29 | $table->dropColumn('comment');
30 | });
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/database/migrations/2018_12_21_144414_add_min_field_to_orders_table.php:
--------------------------------------------------------------------------------
1 | float('minFloated')->default(0);
18 | });
19 | }
20 |
21 | /**
22 | * Reverse the migrations.
23 | *
24 | * @return void
25 | */
26 | public function down()
27 | {
28 | Schema::table('orders', function (Blueprint $table) {
29 | $table->dropColumn('minFloated');
30 | });
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/database/migrations/2018_12_24_230217_add_rl_field_to_signals_table.php:
--------------------------------------------------------------------------------
1 | string('rl')->nullable();
18 | $table->string('module')->nullable();
19 | });
20 | }
21 |
22 | /**
23 | * Reverse the migrations.
24 | *
25 | * @return void
26 | */
27 | public function down()
28 | {
29 | Schema::table('signals', function (Blueprint $table) {
30 | $table->dropColumn('rl');
31 | $table->dropColumn('module');
32 | });
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/database/migrations/2018_12_24_232542_add_starter_field_to_orders_table.php:
--------------------------------------------------------------------------------
1 | string('signal_id')->nullable();
18 | $table->string('module')->nullable();
19 | });
20 | }
21 |
22 | /**
23 | * Reverse the migrations.
24 | *
25 | * @return void
26 | */
27 | public function down()
28 | {
29 | Schema::table('orders', function (Blueprint $table) {
30 | $table->dropColumn('signal_id');
31 | $table->dropColumn('module');
32 | });
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/database/migrations/2018_12_28_103218_create_ticker_table.php:
--------------------------------------------------------------------------------
1 | increments('id');
18 | $table->string('eventType')->nullable();
19 | $table->bigInteger('eventTime')->nullable();
20 | $table->string('symbol')->nullable();
21 | $table->float('priceChange',8)->nullable();
22 | $table->float('percentChange',8)->nullable();
23 | $table->float('averagePrice',8)->nullable();
24 | $table->float('prevClose',8)->nullable();
25 | $table->float('close',8)->nullable();
26 | $table->float('closeQty',8)->nullable();
27 | $table->float('bestBid',8)->nullable();
28 | $table->float('bestBidQty',8)->nullable();
29 | $table->float('bestAsk',8)->nullable();
30 | $table->float('bestAskQty',8)->nullable();
31 | $table->float('open',8)->nullable();
32 | $table->float('high',8)->nullable();
33 | $table->float('low',8)->nullable();
34 | $table->float('volume',13)->nullable();
35 | $table->float('quoteVolume',13)->nullable();
36 | $table->bigInteger('openTime')->nullable();
37 | $table->bigInteger('closeTime')->nullable();
38 | $table->integer('firstTradeId')->nullable();
39 | $table->integer('lastTradeId')->nullable();
40 | $table->integer('numTrades')->nullable();
41 |
42 | $table->timestamps();
43 | });
44 | }
45 |
46 | /**
47 | * Reverse the migrations.
48 | *
49 | * @return void
50 | */
51 | public function down()
52 | {
53 | Schema::dropIfExists('ticker');
54 | }
55 | }
56 |
--------------------------------------------------------------------------------
/database/migrations/2018_12_28_193922_add_pl_field_to_orders_table.php:
--------------------------------------------------------------------------------
1 | float('pl')->nullable();
18 | $table->timestamp('sell_date')->nullable();
19 | });
20 | }
21 |
22 | /**
23 | * Reverse the migrations.
24 | *
25 | * @return void
26 | */
27 | public function down()
28 | {
29 | Schema::table('orders', function (Blueprint $table) {
30 | $table->dropColumn('pl');
31 | $table->dropColumn('sell_date');
32 | });
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/database/migrations/2018_12_29_203000_add_favorites_field_to_users_table.php:
--------------------------------------------------------------------------------
1 | text('favorites')->nullable();
18 | });
19 | }
20 |
21 | /**
22 | * Reverse the migrations.
23 | *
24 | * @return void
25 | */
26 | public function down()
27 | {
28 | Schema::table('users', function (Blueprint $table) {
29 | $table->dropColumn('favorites');
30 | });
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/database/seeds/DatabaseSeeder.php:
--------------------------------------------------------------------------------
1 | call(UsersTableSeeder::class);
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "private": true,
3 | "scripts": {
4 | "dev": "npm run development",
5 | "development": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js",
6 | "watch": "npm run development -- --watch",
7 | "watch-poll": "npm run watch -- --watch-poll",
8 | "hot": "cross-env NODE_ENV=development node_modules/webpack-dev-server/bin/webpack-dev-server.js --inline --hot --config=node_modules/laravel-mix/setup/webpack.config.js",
9 | "prod": "npm run production",
10 | "production": "cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --no-progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js"
11 | },
12 | "devDependencies": {
13 | "axios": "^0.18",
14 | "bootstrap": "^4.0.0",
15 | "cross-env": "^5.1",
16 | "font-awesome": "^4.7.0",
17 | "jquery": "^3.2",
18 | "laravel-mix": "^2.0",
19 | "lodash": "^4.17.5",
20 | "popper.js": "^1.12",
21 | "vue": "^2.5.17"
22 | },
23 | "dependencies": {
24 | "@fortawesome/fontawesome-free": "^5.6.3",
25 | "glyphicons": "^0.2.0",
26 | "jquery-autocomplete": "^1.2.8",
27 | "jquery-ui": "^1.12.1"
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/phpunit.xml:
--------------------------------------------------------------------------------
1 |
2 |
11 |
12 |
13 | ./tests/Unit
14 |
15 |
16 |
17 | ./tests/Feature
18 |
19 |
20 |
21 |
22 | ./app
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
--------------------------------------------------------------------------------
/public/.htaccess:
--------------------------------------------------------------------------------
1 |
2 |
3 | Options -MultiViews -Indexes
4 |
5 |
6 | RewriteEngine On
7 |
8 | # Handle Authorization Header
9 | RewriteCond %{HTTP:Authorization} .
10 | RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
11 |
12 | # Redirect Trailing Slashes If Not A Folder...
13 | RewriteCond %{REQUEST_FILENAME} !-d
14 | RewriteCond %{REQUEST_URI} (.+)/$
15 | RewriteRule ^ %1 [L,R=301]
16 |
17 | # Handle Front Controller...
18 | RewriteCond %{REQUEST_FILENAME} !-d
19 | RewriteCond %{REQUEST_FILENAME} !-f
20 | RewriteRule ^ index.php [L]
21 |
22 |
--------------------------------------------------------------------------------
/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kavehs87/PHPTradingBot/bfaf8276ef6429c3a0ceb5d1a433bd16829796b9/public/favicon.ico
--------------------------------------------------------------------------------
/public/fonts/fontawesome-webfont.eot:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kavehs87/PHPTradingBot/bfaf8276ef6429c3a0ceb5d1a433bd16829796b9/public/fonts/fontawesome-webfont.eot
--------------------------------------------------------------------------------
/public/fonts/fontawesome-webfont.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kavehs87/PHPTradingBot/bfaf8276ef6429c3a0ceb5d1a433bd16829796b9/public/fonts/fontawesome-webfont.ttf
--------------------------------------------------------------------------------
/public/fonts/fontawesome-webfont.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kavehs87/PHPTradingBot/bfaf8276ef6429c3a0ceb5d1a433bd16829796b9/public/fonts/fontawesome-webfont.woff
--------------------------------------------------------------------------------
/public/fonts/fontawesome-webfont.woff2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kavehs87/PHPTradingBot/bfaf8276ef6429c3a0ceb5d1a433bd16829796b9/public/fonts/fontawesome-webfont.woff2
--------------------------------------------------------------------------------
/public/fonts/vendor/@fortawesome/fontawesome-free/webfa-brands-400.eot:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kavehs87/PHPTradingBot/bfaf8276ef6429c3a0ceb5d1a433bd16829796b9/public/fonts/vendor/@fortawesome/fontawesome-free/webfa-brands-400.eot
--------------------------------------------------------------------------------
/public/fonts/vendor/@fortawesome/fontawesome-free/webfa-brands-400.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kavehs87/PHPTradingBot/bfaf8276ef6429c3a0ceb5d1a433bd16829796b9/public/fonts/vendor/@fortawesome/fontawesome-free/webfa-brands-400.ttf
--------------------------------------------------------------------------------
/public/fonts/vendor/@fortawesome/fontawesome-free/webfa-brands-400.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kavehs87/PHPTradingBot/bfaf8276ef6429c3a0ceb5d1a433bd16829796b9/public/fonts/vendor/@fortawesome/fontawesome-free/webfa-brands-400.woff
--------------------------------------------------------------------------------
/public/fonts/vendor/@fortawesome/fontawesome-free/webfa-brands-400.woff2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kavehs87/PHPTradingBot/bfaf8276ef6429c3a0ceb5d1a433bd16829796b9/public/fonts/vendor/@fortawesome/fontawesome-free/webfa-brands-400.woff2
--------------------------------------------------------------------------------
/public/fonts/vendor/@fortawesome/fontawesome-free/webfa-regular-400.eot:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kavehs87/PHPTradingBot/bfaf8276ef6429c3a0ceb5d1a433bd16829796b9/public/fonts/vendor/@fortawesome/fontawesome-free/webfa-regular-400.eot
--------------------------------------------------------------------------------
/public/fonts/vendor/@fortawesome/fontawesome-free/webfa-regular-400.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kavehs87/PHPTradingBot/bfaf8276ef6429c3a0ceb5d1a433bd16829796b9/public/fonts/vendor/@fortawesome/fontawesome-free/webfa-regular-400.ttf
--------------------------------------------------------------------------------
/public/fonts/vendor/@fortawesome/fontawesome-free/webfa-regular-400.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kavehs87/PHPTradingBot/bfaf8276ef6429c3a0ceb5d1a433bd16829796b9/public/fonts/vendor/@fortawesome/fontawesome-free/webfa-regular-400.woff
--------------------------------------------------------------------------------
/public/fonts/vendor/@fortawesome/fontawesome-free/webfa-regular-400.woff2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kavehs87/PHPTradingBot/bfaf8276ef6429c3a0ceb5d1a433bd16829796b9/public/fonts/vendor/@fortawesome/fontawesome-free/webfa-regular-400.woff2
--------------------------------------------------------------------------------
/public/fonts/vendor/@fortawesome/fontawesome-free/webfa-solid-900.eot:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kavehs87/PHPTradingBot/bfaf8276ef6429c3a0ceb5d1a433bd16829796b9/public/fonts/vendor/@fortawesome/fontawesome-free/webfa-solid-900.eot
--------------------------------------------------------------------------------
/public/fonts/vendor/@fortawesome/fontawesome-free/webfa-solid-900.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kavehs87/PHPTradingBot/bfaf8276ef6429c3a0ceb5d1a433bd16829796b9/public/fonts/vendor/@fortawesome/fontawesome-free/webfa-solid-900.ttf
--------------------------------------------------------------------------------
/public/fonts/vendor/@fortawesome/fontawesome-free/webfa-solid-900.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kavehs87/PHPTradingBot/bfaf8276ef6429c3a0ceb5d1a433bd16829796b9/public/fonts/vendor/@fortawesome/fontawesome-free/webfa-solid-900.woff
--------------------------------------------------------------------------------
/public/fonts/vendor/@fortawesome/fontawesome-free/webfa-solid-900.woff2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kavehs87/PHPTradingBot/bfaf8276ef6429c3a0ceb5d1a433bd16829796b9/public/fonts/vendor/@fortawesome/fontawesome-free/webfa-solid-900.woff2
--------------------------------------------------------------------------------
/public/images/vendor/jquery-ui/themes/base/ui-icons_444444_256x240.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kavehs87/PHPTradingBot/bfaf8276ef6429c3a0ceb5d1a433bd16829796b9/public/images/vendor/jquery-ui/themes/base/ui-icons_444444_256x240.png
--------------------------------------------------------------------------------
/public/images/vendor/jquery-ui/themes/base/ui-icons_555555_256x240.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kavehs87/PHPTradingBot/bfaf8276ef6429c3a0ceb5d1a433bd16829796b9/public/images/vendor/jquery-ui/themes/base/ui-icons_555555_256x240.png
--------------------------------------------------------------------------------
/public/images/vendor/jquery-ui/themes/base/ui-icons_777620_256x240.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kavehs87/PHPTradingBot/bfaf8276ef6429c3a0ceb5d1a433bd16829796b9/public/images/vendor/jquery-ui/themes/base/ui-icons_777620_256x240.png
--------------------------------------------------------------------------------
/public/images/vendor/jquery-ui/themes/base/ui-icons_777777_256x240.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kavehs87/PHPTradingBot/bfaf8276ef6429c3a0ceb5d1a433bd16829796b9/public/images/vendor/jquery-ui/themes/base/ui-icons_777777_256x240.png
--------------------------------------------------------------------------------
/public/images/vendor/jquery-ui/themes/base/ui-icons_cc0000_256x240.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kavehs87/PHPTradingBot/bfaf8276ef6429c3a0ceb5d1a433bd16829796b9/public/images/vendor/jquery-ui/themes/base/ui-icons_cc0000_256x240.png
--------------------------------------------------------------------------------
/public/images/vendor/jquery-ui/themes/base/ui-icons_ffffff_256x240.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kavehs87/PHPTradingBot/bfaf8276ef6429c3a0ceb5d1a433bd16829796b9/public/images/vendor/jquery-ui/themes/base/ui-icons_ffffff_256x240.png
--------------------------------------------------------------------------------
/public/index.php:
--------------------------------------------------------------------------------
1 |
8 | */
9 |
10 | define('LARAVEL_START', microtime(true));
11 |
12 | /*
13 | |--------------------------------------------------------------------------
14 | | Register The Auto Loader
15 | |--------------------------------------------------------------------------
16 | |
17 | | Composer provides a convenient, automatically generated class loader for
18 | | our application. We just need to utilize it! We'll simply require it
19 | | into the script here so that we don't have to worry about manual
20 | | loading any of our classes later on. It feels great to relax.
21 | |
22 | */
23 |
24 | require __DIR__.'/../vendor/autoload.php';
25 |
26 | /*
27 | |--------------------------------------------------------------------------
28 | | Turn On The Lights
29 | |--------------------------------------------------------------------------
30 | |
31 | | We need to illuminate PHP development, so let us turn on the lights.
32 | | This bootstraps the framework and gets it ready for use, then it
33 | | will load up this application so that we can run it and send
34 | | the responses back to the browser and delight our users.
35 | |
36 | */
37 |
38 | $app = require_once __DIR__.'/../bootstrap/app.php';
39 |
40 | /*
41 | |--------------------------------------------------------------------------
42 | | Run The Application
43 | |--------------------------------------------------------------------------
44 | |
45 | | Once we have the application, we can handle the incoming request
46 | | through the kernel, and send the associated response back to
47 | | the client's browser allowing them to enjoy the creative
48 | | and wonderful application we have prepared for them.
49 | |
50 | */
51 |
52 | $kernel = $app->make(Illuminate\Contracts\Http\Kernel::class);
53 |
54 | $response = $kernel->handle(
55 | $request = Illuminate\Http\Request::capture()
56 | );
57 |
58 | $response->send();
59 |
60 | $kernel->terminate($request, $response);
61 |
--------------------------------------------------------------------------------
/public/js/utils.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 |
3 | window.chartColors = {
4 | red: 'rgb(255, 99, 132)',
5 | orange: 'rgb(255, 159, 64)',
6 | yellow: 'rgb(255, 205, 86)',
7 | green: 'rgb(75, 192, 192)',
8 | blue: 'rgb(54, 162, 235)',
9 | purple: 'rgb(153, 102, 255)',
10 | grey: 'rgb(201, 203, 207)'
11 | };
12 |
13 | (function(global) {
14 | var Months = [
15 | 'January',
16 | 'February',
17 | 'March',
18 | 'April',
19 | 'May',
20 | 'June',
21 | 'July',
22 | 'August',
23 | 'September',
24 | 'October',
25 | 'November',
26 | 'December'
27 | ];
28 |
29 | var COLORS = [
30 | '#4dc9f6',
31 | '#f67019',
32 | '#f53794',
33 | '#537bc4',
34 | '#acc236',
35 | '#166a8f',
36 | '#00a950',
37 | '#58595b',
38 | '#8549ba'
39 | ];
40 |
41 | var Samples = global.Samples || (global.Samples = {});
42 | var Color = global.Color;
43 |
44 | Samples.utils = {
45 | // Adapted from http://indiegamr.com/generate-repeatable-random-numbers-in-js/
46 | srand: function(seed) {
47 | this._seed = seed;
48 | },
49 |
50 | rand: function(min, max) {
51 | var seed = this._seed;
52 | min = min === undefined ? 0 : min;
53 | max = max === undefined ? 1 : max;
54 | this._seed = (seed * 9301 + 49297) % 233280;
55 | return min + (this._seed / 233280) * (max - min);
56 | },
57 |
58 | numbers: function(config) {
59 | var cfg = config || {};
60 | var min = cfg.min || 0;
61 | var max = cfg.max || 1;
62 | var from = cfg.from || [];
63 | var count = cfg.count || 8;
64 | var decimals = cfg.decimals || 8;
65 | var continuity = cfg.continuity || 1;
66 | var dfactor = Math.pow(10, decimals) || 0;
67 | var data = [];
68 | var i, value;
69 |
70 | for (i = 0; i < count; ++i) {
71 | value = (from[i] || 0) + this.rand(min, max);
72 | if (this.rand() <= continuity) {
73 | data.push(Math.round(dfactor * value) / dfactor);
74 | } else {
75 | data.push(null);
76 | }
77 | }
78 |
79 | return data;
80 | },
81 |
82 | labels: function(config) {
83 | var cfg = config || {};
84 | var min = cfg.min || 0;
85 | var max = cfg.max || 100;
86 | var count = cfg.count || 8;
87 | var step = (max - min) / count;
88 | var decimals = cfg.decimals || 8;
89 | var dfactor = Math.pow(10, decimals) || 0;
90 | var prefix = cfg.prefix || '';
91 | var values = [];
92 | var i;
93 |
94 | for (i = min; i < max; i += step) {
95 | values.push(prefix + Math.round(dfactor * i) / dfactor);
96 | }
97 |
98 | return values;
99 | },
100 |
101 | months: function(config) {
102 | var cfg = config || {};
103 | var count = cfg.count || 12;
104 | var section = cfg.section;
105 | var values = [];
106 | var i, value;
107 |
108 | for (i = 0; i < count; ++i) {
109 | value = Months[Math.ceil(i) % 12];
110 | values.push(value.substring(0, section));
111 | }
112 |
113 | return values;
114 | },
115 |
116 | color: function(index) {
117 | return COLORS[index % COLORS.length];
118 | },
119 |
120 | transparentize: function(color, opacity) {
121 | var alpha = opacity === undefined ? 0.5 : 1 - opacity;
122 | return Color(color).alpha(alpha).rgbString();
123 | }
124 | };
125 |
126 | // DEPRECATED
127 | window.randomScalingFactor = function() {
128 | return Math.round(Samples.utils.rand(-100, 100));
129 | };
130 |
131 | // INITIALIZATION
132 |
133 | Samples.utils.srand(Date.now());
134 |
135 | // Google Analytics
136 | /* eslint-disable */
137 | if (document.location.hostname.match(/^(www\.)?chartjs\.org$/)) {
138 | (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
139 | (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
140 | m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
141 | })(window,document,'script','//www.google-analytics.com/analytics.js','ga');
142 | ga('create', 'UA-28909194-3', 'auto');
143 | ga('send', 'pageview');
144 | }
145 | /* eslint-enable */
146 |
147 | }(this));
--------------------------------------------------------------------------------
/public/mix-manifest.json:
--------------------------------------------------------------------------------
1 | {
2 | "/js/app.js": "/js/app.js",
3 | "/css/app.css": "/css/app.css"
4 | }
5 |
--------------------------------------------------------------------------------
/public/robots.txt:
--------------------------------------------------------------------------------
1 | User-agent: *
2 | Disallow:
3 |
--------------------------------------------------------------------------------
/public/svg/404.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/resources/.DS_Store:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kavehs87/PHPTradingBot/bfaf8276ef6429c3a0ceb5d1a433bd16829796b9/resources/.DS_Store
--------------------------------------------------------------------------------
/resources/js/app.js:
--------------------------------------------------------------------------------
1 | /**
2 | * First we will load all of this project's JavaScript dependencies which
3 | * includes Vue and other libraries. It is a great starting point when
4 | * building robust, powerful web applications using Vue and Laravel.
5 | */
6 |
7 | require('./bootstrap');
8 |
9 | // window.Vue = require('vue');
10 | //
11 | // /**
12 | // * The following block of code may be used to automatically register your
13 | // * Vue components. It will recursively scan this directory for the Vue
14 | // * components and automatically register them with their "basename".
15 | // *
16 | // * Eg. ./components/ExampleComponent.vue ->
17 | // */
18 | //
19 | // // const files = require.context('./', true, /\.vue$/i)
20 | // // files.keys().map(key => Vue.component(key.split('/').pop().split('.')[0], files(key)))
21 | //
22 | // Vue.component('example-component', require('./components/ExampleComponent.vue'));
23 | //
24 | // /**
25 | // * Next, we will create a fresh Vue application instance and attach it to
26 | // * the page. Then, you may begin adding components to this application
27 | // * or customize the JavaScript scaffolding to fit your unique needs.
28 | // */
29 | //
30 | // const app = new Vue({
31 | // el: '#app'
32 | // });
33 | $(document).ready(function () {
34 |
35 | $('.toggleFavorite').on('mouseenter', function () {
36 | var symbol = $(this).attr('data-symbol');
37 | if ($(this).hasClass('fa-star')) {
38 | $(this).addClass('fa-star-o');
39 | $(this).removeClass('fa-star');
40 | }
41 | else {
42 | $(this).addClass('fa-star');
43 | $(this).removeClass('fa-star-o');
44 | }
45 | });
46 | $('.toggleFavorite').on('mouseleave', function () {
47 | var changed = $(this).attr('data-changed');
48 | if (changed == 1) {
49 | $(this).attr('data-changed', 0);
50 | $('.toggleFavorite').attr('class', $(this).attr('class'));
51 | return;
52 | }
53 | var symbol = $(this).attr('data-symbol');
54 | if ($(this).hasClass('fa-star')) {
55 | $('.toggleFavorite').addClass('fa-star-o');
56 | $('.toggleFavorite').removeClass('fa-star');
57 | }
58 | else {
59 | $('.toggleFavorite').addClass('fa-star');
60 | $('.toggleFavorite').removeClass('fa-star-o');
61 | }
62 | });
63 | $('.toggleFavorite').on('click', function () {
64 | var symbol = $(this).attr('data-symbol');
65 | $('.toggleFavorite').attr('data-changed', 1);
66 | axios.get('/toggleFavorite/' + symbol).then(function (response) {
67 | favorites = [];
68 | for (var i in response.data)
69 | favorites.push(response.data[i]);
70 | updateMenuFavorites();
71 | }).then(function () {
72 |
73 | });
74 | });
75 | });
76 |
--------------------------------------------------------------------------------
/resources/js/bootstrap.js:
--------------------------------------------------------------------------------
1 |
2 | window._ = require('lodash');
3 |
4 | /**
5 | * We'll load jQuery and the Bootstrap jQuery plugin which provides support
6 | * for JavaScript based Bootstrap features such as modals and tabs. This
7 | * code may be modified to fit the specific needs of your application.
8 | */
9 |
10 | try {
11 | window.Popper = require('popper.js').default;
12 | // window.$ = window.jQuery = require('jquery');
13 | global.$ = global.jQuery = require('jquery');
14 |
15 | require('bootstrap');
16 | require('jquery-ui/ui/widgets/autocomplete');
17 |
18 | } catch (e) {}
19 |
20 | /**
21 | * We'll load the axios HTTP library which allows us to easily issue requests
22 | * to our Laravel back-end. This library automatically handles sending the
23 | * CSRF token as a header based on the value of the "XSRF" token cookie.
24 | */
25 |
26 | window.axios = require('axios');
27 |
28 | window.axios.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest';
29 |
30 | /**
31 | * Next we will register the CSRF Token as a common header with Axios so that
32 | * all outgoing HTTP requests automatically have it attached. This is just
33 | * a simple convenience so we don't have to attach every token manually.
34 | */
35 |
36 | let token = document.head.querySelector('meta[name="csrf-token"]');
37 |
38 | if (token) {
39 | window.axios.defaults.headers.common['X-CSRF-TOKEN'] = token.content;
40 | } else {
41 | console.error('CSRF token not found: https://laravel.com/docs/csrf#csrf-x-csrf-token');
42 | }
43 |
44 | /**
45 | * Echo exposes an expressive API for subscribing to channels and listening
46 | * for events that are broadcast by Laravel. Echo and event broadcasting
47 | * allows your team to easily build robust real-time web applications.
48 | */
49 |
50 | // import Echo from 'laravel-echo'
51 |
52 | // window.Pusher = require('pusher-js');
53 |
54 | // window.Echo = new Echo({
55 | // broadcaster: 'pusher',
56 | // key: process.env.MIX_PUSHER_APP_KEY,
57 | // cluster: process.env.MIX_PUSHER_APP_CLUSTER,
58 | // encrypted: true
59 | // });
60 |
--------------------------------------------------------------------------------
/resources/js/components/ExampleComponent.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 | I'm an example component.
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
24 |
--------------------------------------------------------------------------------
/resources/lang/en/auth.php:
--------------------------------------------------------------------------------
1 | 'These credentials do not match our records.',
17 | 'throttle' => 'Too many login attempts. Please try again in :seconds seconds.',
18 |
19 | ];
20 |
--------------------------------------------------------------------------------
/resources/lang/en/pagination.php:
--------------------------------------------------------------------------------
1 | '« Previous',
17 | 'next' => 'Next »',
18 |
19 | ];
20 |
--------------------------------------------------------------------------------
/resources/lang/en/passwords.php:
--------------------------------------------------------------------------------
1 | 'Passwords must be at least six characters and match the confirmation.',
17 | 'reset' => 'Your password has been reset!',
18 | 'sent' => 'We have e-mailed your password reset link!',
19 | 'token' => 'This password reset token is invalid.',
20 | 'user' => "We can't find a user with that e-mail address.",
21 |
22 | ];
23 |
--------------------------------------------------------------------------------
/resources/sass/_variables.scss:
--------------------------------------------------------------------------------
1 |
2 | // Body
3 | $body-bg: #f8fafc;
4 |
5 | // Typography
6 | $font-family-sans-serif: "Nunito", sans-serif;
7 | $font-size-base: 0.9rem;
8 | $line-height-base: 1.6;
9 |
10 | // Colors
11 | $blue: #3490dc;
12 | $indigo: #6574cd;
13 | $purple: #9561e2;
14 | $pink: #f66D9b;
15 | $red: #e3342f;
16 | $orange: #f6993f;
17 | $yellow: #ffed4a;
18 | $green: #38c172;
19 | $teal: #4dc0b5;
20 | $cyan: #6cb2eb;
21 |
--------------------------------------------------------------------------------
/resources/sass/app.scss:
--------------------------------------------------------------------------------
1 |
2 | // Fonts
3 | @import url('https://fonts.googleapis.com/css?family=Nunito');
4 |
5 | // Variables
6 | //@import 'variables';
7 | @import "theme/variables";
8 |
9 | // Bootstrap
10 | @import '~bootstrap/scss/bootstrap';
11 |
12 |
13 |
14 | @import "~jquery-ui/themes/base/base.css";
15 | @import "~jquery-ui/themes/base/theme.css";
16 | @import "~jquery-ui/themes/base/menu.css";
17 | @import "~jquery-ui/themes/base/autocomplete.css";
18 |
19 | @import "./font-awesome-4.7.0/scss/font-awesome";
20 |
21 | //@import './theme.css';
22 | //@import "theme/bootswatch";
23 |
24 | //.navbar-laravel {
25 | // background-color: #fff;
26 | // box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
27 | //}
28 |
29 |
30 | .footer {
31 | clear: both;
32 | position: relative;
33 | height: 40px;
34 | text-align: center;
35 | padding-top: -40px;
36 | }
37 |
38 | .toggleFavorite {
39 | cursor: pointer;
40 | }
41 |
42 |
--------------------------------------------------------------------------------
/resources/sass/font-awesome-4.7.0/HELP-US-OUT.txt:
--------------------------------------------------------------------------------
1 | I hope you love Font Awesome. If you've found it useful, please do me a favor and check out my latest project,
2 | Fort Awesome (https://fortawesome.com). It makes it easy to put the perfect icons on your website. Choose from our awesome,
3 | comprehensive icon sets or copy and paste your own.
4 |
5 | Please. Check it out.
6 |
7 | -Dave Gandy
8 |
--------------------------------------------------------------------------------
/resources/sass/font-awesome-4.7.0/fonts/FontAwesome.otf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kavehs87/PHPTradingBot/bfaf8276ef6429c3a0ceb5d1a433bd16829796b9/resources/sass/font-awesome-4.7.0/fonts/FontAwesome.otf
--------------------------------------------------------------------------------
/resources/sass/font-awesome-4.7.0/fonts/fontawesome-webfont.eot:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kavehs87/PHPTradingBot/bfaf8276ef6429c3a0ceb5d1a433bd16829796b9/resources/sass/font-awesome-4.7.0/fonts/fontawesome-webfont.eot
--------------------------------------------------------------------------------
/resources/sass/font-awesome-4.7.0/fonts/fontawesome-webfont.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kavehs87/PHPTradingBot/bfaf8276ef6429c3a0ceb5d1a433bd16829796b9/resources/sass/font-awesome-4.7.0/fonts/fontawesome-webfont.ttf
--------------------------------------------------------------------------------
/resources/sass/font-awesome-4.7.0/fonts/fontawesome-webfont.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kavehs87/PHPTradingBot/bfaf8276ef6429c3a0ceb5d1a433bd16829796b9/resources/sass/font-awesome-4.7.0/fonts/fontawesome-webfont.woff
--------------------------------------------------------------------------------
/resources/sass/font-awesome-4.7.0/fonts/fontawesome-webfont.woff2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kavehs87/PHPTradingBot/bfaf8276ef6429c3a0ceb5d1a433bd16829796b9/resources/sass/font-awesome-4.7.0/fonts/fontawesome-webfont.woff2
--------------------------------------------------------------------------------
/resources/sass/font-awesome-4.7.0/less/animated.less:
--------------------------------------------------------------------------------
1 | // Animated Icons
2 | // --------------------------
3 |
4 | .@{fa-css-prefix}-spin {
5 | -webkit-animation: fa-spin 2s infinite linear;
6 | animation: fa-spin 2s infinite linear;
7 | }
8 |
9 | .@{fa-css-prefix}-pulse {
10 | -webkit-animation: fa-spin 1s infinite steps(8);
11 | animation: fa-spin 1s infinite steps(8);
12 | }
13 |
14 | @-webkit-keyframes fa-spin {
15 | 0% {
16 | -webkit-transform: rotate(0deg);
17 | transform: rotate(0deg);
18 | }
19 | 100% {
20 | -webkit-transform: rotate(359deg);
21 | transform: rotate(359deg);
22 | }
23 | }
24 |
25 | @keyframes fa-spin {
26 | 0% {
27 | -webkit-transform: rotate(0deg);
28 | transform: rotate(0deg);
29 | }
30 | 100% {
31 | -webkit-transform: rotate(359deg);
32 | transform: rotate(359deg);
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/resources/sass/font-awesome-4.7.0/less/bordered-pulled.less:
--------------------------------------------------------------------------------
1 | // Bordered & Pulled
2 | // -------------------------
3 |
4 | .@{fa-css-prefix}-border {
5 | padding: .2em .25em .15em;
6 | border: solid .08em @fa-border-color;
7 | border-radius: .1em;
8 | }
9 |
10 | .@{fa-css-prefix}-pull-left { float: left; }
11 | .@{fa-css-prefix}-pull-right { float: right; }
12 |
13 | .@{fa-css-prefix} {
14 | &.@{fa-css-prefix}-pull-left { margin-right: .3em; }
15 | &.@{fa-css-prefix}-pull-right { margin-left: .3em; }
16 | }
17 |
18 | /* Deprecated as of 4.4.0 */
19 | .pull-right { float: right; }
20 | .pull-left { float: left; }
21 |
22 | .@{fa-css-prefix} {
23 | &.pull-left { margin-right: .3em; }
24 | &.pull-right { margin-left: .3em; }
25 | }
26 |
--------------------------------------------------------------------------------
/resources/sass/font-awesome-4.7.0/less/core.less:
--------------------------------------------------------------------------------
1 | // Base Class Definition
2 | // -------------------------
3 |
4 | .@{fa-css-prefix} {
5 | display: inline-block;
6 | font: normal normal normal @fa-font-size-base/@fa-line-height-base FontAwesome; // shortening font declaration
7 | font-size: inherit; // can't have font-size inherit on line above, so need to override
8 | text-rendering: auto; // optimizelegibility throws things off #1094
9 | -webkit-font-smoothing: antialiased;
10 | -moz-osx-font-smoothing: grayscale;
11 |
12 | }
13 |
--------------------------------------------------------------------------------
/resources/sass/font-awesome-4.7.0/less/fixed-width.less:
--------------------------------------------------------------------------------
1 | // Fixed Width Icons
2 | // -------------------------
3 | .@{fa-css-prefix}-fw {
4 | width: (18em / 14);
5 | text-align: center;
6 | }
7 |
--------------------------------------------------------------------------------
/resources/sass/font-awesome-4.7.0/less/font-awesome.less:
--------------------------------------------------------------------------------
1 | /*!
2 | * Font Awesome 4.7.0 by @davegandy - http://fontawesome.io - @fontawesome
3 | * License - http://fontawesome.io/license (Font: SIL OFL 1.1, CSS: MIT License)
4 | */
5 |
6 | @import "variables.less";
7 | @import "mixins.less";
8 | @import "path.less";
9 | @import "core.less";
10 | @import "larger.less";
11 | @import "fixed-width.less";
12 | @import "list.less";
13 | @import "bordered-pulled.less";
14 | @import "animated.less";
15 | @import "rotated-flipped.less";
16 | @import "stacked.less";
17 | @import "icons.less";
18 | @import "screen-reader.less";
19 |
--------------------------------------------------------------------------------
/resources/sass/font-awesome-4.7.0/less/larger.less:
--------------------------------------------------------------------------------
1 | // Icon Sizes
2 | // -------------------------
3 |
4 | /* makes the font 33% larger relative to the icon container */
5 | .@{fa-css-prefix}-lg {
6 | font-size: (4em / 3);
7 | line-height: (3em / 4);
8 | vertical-align: -15%;
9 | }
10 | .@{fa-css-prefix}-2x { font-size: 2em; }
11 | .@{fa-css-prefix}-3x { font-size: 3em; }
12 | .@{fa-css-prefix}-4x { font-size: 4em; }
13 | .@{fa-css-prefix}-5x { font-size: 5em; }
14 |
--------------------------------------------------------------------------------
/resources/sass/font-awesome-4.7.0/less/list.less:
--------------------------------------------------------------------------------
1 | // List Icons
2 | // -------------------------
3 |
4 | .@{fa-css-prefix}-ul {
5 | padding-left: 0;
6 | margin-left: @fa-li-width;
7 | list-style-type: none;
8 | > li { position: relative; }
9 | }
10 | .@{fa-css-prefix}-li {
11 | position: absolute;
12 | left: -@fa-li-width;
13 | width: @fa-li-width;
14 | top: (2em / 14);
15 | text-align: center;
16 | &.@{fa-css-prefix}-lg {
17 | left: (-@fa-li-width + (4em / 14));
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/resources/sass/font-awesome-4.7.0/less/mixins.less:
--------------------------------------------------------------------------------
1 | // Mixins
2 | // --------------------------
3 |
4 | .fa-icon() {
5 | display: inline-block;
6 | font: normal normal normal @fa-font-size-base/@fa-line-height-base FontAwesome; // shortening font declaration
7 | font-size: inherit; // can't have font-size inherit on line above, so need to override
8 | text-rendering: auto; // optimizelegibility throws things off #1094
9 | -webkit-font-smoothing: antialiased;
10 | -moz-osx-font-smoothing: grayscale;
11 |
12 | }
13 |
14 | .fa-icon-rotate(@degrees, @rotation) {
15 | -ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=@{rotation})";
16 | -webkit-transform: rotate(@degrees);
17 | -ms-transform: rotate(@degrees);
18 | transform: rotate(@degrees);
19 | }
20 |
21 | .fa-icon-flip(@horiz, @vert, @rotation) {
22 | -ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=@{rotation}, mirror=1)";
23 | -webkit-transform: scale(@horiz, @vert);
24 | -ms-transform: scale(@horiz, @vert);
25 | transform: scale(@horiz, @vert);
26 | }
27 |
28 |
29 | // Only display content to screen readers. A la Bootstrap 4.
30 | //
31 | // See: http://a11yproject.com/posts/how-to-hide-content/
32 |
33 | .sr-only() {
34 | position: absolute;
35 | width: 1px;
36 | height: 1px;
37 | padding: 0;
38 | margin: -1px;
39 | overflow: hidden;
40 | clip: rect(0,0,0,0);
41 | border: 0;
42 | }
43 |
44 | // Use in conjunction with .sr-only to only display content when it's focused.
45 | //
46 | // Useful for "Skip to main content" links; see http://www.w3.org/TR/2013/NOTE-WCAG20-TECHS-20130905/G1
47 | //
48 | // Credit: HTML5 Boilerplate
49 |
50 | .sr-only-focusable() {
51 | &:active,
52 | &:focus {
53 | position: static;
54 | width: auto;
55 | height: auto;
56 | margin: 0;
57 | overflow: visible;
58 | clip: auto;
59 | }
60 | }
61 |
--------------------------------------------------------------------------------
/resources/sass/font-awesome-4.7.0/less/path.less:
--------------------------------------------------------------------------------
1 | /* FONT PATH
2 | * -------------------------- */
3 |
4 | @font-face {
5 | font-family: 'FontAwesome';
6 | src: url('@{fa-font-path}/fontawesome-webfont.eot?v=@{fa-version}');
7 | src: url('@{fa-font-path}/fontawesome-webfont.eot?#iefix&v=@{fa-version}') format('embedded-opentype'),
8 | url('@{fa-font-path}/fontawesome-webfont.woff2?v=@{fa-version}') format('woff2'),
9 | url('@{fa-font-path}/fontawesome-webfont.woff?v=@{fa-version}') format('woff'),
10 | url('@{fa-font-path}/fontawesome-webfont.ttf?v=@{fa-version}') format('truetype'),
11 | url('@{fa-font-path}/fontawesome-webfont.svg?v=@{fa-version}#fontawesomeregular') format('svg');
12 | // src: url('@{fa-font-path}/FontAwesome.otf') format('opentype'); // used when developing fonts
13 | font-weight: normal;
14 | font-style: normal;
15 | }
16 |
--------------------------------------------------------------------------------
/resources/sass/font-awesome-4.7.0/less/rotated-flipped.less:
--------------------------------------------------------------------------------
1 | // Rotated & Flipped Icons
2 | // -------------------------
3 |
4 | .@{fa-css-prefix}-rotate-90 { .fa-icon-rotate(90deg, 1); }
5 | .@{fa-css-prefix}-rotate-180 { .fa-icon-rotate(180deg, 2); }
6 | .@{fa-css-prefix}-rotate-270 { .fa-icon-rotate(270deg, 3); }
7 |
8 | .@{fa-css-prefix}-flip-horizontal { .fa-icon-flip(-1, 1, 0); }
9 | .@{fa-css-prefix}-flip-vertical { .fa-icon-flip(1, -1, 2); }
10 |
11 | // Hook for IE8-9
12 | // -------------------------
13 |
14 | :root .@{fa-css-prefix}-rotate-90,
15 | :root .@{fa-css-prefix}-rotate-180,
16 | :root .@{fa-css-prefix}-rotate-270,
17 | :root .@{fa-css-prefix}-flip-horizontal,
18 | :root .@{fa-css-prefix}-flip-vertical {
19 | filter: none;
20 | }
21 |
--------------------------------------------------------------------------------
/resources/sass/font-awesome-4.7.0/less/screen-reader.less:
--------------------------------------------------------------------------------
1 | // Screen Readers
2 | // -------------------------
3 |
4 | .sr-only { .sr-only(); }
5 | .sr-only-focusable { .sr-only-focusable(); }
6 |
--------------------------------------------------------------------------------
/resources/sass/font-awesome-4.7.0/less/stacked.less:
--------------------------------------------------------------------------------
1 | // Stacked Icons
2 | // -------------------------
3 |
4 | .@{fa-css-prefix}-stack {
5 | position: relative;
6 | display: inline-block;
7 | width: 2em;
8 | height: 2em;
9 | line-height: 2em;
10 | vertical-align: middle;
11 | }
12 | .@{fa-css-prefix}-stack-1x, .@{fa-css-prefix}-stack-2x {
13 | position: absolute;
14 | left: 0;
15 | width: 100%;
16 | text-align: center;
17 | }
18 | .@{fa-css-prefix}-stack-1x { line-height: inherit; }
19 | .@{fa-css-prefix}-stack-2x { font-size: 2em; }
20 | .@{fa-css-prefix}-inverse { color: @fa-inverse; }
21 |
--------------------------------------------------------------------------------
/resources/sass/font-awesome-4.7.0/scss/_animated.scss:
--------------------------------------------------------------------------------
1 | // Spinning Icons
2 | // --------------------------
3 |
4 | .#{$fa-css-prefix}-spin {
5 | -webkit-animation: fa-spin 2s infinite linear;
6 | animation: fa-spin 2s infinite linear;
7 | }
8 |
9 | .#{$fa-css-prefix}-pulse {
10 | -webkit-animation: fa-spin 1s infinite steps(8);
11 | animation: fa-spin 1s infinite steps(8);
12 | }
13 |
14 | @-webkit-keyframes fa-spin {
15 | 0% {
16 | -webkit-transform: rotate(0deg);
17 | transform: rotate(0deg);
18 | }
19 | 100% {
20 | -webkit-transform: rotate(359deg);
21 | transform: rotate(359deg);
22 | }
23 | }
24 |
25 | @keyframes fa-spin {
26 | 0% {
27 | -webkit-transform: rotate(0deg);
28 | transform: rotate(0deg);
29 | }
30 | 100% {
31 | -webkit-transform: rotate(359deg);
32 | transform: rotate(359deg);
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/resources/sass/font-awesome-4.7.0/scss/_bordered-pulled.scss:
--------------------------------------------------------------------------------
1 | // Bordered & Pulled
2 | // -------------------------
3 |
4 | .#{$fa-css-prefix}-border {
5 | padding: .2em .25em .15em;
6 | border: solid .08em $fa-border-color;
7 | border-radius: .1em;
8 | }
9 |
10 | .#{$fa-css-prefix}-pull-left { float: left; }
11 | .#{$fa-css-prefix}-pull-right { float: right; }
12 |
13 | .#{$fa-css-prefix} {
14 | &.#{$fa-css-prefix}-pull-left { margin-right: .3em; }
15 | &.#{$fa-css-prefix}-pull-right { margin-left: .3em; }
16 | }
17 |
18 | /* Deprecated as of 4.4.0 */
19 | .pull-right { float: right; }
20 | .pull-left { float: left; }
21 |
22 | .#{$fa-css-prefix} {
23 | &.pull-left { margin-right: .3em; }
24 | &.pull-right { margin-left: .3em; }
25 | }
26 |
--------------------------------------------------------------------------------
/resources/sass/font-awesome-4.7.0/scss/_core.scss:
--------------------------------------------------------------------------------
1 | // Base Class Definition
2 | // -------------------------
3 |
4 | .#{$fa-css-prefix} {
5 | display: inline-block;
6 | font: normal normal normal #{$fa-font-size-base}/#{$fa-line-height-base} FontAwesome; // shortening font declaration
7 | font-size: inherit; // can't have font-size inherit on line above, so need to override
8 | text-rendering: auto; // optimizelegibility throws things off #1094
9 | -webkit-font-smoothing: antialiased;
10 | -moz-osx-font-smoothing: grayscale;
11 |
12 | }
13 |
--------------------------------------------------------------------------------
/resources/sass/font-awesome-4.7.0/scss/_fixed-width.scss:
--------------------------------------------------------------------------------
1 | // Fixed Width Icons
2 | // -------------------------
3 | .#{$fa-css-prefix}-fw {
4 | width: (18em / 14);
5 | text-align: center;
6 | }
7 |
--------------------------------------------------------------------------------
/resources/sass/font-awesome-4.7.0/scss/_larger.scss:
--------------------------------------------------------------------------------
1 | // Icon Sizes
2 | // -------------------------
3 |
4 | /* makes the font 33% larger relative to the icon container */
5 | .#{$fa-css-prefix}-lg {
6 | font-size: (4em / 3);
7 | line-height: (3em / 4);
8 | vertical-align: -15%;
9 | }
10 | .#{$fa-css-prefix}-2x { font-size: 2em; }
11 | .#{$fa-css-prefix}-3x { font-size: 3em; }
12 | .#{$fa-css-prefix}-4x { font-size: 4em; }
13 | .#{$fa-css-prefix}-5x { font-size: 5em; }
14 |
--------------------------------------------------------------------------------
/resources/sass/font-awesome-4.7.0/scss/_list.scss:
--------------------------------------------------------------------------------
1 | // List Icons
2 | // -------------------------
3 |
4 | .#{$fa-css-prefix}-ul {
5 | padding-left: 0;
6 | margin-left: $fa-li-width;
7 | list-style-type: none;
8 | > li { position: relative; }
9 | }
10 | .#{$fa-css-prefix}-li {
11 | position: absolute;
12 | left: -$fa-li-width;
13 | width: $fa-li-width;
14 | top: (2em / 14);
15 | text-align: center;
16 | &.#{$fa-css-prefix}-lg {
17 | left: -$fa-li-width + (4em / 14);
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/resources/sass/font-awesome-4.7.0/scss/_mixins.scss:
--------------------------------------------------------------------------------
1 | // Mixins
2 | // --------------------------
3 |
4 | @mixin fa-icon() {
5 | display: inline-block;
6 | font: normal normal normal #{$fa-font-size-base}/#{$fa-line-height-base} FontAwesome; // shortening font declaration
7 | font-size: inherit; // can't have font-size inherit on line above, so need to override
8 | text-rendering: auto; // optimizelegibility throws things off #1094
9 | -webkit-font-smoothing: antialiased;
10 | -moz-osx-font-smoothing: grayscale;
11 |
12 | }
13 |
14 | @mixin fa-icon-rotate($degrees, $rotation) {
15 | -ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=#{$rotation})";
16 | -webkit-transform: rotate($degrees);
17 | -ms-transform: rotate($degrees);
18 | transform: rotate($degrees);
19 | }
20 |
21 | @mixin fa-icon-flip($horiz, $vert, $rotation) {
22 | -ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=#{$rotation}, mirror=1)";
23 | -webkit-transform: scale($horiz, $vert);
24 | -ms-transform: scale($horiz, $vert);
25 | transform: scale($horiz, $vert);
26 | }
27 |
28 |
29 | // Only display content to screen readers. A la Bootstrap 4.
30 | //
31 | // See: http://a11yproject.com/posts/how-to-hide-content/
32 |
33 | @mixin sr-only {
34 | position: absolute;
35 | width: 1px;
36 | height: 1px;
37 | padding: 0;
38 | margin: -1px;
39 | overflow: hidden;
40 | clip: rect(0,0,0,0);
41 | border: 0;
42 | }
43 |
44 | // Use in conjunction with .sr-only to only display content when it's focused.
45 | //
46 | // Useful for "Skip to main content" links; see http://www.w3.org/TR/2013/NOTE-WCAG20-TECHS-20130905/G1
47 | //
48 | // Credit: HTML5 Boilerplate
49 |
50 | @mixin sr-only-focusable {
51 | &:active,
52 | &:focus {
53 | position: static;
54 | width: auto;
55 | height: auto;
56 | margin: 0;
57 | overflow: visible;
58 | clip: auto;
59 | }
60 | }
61 |
--------------------------------------------------------------------------------
/resources/sass/font-awesome-4.7.0/scss/_path.scss:
--------------------------------------------------------------------------------
1 | /* FONT PATH
2 | * -------------------------- */
3 |
4 | @font-face {
5 | font-family: 'FontAwesome';
6 | src: url('#{$fa-font-path}/fontawesome-webfont.eot?v=#{$fa-version}');
7 | src: url('#{$fa-font-path}/fontawesome-webfont.eot?#iefix&v=#{$fa-version}') format('embedded-opentype'),
8 | url('#{$fa-font-path}/fontawesome-webfont.woff2?v=#{$fa-version}') format('woff2'),
9 | url('#{$fa-font-path}/fontawesome-webfont.woff?v=#{$fa-version}') format('woff'),
10 | url('#{$fa-font-path}/fontawesome-webfont.ttf?v=#{$fa-version}') format('truetype'),
11 | url('#{$fa-font-path}/fontawesome-webfont.svg?v=#{$fa-version}#fontawesomeregular') format('svg');
12 | // src: url('#{$fa-font-path}/FontAwesome.otf') format('opentype'); // used when developing fonts
13 | font-weight: normal;
14 | font-style: normal;
15 | }
16 |
--------------------------------------------------------------------------------
/resources/sass/font-awesome-4.7.0/scss/_rotated-flipped.scss:
--------------------------------------------------------------------------------
1 | // Rotated & Flipped Icons
2 | // -------------------------
3 |
4 | .#{$fa-css-prefix}-rotate-90 { @include fa-icon-rotate(90deg, 1); }
5 | .#{$fa-css-prefix}-rotate-180 { @include fa-icon-rotate(180deg, 2); }
6 | .#{$fa-css-prefix}-rotate-270 { @include fa-icon-rotate(270deg, 3); }
7 |
8 | .#{$fa-css-prefix}-flip-horizontal { @include fa-icon-flip(-1, 1, 0); }
9 | .#{$fa-css-prefix}-flip-vertical { @include fa-icon-flip(1, -1, 2); }
10 |
11 | // Hook for IE8-9
12 | // -------------------------
13 |
14 | :root .#{$fa-css-prefix}-rotate-90,
15 | :root .#{$fa-css-prefix}-rotate-180,
16 | :root .#{$fa-css-prefix}-rotate-270,
17 | :root .#{$fa-css-prefix}-flip-horizontal,
18 | :root .#{$fa-css-prefix}-flip-vertical {
19 | filter: none;
20 | }
21 |
--------------------------------------------------------------------------------
/resources/sass/font-awesome-4.7.0/scss/_screen-reader.scss:
--------------------------------------------------------------------------------
1 | // Screen Readers
2 | // -------------------------
3 |
4 | .sr-only { @include sr-only(); }
5 | .sr-only-focusable { @include sr-only-focusable(); }
6 |
--------------------------------------------------------------------------------
/resources/sass/font-awesome-4.7.0/scss/_stacked.scss:
--------------------------------------------------------------------------------
1 | // Stacked Icons
2 | // -------------------------
3 |
4 | .#{$fa-css-prefix}-stack {
5 | position: relative;
6 | display: inline-block;
7 | width: 2em;
8 | height: 2em;
9 | line-height: 2em;
10 | vertical-align: middle;
11 | }
12 | .#{$fa-css-prefix}-stack-1x, .#{$fa-css-prefix}-stack-2x {
13 | position: absolute;
14 | left: 0;
15 | width: 100%;
16 | text-align: center;
17 | }
18 | .#{$fa-css-prefix}-stack-1x { line-height: inherit; }
19 | .#{$fa-css-prefix}-stack-2x { font-size: 2em; }
20 | .#{$fa-css-prefix}-inverse { color: $fa-inverse; }
21 |
--------------------------------------------------------------------------------
/resources/sass/font-awesome-4.7.0/scss/font-awesome.scss:
--------------------------------------------------------------------------------
1 | /*!
2 | * Font Awesome 4.7.0 by @davegandy - http://fontawesome.io - @fontawesome
3 | * License - http://fontawesome.io/license (Font: SIL OFL 1.1, CSS: MIT License)
4 | */
5 |
6 | @import "variables";
7 | @import "mixins";
8 | @import "path";
9 | @import "core";
10 | @import "larger";
11 | @import "fixed-width";
12 | @import "list";
13 | @import "bordered-pulled";
14 | @import "animated";
15 | @import "rotated-flipped";
16 | @import "stacked";
17 | @import "icons";
18 | @import "screen-reader";
19 |
--------------------------------------------------------------------------------
/resources/sass/theme/_bootswatch.scss:
--------------------------------------------------------------------------------
1 | // Darkly 4.2.1
2 | // Bootswatch
3 |
4 |
5 | // Variables ===================================================================
6 |
7 | $web-font-path: "https://fonts.googleapis.com/css?family=Lato:400,700,400italic" !default;
8 | @import url($web-font-path);
9 |
10 | // Navbar ======================================================================
11 |
12 | .bg-primary {
13 | .navbar-nav .active > .nav-link {
14 | color: $success !important;
15 | }
16 | }
17 |
18 | .bg-dark {
19 | background-color: $success !important;
20 | &.navbar-dark .navbar-nav {
21 | .nav-link:focus,
22 | .nav-link:hover,
23 | .active > .nav-link {
24 | color: $primary !important;
25 | }
26 | }
27 | }
28 |
29 | // Buttons =====================================================================
30 |
31 | // Typography ==================================================================
32 |
33 | .blockquote {
34 | &-footer {
35 | color: $gray-600;
36 | }
37 | }
38 |
39 | // Tables ======================================================================
40 |
41 | .table {
42 |
43 | &-primary {
44 | &, > th, > td {
45 | background-color: $primary;
46 | }
47 | }
48 |
49 | &-secondary {
50 | &, > th, > td {
51 | background-color: $secondary;
52 | }
53 | }
54 |
55 | &-light {
56 | &, > th, > td {
57 | background-color: $light;
58 | }
59 | }
60 |
61 | &-dark {
62 | &, > th, > td {
63 | background-color: $dark;
64 | }
65 | }
66 |
67 | &-success {
68 | &, > th, > td {
69 | background-color: $success;
70 | }
71 | }
72 |
73 | &-info {
74 | &, > th, > td {
75 | background-color: $info;
76 | }
77 | }
78 |
79 | &-danger {
80 | &, > th, > td {
81 | background-color: $danger;
82 | }
83 | }
84 |
85 | &-warning {
86 | &, > th, > td {
87 | background-color: $warning;
88 | }
89 | }
90 |
91 | &-active {
92 | &, > th, > td {
93 | background-color: $table-active-bg;
94 | }
95 | }
96 |
97 | &-hover {
98 |
99 | .table-primary:hover {
100 | &, > th, > td {
101 | background-color: darken($primary, 5%);
102 | }
103 | }
104 |
105 | .table-secondary:hover {
106 | &, > th, > td {
107 | background-color: darken($secondary, 5%);
108 | }
109 | }
110 |
111 | .table-light:hover {
112 | &, > th, > td {
113 | background-color: darken($light, 5%);
114 | }
115 | }
116 |
117 | .table-dark:hover {
118 | &, > th, > td {
119 | background-color: darken($dark, 5%);
120 | }
121 | }
122 |
123 | .table-success:hover {
124 | &, > th, > td {
125 | background-color: darken($success, 5%);
126 | }
127 | }
128 |
129 | .table-info:hover {
130 | &, > th, > td {
131 | background-color: darken($info, 5%);
132 | }
133 | }
134 |
135 | .table-danger:hover {
136 | &, > th, > td {
137 | background-color: darken($danger, 5%);
138 | }
139 | }
140 |
141 | .table-warning:hover {
142 | &, > th, > td {
143 | background-color: darken($warning, 5%);
144 | }
145 | }
146 |
147 | .table-active:hover {
148 | &, > th, > td {
149 | background-color: $table-active-bg;
150 | }
151 | }
152 |
153 | }
154 | }
155 |
156 | // Forms =======================================================================
157 |
158 | .input-group-addon {
159 | color: #fff;
160 | }
161 |
162 | // Navs ========================================================================
163 |
164 | .nav-tabs,
165 | .nav-pills {
166 |
167 | .nav-link,
168 | .nav-link.active,
169 | .nav-link.active:focus,
170 | .nav-link.active:hover,
171 | .nav-item.open .nav-link,
172 | .nav-item.open .nav-link:focus,
173 | .nav-item.open .nav-link:hover {
174 | color: #fff;
175 | }
176 | }
177 |
178 | .breadcrumb a {
179 | color: #fff;
180 | }
181 |
182 | .pagination {
183 | a:hover {
184 | text-decoration: none;
185 | }
186 | }
187 |
188 | // Indicators ==================================================================
189 |
190 | .close {
191 | opacity: 0.4;
192 |
193 | &:hover,
194 | &:focus {
195 | opacity: 1;
196 | }
197 | }
198 |
199 | .alert {
200 | border: none;
201 | color: $white;
202 |
203 | a,
204 | .alert-link {
205 | color: #fff;
206 | text-decoration: underline;
207 | }
208 |
209 | @each $color, $value in $theme-colors {
210 | &-#{$color} {
211 | @if $enable-gradients {
212 | background: $value linear-gradient(180deg, mix($white, $value, 15%), $value) repeat-x;
213 | } @else {
214 | background-color: $value;
215 | }
216 | }
217 | }
218 | }
219 |
220 | // Progress bars ===============================================================
221 |
222 | // Containers ==================================================================
223 |
224 |
225 | .list-group-item-action {
226 | color: #fff;
227 |
228 | &:hover,
229 | &:focus {
230 | background-color: $gray-700;
231 | color: #fff;
232 | }
233 |
234 | .list-group-item-heading {
235 | color: #fff;
236 | }
237 | }
--------------------------------------------------------------------------------
/resources/views/auth/login.blade.php:
--------------------------------------------------------------------------------
1 | @extends('layouts.app')
2 |
3 | @section('content')
4 |
73 | @endsection
74 |
--------------------------------------------------------------------------------
/resources/views/auth/passwords/email.blade.php:
--------------------------------------------------------------------------------
1 | @extends('layouts.app')
2 |
3 | @section('content')
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 | @if (session('status'))
12 |
13 | {{ session('status') }}
14 |
15 | @endif
16 |
17 |
42 |
43 |
44 |
45 |
46 |
47 | @endsection
48 |
--------------------------------------------------------------------------------
/resources/views/auth/passwords/reset.blade.php:
--------------------------------------------------------------------------------
1 | @extends('layouts.app')
2 |
3 | @section('content')
4 |
65 | @endsection
66 |
--------------------------------------------------------------------------------
/resources/views/auth/register.blade.php:
--------------------------------------------------------------------------------
1 | @extends('layouts.app')
2 |
3 | @section('content')
4 |
77 | @endsection
78 |
--------------------------------------------------------------------------------
/resources/views/auth/verify.blade.php:
--------------------------------------------------------------------------------
1 | @extends('layouts.app')
2 |
3 | @section('content')
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 | @if (session('resent'))
12 |
13 | {{ __('A fresh verification link has been sent to your email address.') }}
14 |
15 | @endif
16 |
17 | {{ __('Before proceeding, please check your email for a verification link.') }}
18 | {{ __('If you did not receive the email') }},
{{ __('click here to request another') }} .
19 |
20 |
21 |
22 |
23 |
24 | @endsection
25 |
--------------------------------------------------------------------------------
/resources/views/email/signalReceived.blade.php:
--------------------------------------------------------------------------------
1 | New signal received!
2 | @foreach($signal->toArray() as $attr => $value)
3 |
4 |
5 | {{$attr}}
6 |
7 |
8 | {{$value}}
9 |
10 |
11 | @endforeach
--------------------------------------------------------------------------------
/resources/views/layouts/app.blade.php:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 | {{ config('app.name', 'Laravel') }}
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 | @include('layouts.menu')
26 | @include('layouts.favorites')
27 |
28 |
29 |
30 | @yield('content')
31 |
32 |
33 |
34 |
35 |
40 |
41 |
42 |
--------------------------------------------------------------------------------
/resources/views/layouts/favorites.blade.php:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kavehs87/PHPTradingBot/bfaf8276ef6429c3a0ceb5d1a433bd16829796b9/resources/views/layouts/favorites.blade.php
--------------------------------------------------------------------------------
/resources/views/modulePage.blade.php:
--------------------------------------------------------------------------------
1 | @extends('layouts.app')
2 |
3 | @section('content')
4 | {!! $output !!}
5 |
6 | @endsection
--------------------------------------------------------------------------------
/resources/views/pages/modules.blade.php:
--------------------------------------------------------------------------------
1 | @extends('layouts.app')
2 |
3 | @section('content')
4 |
5 |
6 |
7 |
10 |
11 |
12 |
13 |
14 |
15 | Module Name
16 |
17 |
18 | Description
19 |
20 |
21 | Status
22 |
23 |
24 | Action
25 |
26 |
27 |
28 |
29 | @forelse(\App\Modules::getModules() as $module)
30 |
31 |
32 |
33 | {{$module}}
34 |
35 |
36 | {{\App\Modules::getModuleWithNameSpace($module)::$description}}
37 |
38 |
39 | @if(\App\Modules::init($module) != null)
40 | {{\App\Modules::init($module)->isActive() ? "Active" : "Inactive"}}
41 | @endif
42 |
43 |
44 | @if(\App\Modules::init($module) == null)
45 | Install
46 | @else
47 | @if(\App\Modules::init($module)->isActive())
48 | Disable
50 | @else
51 | Enable
53 | Uninstall
55 | @endif
56 | @endif
57 |
58 |
59 |
60 | @empty
61 |
62 | @endforelse
63 |
64 |
65 |
66 |
67 |
68 |
69 | @endsection
--------------------------------------------------------------------------------
/resources/views/pages/signals.blade.php:
--------------------------------------------------------------------------------
1 | @extends('layouts.app')
2 |
3 | @section('content')
4 |
5 |
6 |
9 |
10 | @if($signals->isNotEmpty())
11 |
12 |
13 |
14 | @foreach(array_keys($signals->first()->toArray()) as $column)
15 | {{$column}}
16 | @endforeach
17 |
18 |
19 |
20 | @foreach($signals as $signal)
21 |
22 | @foreach($signal->toArray() as $value)
23 |
24 | {{$value}}
25 |
26 | @endforeach
27 |
28 | TV
29 |
30 |
31 | @endforeach
32 |
33 |
34 | @else
35 |
36 | no signal
37 |
38 | @endif
39 |
40 | {{$signals->links()}}
41 |
42 |
43 |
44 |
45 | @endsection
--------------------------------------------------------------------------------
/resources/views/parts/newPosition.blade.php:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
10 | @if($status = \App\TradeHelper::systemctl('ticker','status'))
11 |
12 |
13 | Symbol
14 |
16 |
17 |
Amount (USDT)
18 |
20 |
Target Profit Percent
21 |
23 |
Stop Loss Percent
24 |
26 |
Trailing Target Profit Percent
27 |
29 |
Trailing Stop Loss Percent
30 |
32 |
33 |
34 | @if(isset($order))
35 |
36 | Save
37 |
38 |
39 | Cancel/New
40 |
41 | @else
42 |
43 | Buy
44 |
45 | @if($show)
46 |
47 | Cancel
48 |
49 | @endif
50 | @endif
51 |
52 | @else
53 |
54 | Service is not Running
55 |
56 |
57 | @endif
58 |
59 |
60 |
--------------------------------------------------------------------------------
/resources/views/parts/openTable.blade.php:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 | @if($open->isNotEmpty() && $status = \App\TradeHelper::systemctl('ticker','status'))
7 |
8 |
9 |
10 | #
11 | Date
12 | pom
13 | symbol
14 | Qty
15 | IsTrailing
16 |
17 | graph
18 |
19 | note
20 | risk
21 | max
22 | min
23 |
24 | Action
25 |
26 |
27 |
28 |
29 | @foreach($open as $symbol)
30 |
31 | @foreach($symbol as $order)
32 |
71 | @endforeach
72 |
73 |
74 | @endforeach
75 |
76 |
77 | @else
78 |
79 | no open order
80 |
81 | @endif
82 |
83 | @if(isset($status) && $status != true)
84 |
85 | Service is not Running
86 |
87 | @endif
88 |
--------------------------------------------------------------------------------
/resources/views/parts/openTable1.blade.php:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 | @if($open->isNotEmpty() && $status = \App\TradeHelper::systemctl('ticker','status'))
7 |
8 |
9 |
10 | #
11 | Date
12 | P/L
13 | pom
14 | symbol
15 | Buy
16 | Current
17 | Quantity
18 | {{--Side --}}
19 | IsTrailing
20 | TP
21 | SL
22 | TTP
23 | TSL
24 | note
25 | risk
26 | max
27 | min
28 |
29 | Action
30 |
31 |
32 |
33 |
34 | @foreach($open as $symbol)
35 |
36 | @foreach($symbol as $order)
37 |
89 | @endforeach
90 |
91 |
92 | @endforeach
93 |
94 |
95 | @else
96 |
97 | no open order
98 |
99 | @endif
100 |
101 | @if(isset($status) && $status != true)
102 |
103 | Service is not Running
104 |
105 | @endif
106 |
--------------------------------------------------------------------------------
/resources/views/parts/recentPairs.blade.php:
--------------------------------------------------------------------------------
1 |
2 |
3 | Symbols for last 1 day trades
4 |
5 |
33 |
34 |
35 |
36 | @if($pairs = \App\TradeHelper::recentlyTradedPairs(now()->subDay(1)))
37 | @foreach($pairs as $pair => $pairData)
38 |
46 | @endforeach
47 | @endif
48 |
49 |
50 |
--------------------------------------------------------------------------------
/resources/views/parts/tv.blade.php:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/resources/views/welcome.blade.php:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Laravel
8 |
9 |
10 |
11 |
12 |
13 |
65 |
66 |
67 |
68 | @if (Route::has('login'))
69 |
70 | @auth
71 |
Home
72 | @else
73 |
Login
74 |
75 | @if (Route::has('register'))
76 |
Register
77 | @endif
78 | @endauth
79 |
80 | @endif
81 |
82 |
83 |
84 | Laravel
85 |
86 |
87 |
95 |
96 |
97 |
98 |
99 |
--------------------------------------------------------------------------------
/routes/api.php:
--------------------------------------------------------------------------------
1 | get('/user', function (Request $request) {
17 | // return $request->user();
18 | //});
19 |
20 |
21 | Route::middleware('api')->get('/positions','ApiController@positions');
--------------------------------------------------------------------------------
/routes/channels.php:
--------------------------------------------------------------------------------
1 | id === (int) $id;
16 | });
17 |
--------------------------------------------------------------------------------
/routes/console.php:
--------------------------------------------------------------------------------
1 | comment(Inspiring::quote());
18 | })->describe('Display an inspiring quote');
19 |
--------------------------------------------------------------------------------
/server.php:
--------------------------------------------------------------------------------
1 |
8 | */
9 |
10 | $uri = urldecode(
11 | parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH)
12 | );
13 |
14 | // This file allows us to emulate Apache's "mod_rewrite" functionality from the
15 | // built-in PHP web server. This provides a convenient way to test a Laravel
16 | // application without having installed a "real" web server software here.
17 | if ($uri !== '/' && file_exists(__DIR__.'/public'.$uri)) {
18 | return false;
19 | }
20 |
21 | require_once __DIR__.'/public/index.php';
22 |
--------------------------------------------------------------------------------
/services.sh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | if [ $1 = "daemon" ]; then
4 | echo "daemon"
5 | while sleep 1
6 | do
7 | PID=$(ps aux | grep 'daemon:ticker' | grep -v grep | awk '{print $2}')
8 | if [[ -z $PID ]]; then
9 | php artisan daemon:ticker &>/dev/null &
10 | fi
11 |
12 | PID=$(ps aux | grep 'daemon:signals' | grep -v grep | awk '{print $2}')
13 | if [[ -z $PID ]]; then
14 | php artisan daemon:signals &>/dev/null &
15 | fi
16 |
17 | PID=$(ps aux | grep 'daemon:orders' | grep -v grep | awk '{print $2}')
18 | if [[ -z $PID ]]; then
19 | php artisan daemon:orders &>/dev/null &
20 | fi
21 |
22 | # PID=$(ps aux | grep 'ssh -D 1337' | grep -v grep | awk '{print $2}')
23 | # if [[ -z $PID ]]; then
24 | # ssh -D 1337 -f -C -q -N root@149.28.135.20
25 | # fi
26 |
27 | done
28 |
29 | fi
30 |
31 | if [ $1 = "status" ]; then
32 | echo "status ..."
33 | PID=$(ps aux | grep 'daemon:ticker' | grep -v grep | awk '{print $2}')
34 | if [[ -z $PID ]]; then
35 | echo "ticker Daemon Stopped"
36 | else
37 | echo "ticker Daemon Running"
38 | fi
39 |
40 | PID=$(ps aux | grep 'daemon:signals' | grep -v grep | awk '{print $2}')
41 | if [[ -z $PID ]]; then
42 | echo "Signals Daemon Stopped"
43 | else
44 | echo "Signals Daemon Running"
45 | fi
46 |
47 | PID=$(ps aux | grep 'daemon:orders' | grep -v grep | awk '{print $2}')
48 | if [[ -z $PID ]]; then
49 | echo "Orders Daemon Stopped"
50 | else
51 | echo "Orders Daemon Running"
52 | fi
53 |
54 | PID=$(ps aux | grep 'ssh -D 1337' | grep -v grep | awk '{print $2}')
55 | if [[ -z $PID ]]; then
56 | echo "Tunnel Daemon Stopped"
57 | else
58 | echo "Tunnel Daemon Running"
59 | fi
60 |
61 | fi
62 |
63 | if [ $1 = "restart" ]; then
64 | pkill -f "php artisan daemon:"
65 | echo "restarted"
66 | fi
67 |
68 | if [ $1 = "stop" ]; then
69 | pkill -f "php artisan daemon:"
70 | pkill -f "services.sh"
71 | echo "stopped"
72 | fi
73 |
74 |
--------------------------------------------------------------------------------
/storage/app/.gitignore:
--------------------------------------------------------------------------------
1 | *
2 | !public/
3 | !.gitignore
4 |
--------------------------------------------------------------------------------
/storage/app/public/.gitignore:
--------------------------------------------------------------------------------
1 | *
2 | !.gitignore
3 |
--------------------------------------------------------------------------------
/storage/framework/.gitignore:
--------------------------------------------------------------------------------
1 | config.php
2 | routes.php
3 | schedule-*
4 | compiled.php
5 | services.json
6 | events.scanned.php
7 | routes.scanned.php
8 | down
9 |
--------------------------------------------------------------------------------
/storage/framework/cache/.gitignore:
--------------------------------------------------------------------------------
1 | *
2 | !data/
3 | !.gitignore
4 |
--------------------------------------------------------------------------------
/storage/framework/cache/data/.gitignore:
--------------------------------------------------------------------------------
1 | *
2 | !.gitignore
3 |
--------------------------------------------------------------------------------
/storage/framework/sessions/.gitignore:
--------------------------------------------------------------------------------
1 | *
2 | !.gitignore
3 |
--------------------------------------------------------------------------------
/storage/framework/testing/.gitignore:
--------------------------------------------------------------------------------
1 | *
2 | !.gitignore
3 |
--------------------------------------------------------------------------------
/storage/framework/views/.gitignore:
--------------------------------------------------------------------------------
1 | *
2 | !.gitignore
3 |
--------------------------------------------------------------------------------
/storage/logs/.gitignore:
--------------------------------------------------------------------------------
1 | *
2 | !.gitignore
3 |
--------------------------------------------------------------------------------
/tests/CreatesApplication.php:
--------------------------------------------------------------------------------
1 | make(Kernel::class)->bootstrap();
19 |
20 | return $app;
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/tests/Feature/ExampleTest.php:
--------------------------------------------------------------------------------
1 | get('/');
18 |
19 | $response->assertStatus(200);
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/tests/TestCase.php:
--------------------------------------------------------------------------------
1 | assertTrue(true);
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/webpack.mix.js:
--------------------------------------------------------------------------------
1 | const mix = require('laravel-mix');
2 |
3 | /*
4 | |--------------------------------------------------------------------------
5 | | Mix Asset Management
6 | |--------------------------------------------------------------------------
7 | |
8 | | Mix provides a clean, fluent API for defining some Webpack build steps
9 | | for your Laravel application. By default, we are compiling the Sass
10 | | file for the application as well as bundling up all the JS files.
11 | |
12 | */
13 |
14 | mix.js('resources/js/app.js', 'public/js')
15 | .sass('resources/sass/app.scss', 'public/css');
16 |
--------------------------------------------------------------------------------