Esempio n. 1
0
 def start(self):
     LineNotification.initialize()
     OneMinMarketData.initialize_for_bot()
     ws = RealtimeWSAPI()
     bot = Bot('./Data/sim_log.csv', True)
     while True:
        time.sleep(1)
Esempio n. 2
0
 def __init__(self):
     SystemFlg.initialize()
     LineNotification.initialize()
     Trade.initialize()
     LogMaster.initialize()
     while True:
         print('Please select program mode.')
         print('1: OHLCV data update')
         print('2: Mark3etData test')
         print('3: Bot test')
         print('4: Sim')
         print('5: WS Test')
         print('6: Trade Test')
         select = str(input())
         if select == '1':
             print('1: OHLCV data update')
             dmd = DownloadMarketData()
             dmd.download_all_targets_async(2017, 1, 2)
             dmd.update_ohlcv()
             RestAPI.update_onemin_data()
             break
         elif select == '2':
             print('2: MarketData test')
             term_list = list(range(10, 1000, 100))
             MarketData.initialize_for_bot(term_list, True)
             break
         elif select == '3':
             print('3: Bot test')
             term_list = list(range(10, 1000, 100))
             MarketData.initialize_for_bot(term_list, False)
             bot = Bot(100)
             break
         elif select == '4':
             print('4: Sim')
             pass
             break
         elif select == '5':
             print('5: WS Test')
             pass
             break
         elif select == '6':
             print('6: Trade Test')
             Trade.test_trade()
             break
         else:
             pass
Esempio n. 3
0
                     TickData.get_ltp() * 1.0 / self.leverage, 2)
        return size

    def calc_opt_pl(self):
        if TickData.get_1m_std() > 10000:
            newpl = self.pl_kijun * math.log(
                (TickData.get_1m_std() / 100000)) + 5
            print('changed opt pl kijun to ' + str(newpl))
            LogMaster.add_log(
                'action_message - changed opt pl kijun to ' + str(newpl),
                self.prediction[0], self.ac)
            LineNotification.send_error('changed opt pl kijun to ' +
                                        str(newpl))
            return newpl
        else:
            return self.pl_kijun


if __name__ == '__main__':
    SystemFlg.initialize()
    TickData.initialize(30, 30)
    Trade.initialize()
    LogMaster.initialize()
    LineNotification.initialize()
    fb = FlyerBot()
    fb.start_flyer_bot(
        150, 2, 2500, 5, False, True
    )  #num_term, window_term, pl_kijun, future_period, zero_three_exit_when_loss, zero_three_exit_when_profit
    #'JRF20190526-142616-930215'
    #JRF20190526-143431-187560
Esempio n. 4
0
 def display(self):
     LineNotification.initialize()
     l = [1, 2, 3, 4, 5, 4, 6, 7, 8, 9, 3, 4, 5, 6, 3, 4]
     plt.plot(l)
     plt.savefig('./ignore/figure.jpeg')
     LineNotification.send_image(open('./ignore/figure.jpeg', 'rb'))