GithubHelp home page GithubHelp logo

Ichimoku indicator about technical HOT 3 CLOSED

freqtrade avatar freqtrade commented on May 4, 2024
Ichimoku indicator

from technical.

Comments (3)

berlinguyinca avatar berlinguyinca commented on May 4, 2024 1

from technical.

hroff-1902 avatar hroff-1902 commented on May 4, 2024

def ichimoku(dataframe, conversion_line_period=20, base_line_periods=60,
laggin_span=120, displacement=30):
"Ichimoku cloud indicator"
df = dataframe.copy()
high_9 = df['high'].rolling(window=conversion_line_period).max()
low_9 = df['low'].rolling(window=conversion_line_period).min()
df['tenkan_sen'] = (high_9 + low_9) / 2
high_26 = df['high'].rolling(window=base_line_periods).max()
low_26 = df['low'].rolling(window=base_line_periods).min()
df['kijun_sen'] = (high_26 + low_26) / 2
# this is to extend the 'df' in future for 26 days
# the 'df' here is numerical indexed df
last_index = df.iloc[-1:].index[0]
last_date = df['date'].iloc[-1].date()
df['senkou_span_a'] = ((df['tenkan_sen'] + df['kijun_sen']) / 2).shift(26)
high_52 = df['high'].rolling(window=laggin_span).max()
low_52 = df['low'].rolling(window=laggin_span).min()
df['senkou_span_b'] = ((high_52 + low_52) / 2).shift(displacement)
# most charting softwares dont plot this line
df['chikou_span'] = df['close'].shift(-displacement) # sometimes -26
return {
'tenkan_sen': df['tenkan_sen'],
'kijun_sen': df['kijun_sen'],
'senkou_span_a': df['senkou_span_a'],
'senkou_span_b': df['senkou_span_b'],
'chikou_span': df['chikou_span'],
'cloud_green': df['senkou_span_a'] > df['senkou_span_b'],
'cloud_red': df['senkou_span_b'] > df['senkou_span_a']
}

from technical.

sidnicholas avatar sidnicholas commented on May 4, 2024

Thanks! Let me know if there's anything I can do to help move things along.

from technical.

Related Issues (20)

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.