def __init__(self): super(macd, self).__init__() self._quick_ema = 0 self._slow_ema = 0 self._quick_period = 12 self._slow_period = 26 self._now_bar_num = 0 self._diff = 0 self._dea = 0 self._dea_period = 9 self._diff_array = [] self._config_file = 320 if self._now_bar_num == 0: print "this is init function " + str(self._config_file) quick_ema_array = [] slow_ema_array = [] config_file = "../config/" + str(self._config_file) bf.get_config_info(quick_ema_array, slow_ema_array, self._diff_array, config_file) if len(quick_ema_array) == 0: self._quick_ema = 0 self._slow_ema = 0 else: self._quick_ema = quick_ema_array[0] self._slow_ema = slow_ema_array[0] self._now_bar_num = 99
def __init__(self, param_dic): super(BandAndTrigger, self).__init__() self._write_to_csv_data = [] self._pre_md_price = [] self._now_md_price = [] self._lastprice_array = [] self._pre_ema_val_60 = 0 self._now_middle_60 = 0 self._pre_ema_val_5 = 0 self._now_middle_5 = 0 self._now_ema_tick_5 = 0 self._limit_ema_tick_5 = param_dic["limit_ema_tick_5"] self._pre_ema_val_1 = 0 self._now_middle_1 = 0 self._now_ema_tick_1 = 0 self._limit_ema_tick_1 = param_dic["limit_ema_tick_1"] self._ema_period = 20 self._current_hour = 9 self._multiple = param_dic["multiple"] self._rsi_period = param_dic["rsi_period"] self._rsi_val = 0 self._file = param_dic["file"] self._config_file = param_dic["config_file"] if len(self._lastprice_array) == 0: print "this is init function " + str(self._config_file) tmp_pre_ema_array_60 = [] tmp_pre_ema_array_5 = [] tmp_pre_ema_array_1 = [] config_file = "../hour_config/config/" + str(self._config_file + 2) bf.get_config_info(tmp_pre_ema_array_60, tmp_pre_ema_array_5, tmp_pre_ema_array_1, self._lastprice_array, config_file) if len(tmp_pre_ema_array_60) == 0: self._pre_ema_val_60 = 0 self._pre_ema_val_5 = 0 self._pre_ema_val_1 = 0 else: self._pre_ema_val_60 = tmp_pre_ema_array_60[0] self._pre_ema_val_5 = tmp_pre_ema_array_5[0] self._pre_ema_val_1 = tmp_pre_ema_array_1[0] # print self._pre_ema_val_60 print len(self._lastprice_array)
def __init__(self,param_dic): super(BandAndTrigger, self).__init__() self._write_to_csv_data = [] self._pre_md_price = [] self._now_md_price = [] self._lastprice_array = [] self._lastprice_map = dict() self._pre_ema_val = 0 self._now_middle_value =0 self._now_sd_val = 0 self._multiple = param_dic["multiple"] self._rsi_array = [] self._pre_rsi_lastprice =0 self._now_bar_rsi_tick = 0 self._ris_data = 0 self._rsi_period = param_dic["rsi_period"] self._rsi_bar_period = param_dic["rsi_bar_period"] self._moving_theo = "EMA" # band param self._param_period = param_dic["band_period"] self._file = param_dic["file"] self._config_file = param_dic["config_file"] if len(self._lastprice_array) ==0: print "this is init function " + str(self._config_file) tmp_pre_ema_array = [] tmp_rsi_lastprice = [] config_file = "../config/"+str(self._config_file) bf.get_config_info(tmp_pre_ema_array,self._lastprice_array,self._lastprice_map ,self._rsi_array,tmp_rsi_lastprice,config_file) if len(tmp_pre_ema_array)==0: self._pre_ema_val = 0 self._pre_rsi_lastprice = 0 else: self._pre_ema_val = tmp_pre_ema_array[0] self._pre_rsi_lastprice = tmp_rsi_lastprice[0] print self._pre_ema_val print len(self._lastprice_array) print self._rsi_array print self._pre_rsi_lastprice
def __init__(self,param_dic): super(BandAndSeries, self).__init__() # self.arg = arg self._pre_md_price = [] self._now_md_price = [] self._lastprice_array = [] self._lastprice_map = dict() self._pre_ema_val = 0 self._now_middle_value =0 self._now_sd_val = 0 self._series_lastprice = 0 self._limit_series_lastprice = param_dic["limit_series_lastprice"] self._diff_volume_array = [] self._tmp_sum_diff_volume = 0 self._now_bar_volume_tick = 0 self._limit_bar_volume_tick = param_dic["limit_bar_volume_tick"] self._limit_multiple = param_dic["limit_multiple"] self._limit_diff_volume_large_period = param_dic["limit_large_period"] self._max_profit = 0 self._limit_max_profit = param_dic["limit_max_profit"] self._limit_max_loss = param_dic["limit_max_loss"] self._multiple = param_dic["multiple"] self._rsi_array = [] self._pre_rsi_lastprice =0 self._now_bar_rsi_tick = 0 self._rsi_period = param_dic["rsi_period"] self._rsi_bar_period = param_dic["rsi_bar_period"] self._limit_rsi_data = param_dic["limit_rsi_data"] # self._limit_twice_sd = 2 self._direction = param_dic["direction"] self._moving_theo = "EMA" # now we have the cangwei and the limit cangwei self._now_interest = 0 self._limit_interest = 1 # band param self._param_open_edge1 = param_dic["band_open_edge1"] self._param_open_edge2 = param_dic["band_open_edge2"] self._param_loss_edge = param_dic["band_loss_edge"] self._param_close_edge =param_dic["band_profit_edge"] self._param_period = param_dic["band_period"] # trigger param self._param_volume_open_edge = param_dic["volume_open_edge"] self._param_open_interest_edge = param_dic["open_interest_edge"] self._param_spread = param_dic["spread"] self._open_lastprice = 0 self._profit = 0 self._ris_data = 0 self._limit_sd = param_dic["limit_sd"] self._limit_sd_open_edge = param_dic["limit_sd_open_edge"] self._limit_sd_close_edge = param_dic["limit_sd_close_edge"] self._file = param_dic["file"] self._config_file = param_dic["config_file"] if len(self._lastprice_array) ==0: print "this is init function " + str(self._config_file) tmp_pre_ema_array = [] tmp_rsi_lastprice = [] config_file = "../config_server/"+str(self._config_file) bf.get_config_info(tmp_pre_ema_array,self._lastprice_array,self._lastprice_map ,self._rsi_array,tmp_rsi_lastprice,config_file) if len(tmp_pre_ema_array)==0: self._pre_ema_val = 0 self._pre_rsi_lastprice = 0 else: self._pre_ema_val = tmp_pre_ema_array[0] self._pre_rsi_lastprice = tmp_rsi_lastprice[0]
def __init__(self,param_dic): super(BandAndTrigger, self).__init__() self._write_to_csv_data = [] self._pre_md_price = [] self._now_md_price = [] self._lastprice_array = [] self._lastprice_map = dict() self._pre_ema_val = 0 self._now_middle_value =0 self._now_sd_val = 0 self._diff_volume_array = [] self._diff_open_interest_array = [] self._diff_spread_array = [] self._diff_turn_over_array = [] self._diff_period =param_dic["diff_period"] self._multiple = param_dic["multiple"] self._rsi_array = [] self._pre_rsi_lastprice =0 self._now_bar_rsi_tick = 0 self._ris_data = 0 self._rsi_period = param_dic["rsi_period"] self._rsi_bar_period = param_dic["rsi_bar_period"] self._limit_rsi_data = param_dic["limit_rsi_data"] self._now_bar_num = 0 self._limit_bar_num = 1 self._bar_min_lastprice = 0 self._bar_max_lastprice = 0 # self._limit_twice_sd = 2 self._moving_theo = "EMA" # band param self._param_period = param_dic["band_period"] adv_param_dict = {} adv_param_dict["period"] = 120 adv_param_dict["pre_adv"] = 0 self._adv_obj = adv.ADV(adv_param_dict) wavd_param_dict = {} wavd_param_dict["period"] = 120 wavd_param_dict["bar_num"] = 1 self._wvad_obj = wvad.WVAD(wavd_param_dict) self._file = param_dic["file"] self._config_file = param_dic["config_file"] self._slope = [] self._tick_num = param_dic["tick_num"] self._slope_tick = 0 self._volume_period = 20 self._now_volume_tick = 0 self._sum_volume =0 self._pre_sum_volume = 1 if len(self._lastprice_array) ==0: print "this is init function " + str(self._config_file) tmp_pre_ema_array = [] tmp_rsi_lastprice = [] config_file = "../config_pic/"+str(self._config_file) bf.get_config_info(tmp_pre_ema_array,self._lastprice_array,self._lastprice_map ,self._rsi_array,tmp_rsi_lastprice,config_file) if len(tmp_pre_ema_array)==0: self._pre_ema_val = 0 self._pre_rsi_lastprice = 0 else: self._pre_ema_val = tmp_pre_ema_array[0] self._pre_rsi_lastprice = tmp_rsi_lastprice[0] print self._pre_ema_val print len(self._lastprice_array) print self._rsi_array print self._pre_rsi_lastprice
def __init__(self, param_dic): super(BandAndTriggerFade, self).__init__() # self.arg = arg self._pre_md_price = [] self._now_md_price = [] self._lastprice_array = [] self._lastprice_map = dict() self._pre_ema_val = 0 self._now_middle_value = 0 self._now_sd_val = 0 self._csv_data = [] self._max_profit = 0 self._limit_max_draw_down = param_dic["limit_max_draw_down"] self._limit_max_profit = param_dic["limit_max_profit"] self._limit_max_loss = param_dic["limit_max_loss"] self._multiple = param_dic["multiple"] self._rsi_array = [] self._pre_rsi_lastprice = 0 self._now_bar_rsi_tick = 0 self._rsi_period = param_dic["rsi_period"] self._rsi_bar_period = param_dic["rsi_bar_period"] self._limit_rsi_data = param_dic["limit_rsi_data"] self._param_period = param_dic["param_period"] # self._limit_twice_sd = 2 self._band_status = 0 self._direction = param_dic["direction"] self._moving_theo = "EMA" # now we have the cangwei and the limit cangwei self._now_interest = 0 self._limit_interest = 1 self._band_status = 0 # band param self._param_open_edge = param_dic["band_open_edge"] self._param_close_edge = param_dic["band_close_edge"] self._open_lastprice = 0 self._profit = 0 self._ris_data = 0 self._bigger_band = 3 self._file = param_dic["file"] self._config_file = param_dic["config_file"] if len(self._lastprice_array) == 0: print "this is init function " + str(self._config_file) tmp_pre_ema_array = [] tmp_rsi_lastprice = [] config_file = "../config_pic/" + str(self._config_file) bf.get_config_info(tmp_pre_ema_array, self._lastprice_array, self._lastprice_map, self._rsi_array, tmp_rsi_lastprice, config_file) if len(tmp_pre_ema_array) == 0: self._pre_ema_val = 0 self._pre_rsi_lastprice = 0 else: self._pre_ema_val = tmp_pre_ema_array[0] self._pre_rsi_lastprice = tmp_rsi_lastprice[0]