Skip to content

Commit ebffa42

Browse files
committed
v1.26 - Screen Stocks for MA Confluence
1 parent 250f49e commit ebffa42

File tree

5 files changed

+42
-13
lines changed

5 files changed

+42
-13
lines changed

src/classes/Changelog.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
from classes.ColorText import colorText
99

10-
VERSION = "1.25"
10+
VERSION = "1.26"
1111

1212
changelog = colorText.BOLD + '[ChangeLog]\n' + colorText.END + colorText.BLUE + '''
1313
[1.00 - Beta]
@@ -124,5 +124,8 @@
124124
2. Configuration generation on first time usage don't need restart anymore!
125125
3. Minor bug-fixes.
126126
127+
[1.26]
128+
1. New Feature: Screen for the MA Confluence pattern Option > 7 > 4.
129+
127130
--- END ---
128131
''' + colorText.END

src/classes/ParallelProcessing.py

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -134,13 +134,18 @@ def screenStocks(self, executeOption, reversalOption, maLength, daysForLowestVol
134134
saveDictionary['Trend'] = 'Unknown'
135135
isCandlePattern = candlePatterns.findPattern(
136136
processedData, screeningDictionary, saveDictionary)
137-
isInsideBar = screener.validateInsideBar(
138-
processedData, screeningDictionary, saveDictionary, chartPattern=respChartPattern, daysToLookback=insideBarToLookback)
139-
isMomentum = screener.validateMomentum(processedData, screeningDictionary, saveDictionary)
140137

138+
isConfluence = False
139+
isInsideBar = False
140+
isIpoBase = False
141141
if respChartPattern == 3 and executeOption == 7:
142142
isIpoBase = screener.validateIpoBase(stock, fullData, screeningDictionary, saveDictionary)
143-
143+
if respChartPattern == 4 and executeOption == 7:
144+
isConfluence = screener.validateConfluence(stock, processedData, screeningDictionary, saveDictionary, percentage=insideBarToLookback)
145+
else:
146+
isInsideBar = screener.validateInsideBar(processedData, screeningDictionary, saveDictionary, chartPattern=respChartPattern, daysToLookback=insideBarToLookback)
147+
148+
isMomentum = screener.validateMomentum(processedData, screeningDictionary, saveDictionary)
144149
if maLength is not None and executeOption == 6:
145150
isMaSupport = screener.findReversalMA(fullData, screeningDictionary, saveDictionary, maLength)
146151

@@ -176,10 +181,13 @@ def screenStocks(self, executeOption, reversalOption, maLength, daysForLowestVol
176181
self.screenResultsCounter.value += 1
177182
return screeningDictionary, saveDictionary
178183
if executeOption == 7 and isLtpValid:
179-
if respChartPattern != 3 and isInsideBar:
184+
if respChartPattern < 3 and isInsideBar:
185+
self.screenResultsCounter.value += 1
186+
return screeningDictionary, saveDictionary
187+
if isConfluence:
180188
self.screenResultsCounter.value += 1
181189
return screeningDictionary, saveDictionary
182-
elif isIpoBase:
190+
if isIpoBase:
183191
self.screenResultsCounter.value += 1
184192
return screeningDictionary, saveDictionary
185193
except KeyboardInterrupt:

src/classes/Screener.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -365,6 +365,20 @@ def validateIpoBase(self, stock, data, screenDict, saveDict, percentage=0.3):
365365
return True
366366
return False
367367

368+
# Find Conflucence
369+
def validateConfluence(self, stock, data, screenDict, saveDict, percentage=0.1):
370+
recent = data.head(1)
371+
if(abs(recent['SMA'][0] - recent['LMA'][0]) <= (recent['SMA'][0] * percentage)):
372+
difference = round(abs(recent['SMA'][0] - recent['LMA'][0])/recent['Close'][0] * 100,2)
373+
if recent['SMA'][0] >= recent['LMA'][0]:
374+
screenDict['MA-Signal'] = colorText.BOLD + colorText.GREEN + f'Confluence ({difference}%)' + colorText.END
375+
saveDict['MA-Signal'] = f'Confluence ({difference}%)'
376+
else:
377+
screenDict['MA-Signal'] = colorText.BOLD + colorText.FAIL + f'Confluence ({difference}%)' + colorText.END
378+
saveDict['MA-Signal'] = f'Confluence ({difference}%)'
379+
return True
380+
return False
381+
368382
'''
369383
# Find out trend for days to lookback
370384
def validateVCP(data, screenDict, saveDict, daysToLookback=ConfigManager.daysToLookback, stockName=None):

src/classes/Utility.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,7 @@ def promptChartPatterns():
191191
1 > Screen for Bullish Inside Bar (Flag) Pattern
192192
2 > Screen for Bearish Inside Bar (Flag) Pattern
193193
3 > Screen for IPO Base Breakout Pattern
194+
4 > Screen for the Confluence (50 & 200 MA/EMA)
194195
0 > Cancel
195196
[+] Select option: """ + colorText.END))
196197
if resp == 1 or resp == 2:
@@ -199,7 +200,11 @@ def promptChartPatterns():
199200
return (resp, candles)
200201
if resp == 3:
201202
return (resp, 1)
202-
if resp >= 0 and resp <= 3:
203+
if resp == 4:
204+
percent = int(input(colorText.BOLD + colorText.WARN +
205+
"\n[+] Enter Percentage within which all MA/EMAs should be (Ideal: 1-2%)? : " + colorText.END))
206+
return (resp, percent/100.0)
207+
if resp >= 0 and resp <= 4:
203208
return resp
204209
raise ValueError
205210
except ValueError:

src/release.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,14 @@
11
![MADE-IN-INDIA](https://img.shields.io/badge/MADE%20WITH%20%E2%9D%A4%20IN-INDIA-orange?style=for-the-badge) ![GitHub release (latest by date)](https://img.shields.io/github/v/release/pranjal-joshi/Screeni-py?style=for-the-badge) ![GitHub all releases](https://img.shields.io/github/downloads/pranjal-joshi/Screeni-py/total?color=Green&label=Downloads&style=for-the-badge) ![MADE_WITH](https://img.shields.io/badge/BUILT%20USING-PYTHON-yellow?style=for-the-badge&logo=python&logoColor=yellow)
22
## What's New?
3+
1. New **Chart Patter** Added! **MA Confluence** of 2 MA Signals for high probability trades - Try `Option > 7 > 4` :rocket:
34
1. New **Chart Pattern** Added! **IPO Base Breakout** - Try `Option > 7 > 3`
45
2. Now, Open TradingView chart directly by clicking on the stock symbol! :tada: (Windows users should download and run the Application through the **Windows Terminal** from the Microsoft Store.)
5-
3. Screen for the Stocks in the Index that you :heart:. Index-wise Screening is here! (Thanks to [**swarpatel23**](https://github.com/swarpatel23))
66
4. Now **Create Your Own Watchlist** in Excel and screen for only those stocks! Try `Option > W` :chart_with_upwards_trend:
7-
5. Bug-fixes & Performance upgrades for MultiCore CPUs. :gear:
87

98
## Downloads
10-
* For :desktop_computer: **Windows** users, download **[screenipy.exe](https://github.com/pranjal-joshi/Screeni-py/releases/download/1.25/screenipy.exe)**
11-
* For :penguin: **Linux** users, download **[screenipy.bin](https://github.com/pranjal-joshi/Screeni-py/releases/download/1.25/screenipy.bin)**
12-
* For :apple: **MacOS** users, download **[screenipy.run](https://github.com/pranjal-joshi/Screeni-py/releases/download/1.25/screenipy.run)** ([Read Installation Guide](https://github.com/pranjal-joshi/Screeni-py/blob/main/INSTALLATION.md#for-macos))
9+
* For :desktop_computer: **Windows** users, download **[screenipy.exe](https://github.com/pranjal-joshi/Screeni-py/releases/download/1.26/screenipy.exe)**
10+
* For :penguin: **Linux** users, download **[screenipy.bin](https://github.com/pranjal-joshi/Screeni-py/releases/download/1.26/screenipy.bin)**
11+
* For :apple: **MacOS** users, download **[screenipy.run](https://github.com/pranjal-joshi/Screeni-py/releases/download/1.26/screenipy.run)** ([Read Installation Guide](https://github.com/pranjal-joshi/Screeni-py/blob/main/INSTALLATION.md#for-macos))
1312

1413
## How to use?
1514

0 commit comments

Comments
 (0)