Skip to content

Commit

Permalink
v1.28 - Volume Spread Analysis Implemented
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 Jan 4, 2022
2 parents 6d788af + 41050fc commit 8537b88
Show file tree
Hide file tree
Showing 12 changed files with 56 additions and 20 deletions.
21 changes: 11 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,34 +21,35 @@ Screenipy is totally customizable and it can screen stocks with the settings tha
* Linux users should make sure that the `screenipy.bin` is having `execute` permission.
* **Run** the file. Following window will appear after a brief delay.

![home](https://user-images.githubusercontent.com/6128978/114149274-5c424f80-9938-11eb-9eda-4f300c0248ee.png)
![home](https://raw.githubusercontent.com/pranjal-joshi/Screeni-py/new-features/screenshots/home.png)

* **Configure** the parameters as per your requirement using `Option > 8`.

![config](https://user-images.githubusercontent.com/6128978/114150376-9c560200-9939-11eb-9d46-e7bbd32d6cb1.png)
![config](https://raw.githubusercontent.com/pranjal-joshi/Screeni-py/new-features/screenshots/config.png)

* Following are the screenshots of screening and output results.

![screening](https://user-images.githubusercontent.com/6128978/114150728-ff479900-9939-11eb-9f76-7b98830b0ba4.png)
![results](https://user-images.githubusercontent.com/6128978/114150744-040c4d00-993a-11eb-8a69-a39e831761e7.png)
![done](https://user-images.githubusercontent.com/6128978/114150766-09699780-993a-11eb-82b1-43ec77cba2fb.png)
![screening](https://raw.githubusercontent.com/pranjal-joshi/Screeni-py/new-features/screenshots/screening.png)
![results](https://raw.githubusercontent.com/pranjal-joshi/Screeni-py/new-features/screenshots/results.png)
![done](https://raw.githubusercontent.com/pranjal-joshi/Screeni-py/new-features/screenshots/done.png)

* Once done, you can also save the results in an excel file.

## Hack it your way:
Feel free to Edit the parameters in the `screenipy.ini` file which will be generated by the application.
```
[config]
period = 365d
daystolookback = 20
period = 300d
daystolookback = 30
duration = 1d
minprice = 20.0
maxprice = 50000
minprice = 30
maxprice = 10000
volumeratio = 2
consolidationpercentage = 10
shuffle = y
cachestockdata = y
onlystagetwostocks = y
useEMA = y
useema = n
```
Try to tweak this parameters as per your trading styles. For example, If you're comfortable with weekly charts, make `duration=5d` and so on.

Expand Down
Binary file modified screenshots/config.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified screenshots/done.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified screenshots/home.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified screenshots/results.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified screenshots/screening.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion src/classes/CandlePatterns.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

class CandlePatterns:

reversalPatternsBullish = ['Morning Star', 'Morning Doji Star', '3 Inside Up', 'Hammer', '3 White Soldiers', 'Bullish Engulfing', 'Dragonfly Doji']
reversalPatternsBullish = ['Morning Star', 'Morning Doji Star', '3 Inside Up', 'Hammer', '3 White Soldiers', 'Bullish Engulfing', 'Dragonfly Doji', 'Supply Drought', 'Demand Rise']
reversalPatternsBearish = ['Evening Star', 'Evening Doji Star', '3 Inside Down', 'Inverted Hammer', 'Hanging Man', '3 Black Crows', 'Bearish Engulfing', 'Shooting Star', 'Gravestone Doji']

def __init__(self):
Expand Down
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.27"
VERSION = "1.28"

changelog = colorText.BOLD + '[ChangeLog]\n' + colorText.END + colorText.BLUE + '''
[1.00 - Beta]
Expand Down Expand Up @@ -131,5 +131,8 @@
1. Display more information about an update when it is available.
2. Minor Fixes (MA Confluence).
[1.28]
1. Volume Spread Analysis added for Bullish Reversals. Option > 6 > 5
--- END ---
''' + colorText.END
6 changes: 4 additions & 2 deletions src/classes/ParallelProcessing.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,6 @@ def screenStocks(self, executeOption, reversalOption, maLength, daysForLowestVol
with self.screenCounter.get_lock():
self.screenCounter.value += 1
if not processedData.empty:
# screeningDictionary['Stock'] = colorText.BOLD + \
# colorText.BLUE + stock + colorText.END
screeningDictionary['Stock'] = colorText.BOLD + \
colorText.BLUE + f'\x1B]8;;https://in.tradingview.com/chart?symbol=NSE%3A{stock}\x1B\\{stock}\x1B]8;;\x1B\\' + colorText.END
saveDictionary['Stock'] = stock
Expand Down Expand Up @@ -146,6 +144,7 @@ def screenStocks(self, executeOption, reversalOption, maLength, daysForLowestVol
isInsideBar = screener.validateInsideBar(processedData, screeningDictionary, saveDictionary, chartPattern=respChartPattern, daysToLookback=insideBarToLookback)

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

Expand Down Expand Up @@ -180,6 +179,9 @@ def screenStocks(self, executeOption, reversalOption, maLength, daysForLowestVol
elif reversalOption == 4 and isMaSupport:
self.screenResultsCounter.value += 1
return screeningDictionary, saveDictionary
elif reversalOption == 5 and isVSA and saveDictionary['Pattern'] in CandlePatterns.reversalPatternsBullish:
self.screenResultsCounter.value += 1
return screeningDictionary, saveDictionary
if executeOption == 7 and isLtpValid:
if respChartPattern < 3 and isInsideBar:
self.screenResultsCounter.value += 1
Expand Down
29 changes: 29 additions & 0 deletions src/classes/Screener.py
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,35 @@ def findTrend(self, data, screenDict, saveDict, daysToLookback=None,stockName=""
saveDict['Trend'] = 'Unknown'
return saveDict['Trend']

# Find if stock is validating volume spread analysis
def validateVolumeSpreadAnalysis(self, data, screenDict, saveDict):
try:
data = data.head(2)
try:
# Check for previous RED candles
# Current candle = 0th, Previous Candle = 1st for following logic
if data.iloc[1]['Open'] >= data.iloc[1]['Close']:
spread1 = abs(data.iloc[1]['Open'] - data.iloc[1]['Close'])
spread0 = abs(data.iloc[0]['Open'] - data.iloc[0]['Close'])
lower_wick_spread0 = max(data.iloc[0]['Open'], data.iloc[0]['Close']) - data.iloc[0]['Low']
vol1 = data.iloc[1]['Volume']
vol0 = data.iloc[0]['Volume']
if spread0 > spread1 and vol0 < vol1 and data.iloc[0]['Volume'] < data.iloc[0]['VolMA'] and data.iloc[0]['Close'] <= data.iloc[1]['Open'] and spread0 < lower_wick_spread0:
screenDict['Pattern'] = colorText.BOLD + colorText.GREEN + 'Supply Drought' + colorText.END
saveDict['Pattern'] = 'Supply Drought'
return True
if spread0 < spread1 and vol0 > vol1 and data.iloc[0]['Volume'] > data.iloc[0]['VolMA'] and data.iloc[0]['Close'] <= data.iloc[1]['Open']:
screenDict['Pattern'] = colorText.BOLD + colorText.GREEN + 'Demand Rise' + colorText.END
saveDict['Pattern'] = 'Demand Rise'
return True
except IndexError:
pass
return False
except:
import traceback
traceback.print_exc()
return False

# Find if stock gaining bullish momentum
def validateMomentum(self, data, screenDict, saveDict):
try:
Expand Down
3 changes: 2 additions & 1 deletion src/classes/Utility.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,9 +169,10 @@ def promptReversalScreening():
2 > Screen for Sell Signal (Bearish Reversal)
3 > Screen for Momentum Gainers (Rising Bullish Momentum)
4 > Screen for Reversal at Moving Average (Bullish Reversal)
5 > Screen for Volume Spread Analysis (Bullish VSA Reversal)
0 > Cancel
[+] Select option: """ + colorText.END))
if resp >= 0 and resp <= 4:
if resp >= 0 and resp <= 5:
if resp == 4:
try:
maLength = int(input(colorText.BOLD + colorText.WARN +
Expand Down
10 changes: 5 additions & 5 deletions src/release.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
![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`
1. **Volume Spread Analysis** Added for catching Bullish Reversals - Try `Option > 6 > 5`
1. New **Chart Pattern** Added! **MA Confluence** of 2 MA Signals for high probability trades - Try `Option > 7 > 4`
2. New **Chart Pattern** Added! **IPO Base Breakout** - Try `Option > 7 > 3`
3. 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.)
4. Now **Create Your Own Watchlist** in Excel and screen for only those stocks! Try `Option > W`
5. Bug-Fixes and Performance Upgrades!

## Downloads
* For :desktop_computer: **Windows** users, download **[screenipy.exe](https://github.com/pranjal-joshi/Screeni-py/releases/download/1.27/screenipy.exe)**
* For :penguin: **Linux** users, download **[screenipy.bin](https://github.com/pranjal-joshi/Screeni-py/releases/download/1.27/screenipy.bin)**
* For :apple: **MacOS** users, download **[screenipy.run](https://github.com/pranjal-joshi/Screeni-py/releases/download/1.27/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.28/screenipy.exe)**
* For :penguin: **Linux** users, download **[screenipy.bin](https://github.com/pranjal-joshi/Screeni-py/releases/download/1.28/screenipy.bin)**
* For :apple: **MacOS** users, download **[screenipy.run](https://github.com/pranjal-joshi/Screeni-py/releases/download/1.28/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 8537b88

Please sign in to comment.