Skip to content

Commit

Permalink
v1.26 - Screen Stocks for MA Confluence
Browse files Browse the repository at this point in the history
[Screenipy Test] New Features Added - Test Passed - Merge OK
  • Loading branch information
pranjal-joshi authored Oct 8, 2021
2 parents 77a6626 + ebffa42 commit 580f642
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 13 deletions.
5 changes: 4 additions & 1 deletion src/classes/Changelog.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

from classes.ColorText import colorText

VERSION = "1.25"
VERSION = "1.26"

changelog = colorText.BOLD + '[ChangeLog]\n' + colorText.END + colorText.BLUE + '''
[1.00 - Beta]
Expand Down Expand Up @@ -124,5 +124,8 @@
2. Configuration generation on first time usage don't need restart anymore!
3. Minor bug-fixes.
[1.26]
1. New Feature: Screen for the MA Confluence pattern Option > 7 > 4.
--- END ---
''' + colorText.END
20 changes: 14 additions & 6 deletions src/classes/ParallelProcessing.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,13 +134,18 @@ def screenStocks(self, executeOption, reversalOption, maLength, daysForLowestVol
saveDictionary['Trend'] = 'Unknown'
isCandlePattern = candlePatterns.findPattern(
processedData, screeningDictionary, saveDictionary)
isInsideBar = screener.validateInsideBar(
processedData, screeningDictionary, saveDictionary, chartPattern=respChartPattern, daysToLookback=insideBarToLookback)
isMomentum = screener.validateMomentum(processedData, screeningDictionary, saveDictionary)

isConfluence = False
isInsideBar = False
isIpoBase = False
if respChartPattern == 3 and executeOption == 7:
isIpoBase = screener.validateIpoBase(stock, fullData, screeningDictionary, saveDictionary)

if respChartPattern == 4 and executeOption == 7:
isConfluence = screener.validateConfluence(stock, processedData, screeningDictionary, saveDictionary, percentage=insideBarToLookback)
else:
isInsideBar = screener.validateInsideBar(processedData, screeningDictionary, saveDictionary, chartPattern=respChartPattern, daysToLookback=insideBarToLookback)

isMomentum = screener.validateMomentum(processedData, screeningDictionary, saveDictionary)
if maLength is not None and executeOption == 6:
isMaSupport = screener.findReversalMA(fullData, screeningDictionary, saveDictionary, maLength)

Expand Down Expand Up @@ -176,10 +181,13 @@ def screenStocks(self, executeOption, reversalOption, maLength, daysForLowestVol
self.screenResultsCounter.value += 1
return screeningDictionary, saveDictionary
if executeOption == 7 and isLtpValid:
if respChartPattern != 3 and isInsideBar:
if respChartPattern < 3 and isInsideBar:
self.screenResultsCounter.value += 1
return screeningDictionary, saveDictionary
if isConfluence:
self.screenResultsCounter.value += 1
return screeningDictionary, saveDictionary
elif isIpoBase:
if isIpoBase:
self.screenResultsCounter.value += 1
return screeningDictionary, saveDictionary
except KeyboardInterrupt:
Expand Down
14 changes: 14 additions & 0 deletions src/classes/Screener.py
Original file line number Diff line number Diff line change
Expand Up @@ -365,6 +365,20 @@ def validateIpoBase(self, stock, data, screenDict, saveDict, percentage=0.3):
return True
return False

# Find Conflucence
def validateConfluence(self, stock, data, screenDict, saveDict, percentage=0.1):
recent = data.head(1)
if(abs(recent['SMA'][0] - recent['LMA'][0]) <= (recent['SMA'][0] * percentage)):
difference = round(abs(recent['SMA'][0] - recent['LMA'][0])/recent['Close'][0] * 100,2)
if recent['SMA'][0] >= recent['LMA'][0]:
screenDict['MA-Signal'] = colorText.BOLD + colorText.GREEN + f'Confluence ({difference}%)' + colorText.END
saveDict['MA-Signal'] = f'Confluence ({difference}%)'
else:
screenDict['MA-Signal'] = colorText.BOLD + colorText.FAIL + f'Confluence ({difference}%)' + colorText.END
saveDict['MA-Signal'] = f'Confluence ({difference}%)'
return True
return False

'''
# Find out trend for days to lookback
def validateVCP(data, screenDict, saveDict, daysToLookback=ConfigManager.daysToLookback, stockName=None):
Expand Down
7 changes: 6 additions & 1 deletion src/classes/Utility.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,7 @@ def promptChartPatterns():
1 > Screen for Bullish Inside Bar (Flag) Pattern
2 > Screen for Bearish Inside Bar (Flag) Pattern
3 > Screen for IPO Base Breakout Pattern
4 > Screen for the Confluence (50 & 200 MA/EMA)
0 > Cancel
[+] Select option: """ + colorText.END))
if resp == 1 or resp == 2:
Expand All @@ -199,7 +200,11 @@ def promptChartPatterns():
return (resp, candles)
if resp == 3:
return (resp, 1)
if resp >= 0 and resp <= 3:
if resp == 4:
percent = int(input(colorText.BOLD + colorText.WARN +
"\n[+] Enter Percentage within which all MA/EMAs should be (Ideal: 1-2%)? : " + colorText.END))
return (resp, percent/100.0)
if resp >= 0 and resp <= 4:
return resp
raise ValueError
except ValueError:
Expand Down
9 changes: 4 additions & 5 deletions src/release.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
![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)
## What's New?
1. New **Chart Patter** Added! **MA Confluence** of 2 MA Signals for high probability trades - Try `Option > 7 > 4` :rocket:
1. New **Chart Pattern** Added! **IPO Base Breakout** - Try `Option > 7 > 3`
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.)
3. Screen for the Stocks in the Index that you :heart:. Index-wise Screening is here! (Thanks to [**swarpatel23**](https://github.com/swarpatel23))
4. Now **Create Your Own Watchlist** in Excel and screen for only those stocks! Try `Option > W` :chart_with_upwards_trend:
5. Bug-fixes & Performance upgrades for MultiCore CPUs. :gear:

## Downloads
* For :desktop_computer: **Windows** users, download **[screenipy.exe](https://github.com/pranjal-joshi/Screeni-py/releases/download/1.25/screenipy.exe)**
* For :penguin: **Linux** users, download **[screenipy.bin](https://github.com/pranjal-joshi/Screeni-py/releases/download/1.25/screenipy.bin)**
* 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))
* For :desktop_computer: **Windows** users, download **[screenipy.exe](https://github.com/pranjal-joshi/Screeni-py/releases/download/1.26/screenipy.exe)**
* For :penguin: **Linux** users, download **[screenipy.bin](https://github.com/pranjal-joshi/Screeni-py/releases/download/1.26/screenipy.bin)**
* 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))

## How to use?

Expand Down

0 comments on commit 580f642

Please sign in to comment.