打开主菜单
首页
随机
登录
设置
关于BPAX Lab
免责声明
BPAX Lab
搜索
查看“Abbreviations replacement project”的源代码
←
Abbreviations replacement project
因为以下原因,您没有权限编辑本页:
您请求的操作仅限属于这些用户组的用户执行:
管理员
、editor、super-saiyan-1、super-saiyan-2、super-saiyan-3、super-saiyan-blue、super-saiyan-red、flashcard-user、PA老友记管理员
不允许您执行您所请求的操作。
您可以查看和复制此页面的源代码。
<syntaxhighlight lang="python3" line="1"> import re # 定义替换规则 patterns = [ (r'\bBRB\b', 'bear body'), (r'\bTTR\b', 'tight trading range'), (r'\bOB\b', 'outside bar'), (r'\bIB\b', 'inside bar'), (r'\bFBO\b', 'failed breakout'), (r'\bMTR\b', 'major trend reversal'), (r'\bPW\b', 'parabolic wedge'), (r'\bL2\b', 'low 2'), (r'\bHOD\b', 'high of today'), (r'\bLOD\b', 'low of today'), (r'\bHPW\b', 'wait for higher probability'), (r'\bBRE2\b', 'bear exit above'), (r'\bBRE4\b', 'bear exit above'), (r'\bBOP\b', 'breakout point'), (r'\bSPBR\b', 'surprise bear bar'), (r'\bPP\b', "60% or higher probability"), (r'\bS\b', 'bear bar'), (r'\bSB\b', 'seller below'), (r'\bPS\b', 'lower than 50% probability'), (r'\bMGB\b', 'magnet below'), (r'\bMMD\b', 'measured move down'), (r'\bY\b', 'yesterday'), (r'\bBO\b', 'breakout'), (r'\bLOY\b', 'low of yesterday'), (r'\bREV\b', 'reversal'), (r'\bBR\b', 'bears'), (r'\bCH\b', 'channel'), (r'\bDD\b', 'doji'), (r'\bBL\b', 'bulls'), (r'\bBRN\b', 'big round number'), (r'\bSS\b', 'sell signal'), (r'\bBL\b', 'bulls'), (r'\bSBDM\b', 'surprise bears dominant major trend'), (r'\bSBU\b', 'Surprisingly big bulls'), (r'\bPL\b', "50% or lower probability"), (r'\bS2\b', "Weak Trader's Equation wait for higher probability sell"), (r'\bBL\b', "bulls"), (r'\bSC\b', 'spike and channel'), (r'\bPTG\b', 'profit taking'), (r'\bBRTP\b', 'bear trap, failed bear breakout'), (r'\bSTC\b', 'sell the close'), (r'\bMRV\b', 'minor reversal '), (r'\bBUDC\b', 'BUDC 60% probability of trading range'), (r'\bNS\b', 'Not high enough probability for stop entry traders to scalp'), (r'\bMBO\b', 'Minor Breakout, 60% will last 1-5 bars'), (r'\bNWS\b', "need wide stop"), (r'\bBBRBC\b', "big bear bar Closing near its low"), (r'\bBRCH\b', "bear channel"), (r'\bNWS\b', "need wide stop"), (r'\bBB\b', "buyer below"), # (r'\b\b', ""), (r'\bTGT\b', "target"), (r'\bBR\b', "bears"), (r'\bSP\b', "support"), (r'\bTR\b', "trading range"), (r'\bSCBR\b', "Spike and Channel Bear Trend, at least 2 legs down, often in a wedge bottom"), (r'\bSPBR\b', "Small PullBack Bear trend. Most pullbacks are small and only last 1 or 2 bars. 60% or higher probability sellers above prior bar."), (r'\bW\b', "wedge,or anything similar, like any 3 push pattern"), (r'\bREVU\b', "reversal up"), (r'\bBLD\b', "bull doji"), (r'\bMW\b', "micro Wedge, a wedge formed by only 3 - 4 bars"), (r'\bMDRU\b', "Midday reversal up is a bull trend reversal in the middle of the day, sometimes exactly at bar 40 or 41, and sometimes leads to bull trend for rest of day"), ] # 打开文件A.txt并读取内容 with open('A.txt', 'r') as file: data = file.read() # 替换指定字符串 for pattern, replacement in patterns: data = re.sub(pattern, replacement, data) # 将结果写入文件B.txt with open('B.txt', 'w') as file: file.write(data) </syntaxhighlight> [[分类:Automation]]
返回
Abbreviations replacement project
。