本文整理汇总了Python中logger.MyLogger类的典型用法代码示例。如果您正苦于以下问题:Python MyLogger类的具体用法?Python MyLogger怎么用?Python MyLogger使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了MyLogger类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: on_condition_signal_btn_clicked
def on_condition_signal_btn_clicked(self):
MyLogger.instance().logger().info("")
signal_str = self.ui.combo_signal.currentText()
MyLogger.instance().logger().info("신호종류: %s", signal_str)
for condition in self.selected_condition:
condition.신호종류 = signal_str
self.on_data_updated(["조건식_dic"])
示例2: on_condition_apply_btn_clicked
def on_condition_apply_btn_clicked(self):
MyLogger.instance().logger().info("")
apply_str = self.ui.combo_apply.currentText()
MyLogger.instance().logger().info("신호종류: %s", apply_str)
for condition in self.selected_condition:
condition.적용유무 = apply_str
self.on_data_updated(["조건식_dic"])
示例3: set_real_reg
def set_real_reg(self, the_종목코드_list_str):
MyLogger.instance().logger().info("the_종목코드_list_str %s", the_종목코드_list_str)
fid = "9001;10;13" # 종목코드,업종코드;현재가;누적거래량
ret = self.ocx.dynamicCall("SetRealReg(QString, QString, QString, QString)",
[constant.SN_실시간조회, the_종목코드_list_str, fid, "1"]) # "1" 종목 추가, "0" 기존 종목은 제외
MyLogger.instance().logger().info("call SetRealReg(). ret: %d", ret)
return ret
示例4: on_register_real_all_btn_clicked
def on_register_real_all_btn_clicked(self):
MyLogger.instance().logger().info("")
잔고_dic = kiwoom.data.잔고_dic
종목코드_list = 잔고_dic.keys()
종목코드_list_str = ";".join(종목코드_list)
MyLogger.instance().logger().info("종목코드_list_str %s", 종목코드_list_str)
kiwoom.set_real_reg(종목코드_list_str)
示例5: send_order
def send_order(self, 주문유형, 종목코드, 주문수량, 주문단가, 거래구분):
MyLogger.instance().logger().info("%d, %s, %d, %d, %s", 주문유형, 종목코드, 주문수량, 주문단가, 거래구분)
sRQName = "주식주문"
sScreenNo = constant.SN_주식주문
ret = self.ocx.dynamicCall("SendOrder(QString, QString, QString, int, QString, int, int, QString, QString)",
[sRQName, sScreenNo, self.data.계좌번호, 주문유형, 종목코드, 주문수량, 주문단가, 거래구분, ""])
MyLogger.instance().logger().info("call SendOrder(). ret: %d", ret)
return ret
示例6: on_save_balance_btn_clicked
def on_save_balance_btn_clicked(self):
MyLogger.instance().logger().info("")
f = open("my_list.txt", "w", encoding='utf8')
list_data = []
for balance in kiwoom.data.잔고_dic.values():
list_data.append(balance.get_dic())
data = json.dumps(list_data, ensure_ascii=False, indent=4)
f.write(data)
f.close()
示例7: on_condition_result_add_btn_clicked
def on_condition_result_add_btn_clicked(self):
MyLogger.instance().logger().info("")
code_text = self.ui.txt_condition_result.toPlainText()
if len(code_text) > 4:
code_list = (eval(code_text))
code_list_str = ";".join(code_list)
kiwoom.tr_multi_code(code_list_str, len(code_list))
else:
MyLogger.instance().logger().error("self.ui.txt_condition_result is too short.")
示例8: on_sell_strategy_add_btn_clicked
def on_sell_strategy_add_btn_clicked(self):
strategy_str = self.ui.combo_sell.currentText()
MyLogger.instance().logger().info("전략: %s", strategy_str)
for balance in self.selected_balance:
param = eval(self.ui.txt_sell_param.text())
if not type(param) == dict:
MyLogger.instance().logger().error("wrong param text: %s", self.ui.txt_sell_param.text())
param = {}
balance.add_sell_strategy(strategy_str, param)
self.on_data_updated(["잔고_dic"])
示例9: OnEventConnect
def OnEventConnect(self, nErrCode):
if nErrCode == 0:
MyLogger.instance().logger().debug("로그인 성공")
account_num = self.ocx.dynamicCall("GetLoginInfo(QString)", ["ACCNO"])
account_num = account_num[:-1]
account_list = account_num.split(";")
self.data.계좌번호_list = account_list
self.data.계좌번호 = account_list[0]
self.callback.on_data_updated(["계좌번호"])
self.callback.on_connected()
示例10: on_buy_strategy_changed
def on_buy_strategy_changed(self, strategy):
from kiwoom.strategy.just_buy import JustBuy
from kiwoom.strategy.buy_on_opening import BuyOnOpening
if strategy == "buy_just_buy":
default_param = JustBuy.get_default_param()
elif strategy == "buy_on_opening":
default_param = BuyOnOpening.get_default_param()
else:
MyLogger.instance().logger().warning("unknown strategy. ignore %s", strategy)
MyLogger.instance().logger().warning("strategy %s, default_param %s", strategy, str(default_param))
self.ui.txt_buy_param.setText(str(default_param))
示例11: refresh_interest_balance
def refresh_interest_balance(self):
MyLogger.instance().logger().debug("")
code_list = []
for balance in self.data.잔고_dic.values():
if balance.보유수량 == 0:
code_list.append(balance.종목코드)
if len(code_list) > 0:
code_list_str = ";".join(code_list)
self.tr_multi_code(code_list_str, len(code_list))
else:
MyLogger.instance().logger().debug("code_list len: %d", len(code_list))
示例12: reload_condition
def reload_condition(self):
MyLogger.instance().logger().info("")
# 잔고 갱신 요청
job = Job(self.tr_balance)
self.job_queue.put(job)
for condition in self.data.조건식_dic.values():
if condition.적용유무 == "1":
# 조건식 실시간 재등록
job = Job(self.send_condition, condition)
self.job_queue.put(job)
示例13: on_sell_strategy_changed
def on_sell_strategy_changed(self, strategy):
from kiwoom.strategy.stop_loss import StopLoss
from kiwoom.strategy.condition_sell import ConditionSell
from kiwoom.strategy.sell_on_closing import SellOnClosing
if strategy == "sell_stop_loss":
default_param = StopLoss.get_default_param()
elif strategy == "sell_condition_sell":
default_param = ConditionSell.get_default_param()
elif strategy == "sell_on_closing":
default_param = SellOnClosing.get_default_param()
else:
MyLogger.instance().logger().warning("unknown strategy. ignore %s", strategy)
MyLogger.instance().logger().warning("strategy %s, default_param %s", strategy, str(default_param))
self.ui.txt_sell_param.setText(str(default_param))
示例14: OnReceiveRealCondition
def OnReceiveRealCondition(self, strCode, strType, strConditionName, strConditionIndex):
MyLogger.instance().logger().info("%s, %s, %s, %s, %s", strCode, self.get_master_code_name(strCode), strType, strConditionName, strConditionIndex)
condition = self.data.get_condition(int(strConditionIndex))
if condition.신호종류 == "매도신호" and strType == 'I': # 매도 조건식 편입
if strCode not in self.data.잔고_dic:
MyLogger.instance().logger().warning("보유 종목 아님. %s", strCode)
return
balance = self.data.get_balance(strCode)
for 매도전략 in balance.매도전략.values():
매도전략.on_condition(int(strConditionIndex), strConditionName)
elif condition.신호종류 == "매수신호" and strType == "I": # 매수 조건식 편입
pass
示例15: OnReceiveConditionVer
def OnReceiveConditionVer(self, lRet, sMsg):
MyLogger.instance().logger().debug("%d %s", lRet, sMsg)
condition_ret = self.ocx.dynamicCall("GetConditionNameList()")
condition_ret = condition_ret[:-1] # 마지막 ";" 제거
condition_list_raw = condition_ret.split(";")
self.data.조건식_dic.clear()
for condition_with_index in condition_list_raw:
if condition_with_index == "":
continue
cur = condition_with_index.split("^")
인덱스 = int(cur[0])
조건명 = cur[1]
condition_instance = self.data.get_condition(인덱스)
condition_instance.조건명 = 조건명
self.callback.on_data_updated(["조건식_dic"])