Skip to content

Commit e09adc3

Browse files
Merge pull request #12 from joshyattridge/clean_up_returned_data
Major Improvements and Structure changes
2 parents 4347d84 + aee17ff commit e09adc3

File tree

5 files changed

+428
-457
lines changed

5 files changed

+428
-457
lines changed

README.md

Lines changed: 86 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
The Smart Money Concepts Python Indicator is a sophisticated financial tool developed for traders and investors to gain insights into market sentiment, trends, and potential reversals. This indicator is built using Python, a versatile programming language known for its data analysis and visualization capabilities.
44

5+
![alt text](https://github.com/joshyattridge/smart-money-concepts/blob/21656dd807c4077f345b6cbf29b1bc37672628e9/tests/test_binance.png)
6+
57
## Installation
68

79
```bash
@@ -20,35 +22,100 @@ smc expects properly formated ohlc DataFrame, with column names in lowercase: ["
2022

2123
## Indicators
2224

23-
- FVG - Fair Value Gap
24-
- Highs and Lows
25-
- Swing Tops and Bottoms
26-
- BOS and CHoCH
27-
- OB - Order Block
28-
- VOB - Volumized Order Blocks
29-
- Liquidity
25+
### Fair Value Gap (FVG)
26+
27+
```python
28+
smc.fvg(ohlc)
29+
```
30+
31+
A fair value gap is when the previous high is lower than the next low if the current candle is bullish.
32+
Or when the previous low is higher than the next high if the current candle is bearish.
3033

31-
## Examples
34+
returns:
35+
FVG = 1 if bullish fair value gap, -1 if bearish fair value gap
36+
Top = the top of the fair value gap
37+
Bottom = the bottom of the fair value gap
38+
MitigatedIndex = the index of the candle that mitigated the fair value gap
3239

33-
Please take a look at smc.test.py for more detailed examples on how each indicator works.
40+
### Swing Highs and Lows
3441

3542
```python
36-
smc.fvg(ohlc) # Fair Value Gap
37-
smc.highs_lows(ohlc) # Highs and Lows
38-
smc.swing_tops_bottoms(ohlc, swing_length=10) # Swing Tops and Bottoms
39-
smc.bos_choch(ohlc, close_break=True, filter_liquidity=False) # Detect BOS and CHoCH
40-
smc.ob(ohlc) # Order Block
41-
smc.vob(ohlc) # Volumized Order Blocks
42-
smc.liquidity(ohlc) # Liquidity
43+
smc.swing_highs_lows(ohlc, swing_length = 50)
4344
```
4445

46+
A swing high is when the current high is the highest high out of the swing_length amount of candles before and after.
47+
A swing low is when the current low is the lowest low out of the swing_length amount of candles before and after.
48+
49+
parameters:
50+
swing_length: int - the amount of candles to look back and forward to determine the swing high or low
51+
52+
returns:
53+
HighLow = 1 if swing high, -1 if swing low
54+
Level = the level of the swing high or low
55+
56+
### Break of Structure (BOS) & Change of Character (CHoCH)
57+
58+
```python
59+
smc.bos_choch(ohlc, swing_highs_lows, close_break = True)
60+
```
61+
62+
These are both indications of market structure changing
63+
64+
parameters:
65+
swing_highs_lows: DataFrame - provide the dataframe from the swing_highs_lows function
66+
close_break: bool - if True then the break of structure will be mitigated based on the close of the candle otherwise it will be the high/low.
67+
68+
returns:
69+
BOS = 1 if bullish break of structure, -1 if bearish break of structure
70+
CHOCH = 1 if bullish change of character, -1 if bearish change of character
71+
Level = the level of the break of structure or change of character
72+
BrokenIndex = the index of the candle that broke the level
73+
74+
### Order Blocks (OB)
75+
76+
```python
77+
smc.ob(ohlc, swing_highs_lows, close_mitigation = False)
78+
```
79+
80+
This method detects order blocks when there is a high amount of market orders exist on a price range.
81+
82+
parameters:
83+
swing_highs_lows: DataFrame - provide the dataframe from the swing_highs_lows function
84+
close_mitigation: bool - if True then the order block will be mitigated based on the close of the candle otherwise it will be the high/low.
85+
86+
returns:
87+
OB = 1 if bullish order block, -1 if bearish order block
88+
Top = top of the order block
89+
Bottom = bottom of the order block
90+
OBVolume = volume + 2 last volumes amounts
91+
Percentage = strength of order block (min(highVolume, lowVolume)/max(highVolume,lowVolume))
92+
93+
### Liquidity
94+
95+
```python
96+
smc.liquidity(ohlc, swing_highs_lows, range_percent = 0.01)
97+
```
98+
99+
Liquidity is when there are multiply highs within a small range of each other.
100+
or multiply lows within a small range of each other.
101+
102+
parameters:
103+
swing_highs_lows: DataFrame - provide the dataframe from the swing_highs_lows function
104+
range_percent: float - the percentage of the range to determine liquidity
105+
106+
returns:
107+
Liquidity = 1 if bullish liquidity, -1 if bearish liquidity
108+
Level = the level of the liquidity
109+
End = the index of the last liquidity level
110+
Swept = the index of the candle that swept the liquidity
111+
45112
## Contributing
46113

47114
This project is still in BETA so please feel free to contribute to the project. By creating your own indicators or improving the existing ones.
48115

49116
1. Fork it (https://github.com/joshyattridge/smartmoneyconcepts/fork).
50117
2. Study how it's implemented.
51118
3. Create your feature branch (git checkout -b my-new-feature).
52-
5. Commit your changes (git commit -am 'Add some feature').
53-
6. Push to the branch (git push origin my-new-feature).
54-
7. Create a new Pull Request.
119+
4. Commit your changes (git commit -am 'Add some feature').
120+
5. Push to the branch (git push origin my-new-feature).
121+
6. Create a new Pull Request.

setup.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import codecs
33
import os
44

5-
VERSION = '0.0.14'
5+
VERSION = '0.0.15'
66
DESCRIPTION = 'Getting indicators based on smart money concepts or ICT'
77

88
# read the contents of the README file
@@ -18,7 +18,7 @@
1818
long_description_content_type="text/markdown",
1919
long_description=LONG_DESCRIPTION,
2020
packages=["smartmoneyconcepts"],
21-
install_requires=["pandas==2.0.2", "numpy==1.24.3", "zigzag", "finta==1.3"],
21+
install_requires=["pandas==2.0.2", "numpy==1.24.3"],
2222
keywords=['smart', 'money', 'concepts', 'ict', 'indicators', 'trading', 'forex', 'stocks', 'crypto', 'order', 'blocks', 'liquidity'],
2323
url="https://github.com/joshyattridge/smartmoneyconcepts",
2424
classifiers=[

0 commit comments

Comments
 (0)