Coder Social home page Coder Social logo

nagasaiharsha / smart-money-concepts Goto Github PK

View Code? Open in Web Editor NEW

This project forked from joshyattridge/smart-money-concepts

0.0 0.0 0.0 1.53 MB

Recognized as the premier algorithmic trading tool for Python, this Python package seamlessly integrates Inner Circle Trader (ICT) methods, providing a comprehensive suite of indicators meticulously crafted to analyze the concept of smart money in financial markets.

Home Page: https://pypi.org/project/smartmoneyconcepts/

License: MIT License

Python 100.00%

smart-money-concepts's Introduction

Smart Money Concepts (smc) BETA

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 inspired by Inner Circle Trader (ICT) concepts like Order blocks, Liquidity, Fair Value Gap, Swing Highs and Lows, Break of Structure, Change of Character, and more. Please Take a look and contribute to the project.

alt text

Installation

pip install smartmoneyconcepts

Usage

from smartmoneyconcepts import smc

Prepare data to use with smc:

smc expects properly formated ohlc DataFrame, with column names in lowercase: ["open", "high", "low", "close"] and ["volume"] for indicators that expect ohlcv input.

Indicators

Fair Value Gap (FVG)

smc.fvg(ohlc, join_consecutive=False)

A fair value gap is when the previous high is lower than the next low if the current candle is bullish. Or when the previous low is higher than the next high if the current candle is bearish.

parameters:
join_consecutive: bool - if there are multiple FVG in a row then they will be merged into one using the highest top and the lowest bottom

returns:
FVG = 1 if bullish fair value gap, -1 if bearish fair value gap
Top = the top of the fair value gap
Bottom = the bottom of the fair value gap
MitigatedIndex = the index of the candle that mitigated the fair value gap

Swing Highs and Lows

smc.swing_highs_lows(ohlc, swing_length = 50)

A swing high is when the current high is the highest high out of the swing_length amount of candles before and after. A swing low is when the current low is the lowest low out of the swing_length amount of candles before and after.

parameters:
swing_length: int - the amount of candles to look back and forward to determine the swing high or low

returns:
HighLow = 1 if swing high, -1 if swing low
Level = the level of the swing high or low

Break of Structure (BOS) & Change of Character (CHoCH)

smc.bos_choch(ohlc, swing_highs_lows, close_break = True)

These are both indications of market structure changing

parameters:
swing_highs_lows: DataFrame - provide the dataframe from the swing_highs_lows function
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.

returns:
BOS = 1 if bullish break of structure, -1 if bearish break of structure
CHOCH = 1 if bullish change of character, -1 if bearish change of character
Level = the level of the break of structure or change of character
BrokenIndex = the index of the candle that broke the level

Order Blocks (OB)

smc.ob(ohlc, swing_highs_lows, close_mitigation = False)

This method detects order blocks when there is a high amount of market orders exist on a price range.

parameters:
swing_highs_lows: DataFrame - provide the dataframe from the swing_highs_lows function
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.

returns:
OB = 1 if bullish order block, -1 if bearish order block
Top = top of the order block
Bottom = bottom of the order block
OBVolume = volume + 2 last volumes amounts
Percentage = strength of order block (min(highVolume, lowVolume)/max(highVolume,lowVolume))

Liquidity

smc.liquidity(ohlc, swing_highs_lows, range_percent = 0.01)

Liquidity is when there are multiply highs within a small range of each other. or multiply lows within a small range of each other.

parameters:
swing_highs_lows: DataFrame - provide the dataframe from the swing_highs_lows function
range_percent: float - the percentage of the range to determine liquidity

returns:
Liquidity = 1 if bullish liquidity, -1 if bearish liquidity
Level = the level of the liquidity
End = the index of the last liquidity level
Swept = the index of the candle that swept the liquidity

Previous High And Low

smc.previous_high_low(ohlc, time_frame = "1D")

This method returns the previous high and low of the given time frame.

parameters:
time_frame: str - the time frame to get the previous high and low 15m, 1H, 4H, 1D, 1W, 1M

returns:
PreviousHigh = the previous high
PreviousLow = the previous low

Contributing

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. If you are stuggling to find something to do then please check out the issues tab for requested changes.

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

smart-money-concepts's People

Contributors

joshyattridge avatar rafalsza avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.