MM01 BASIC DATA1 增强

 Create the append structure on the MARA table.
The SAP note 44410 describes how to add the new fields to the screen and how the updating will work.
1. Make a copy of function group MGD1to ZMGDI as stated inthe Ossnote using program COPYMGDI.
2. Goto Se38 enter program name SAPLZMGDI Click Display and goto--> program---> other object---> enter screen number '0001' and add your fields to the subscreen which should apper on the the general data section of the basic data1 tab for the tcode MM01
2. Make the changes stated in SAP Note.
3. After make the changes the functional analyst will need to make some configuration changes.
4. SPRO -> Logistic General -> Material Master -> Configuring Materal Master -> Define Structure of Data Screens Sequence.
5. Select SSq = 21 then click on Subscreens select Basic DATA1
6. Enter in the new screens that were built
7. Change the row that was create putting in the program (function group program) that was created in step 2.
$$ 注意:代码块使用$$...$$格式独立成段 $$ import baostock as bs import pandas as pd import numpy as np # 步骤1:数据获取函数 def get_stock_data(): lg = bs.login() rs = bs.query_all_stock(day="最新交易日") data_list = [] while (rs.error_code == '0') & rs.next(): code = rs.get_row_data()[0] if not code.startswith(('sh.68', 'sh.688', 'sz.30')): # 过滤科创板和创业板 rs_profit = bs.query_stock_basic(code=code)[0] rs_val = bs.query_stock_basic(code=code)[1] data = rs_profit + rs_val data_list.append(data) df = pd.DataFrame(data_list, columns=['code','name','peTTM','total_mv','pbMRQ']) bs.logout() return df # 步骤2:基础筛选 def basic_screening(df): df = df[df['total_mv'] < 20*1e8] # 总市值<20亿 df = df[(df['peTTM'] > 0) & (df['peTTM'] < 20)] # 动态市盈率0-20 df = df[~df['name'].str.contains('ST')] # 排除ST return df # 步骤3:RSI计算函数 def calculate_rsi(data, window=14): delta = data['close'].diff() gain = delta.where(delta > 0, 0) loss = -delta.where(delta < 0, 0) avg_gain = gain.rolling(window).mean() avg_loss = loss.rolling(window).mean() rs = avg_gain / avg_loss return 100 - (100 / (1 + rs)) # 步骤4:底背离检测 def detect_divergence(code): try: bs.login() rs = bs.query_history_k_data_plus(code, "date,close", end_date='最新日期', frequency="d", count=30) # 取30日数据 data = pd.DataFrame(rs.data, columns=['date','close']) data['close'] = data['close'].astype(float) data['rsi'] = calculate_rsi(data) # 寻找价格新低但RSI未新低 low_idx = data['close'].argmin() prev_low = data['close'].iloc[:low_idx].min() rsi_current = data['rsi'].iloc[low_idx] rsi_prev = data['rsi'].iloc[:low_idx].min() bs.logout() return (data['close'].iloc[low_idx] < prev_low) and (rsi_current > rsi_prev) except: return False # 步骤5:执行流程 if __name__ == "__main__": df_base = get_stock_data() df_filtered = basic_screening(df_base) # 并行处理RSI检测 df_filtered['rsi_divergence'] = df_filtered['code'].apply(detect_divergence) final_result = df_filtered[df_filtered['rsi_divergence']] print("筛选结果:") print(final_result[['code','name','peTTM','total_mv']])
03-15
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值