talibcdl

package module
v0.0.0-...-2ed8176 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 17, 2021 License: BSD-3-Clause Imports: 3 Imported by: 0

README

talib-cdl-go

A pure Go port of ta-lib only in candle recognition module (CDL).

For more information, see test cases and godoc.

Documentation

Index

Constants

View Source
const DefaultFloat64 = -4e+37

Variables

View Source
var (
	List = []PatternDefinition{
		{

			Detect:               TwoCrows,
			ShouldApplyOnUptrend: true,
			Behavior:             behavior.RecordLowAndNextSameLowTriggerBear,
			BehaviorRange:        10,
		},
	}
)

Functions

func AbandonedBaby

func AbandonedBaby(series Series, penetration float64) []int

AbandonedBaby implements ta-lib function TA_CDLABANDONEDBABY.

|       Up:              70%
▓   |   Down:            30%
▓   ░   Common Rank:     J+
▓   ░   Efficiency Rank: A-
|   ░   Source:          feedroll.com
    |
  +

func AdvanceBlock

func AdvanceBlock(series Series) []int

AdvanceBlock implements ta-lib function TA_CDLADVANCEBLOCK.

  | |   Up:              64%
  | ░   Down:            36%
| ░ |   Common Rank:     G
░ |     Efficiency Rank: F
░       Source:          feedroll.com
░

func BeltHold

func BeltHold(series Series) []int

BeltHold implements ta-lib function TA_CDLBELTHOLD.

.   Up:              71%
░   Down:            29%
░   Common Rank:     C+
░   Efficiency Rank: G+
    Source:          feedroll.com

func BreakAway

func BreakAway(series Series) []int

BreakAway implements ta-lib function TA_CDLBREAKAWAY.

|           Up:              63%
▓       |   Down:            37%
▓       ░   Common Rank:     J-
|       ░   Efficiency Rank: B+
  | | | ░   Source:          feedroll.com
  ▓ ░ ▓ |
  | | |

func ClosingMarubozu

func ClosingMarubozu(series Series) []int

ClosingMarubozu implements ta-lib function TA_CDLCLOSINGMARUBOZU.

  |   Continuation:    52%
░ ▓   Reversal:        48%
░ ▓   Common Rank:     B-
░ ▓   Efficiency Rank: E+
|     Source:          feedroll.com

func ConcealBabySwall

func ConcealBabySwall(series Series) []int

ConcealBabySwall implements ta-lib function TA_CDL2CROWS.

▓         Up:              25%
▓         Down:            75%
▓ ▓   ▓   Common Rank:     J-
  ▓ | ▓   Efficiency Rank: J-
    ▓ ▓   Source:          feedroll.com

func CounterAttack

func CounterAttack(series Series) []int

CounterAttack implements ta-lib function TA_CDLCOUNTERATTACK.

|       Up:              43%
░ |     Down:            57%
| ▓     Common Rank:     F+
  |     Efficiency Rank: C-
        Source:          feedroll.com

can be bullish or bearish bullish occurs during a downtrend bearish occurs during an uptrend

func DarkCloudCover

func DarkCloudCover(series Series, penetration float64) []int

DarkCloudCover implements ta-lib function TA_CDLDARKCLOUDCOVER.

  |
| ░     Up:              40%
▓ ░     Down:            60%
▓ ░     Common Rank:     E
▓ |     Efficiency Rank: C+
|       Source:          feedroll.com

close of black candle below the middle of first white candle occurs during an uptrend

func Doji

func Doji(series Series) []int

Doji implements ta-lib function TA_CDLDOJI.

  • Up: 43% Down: 57% Common Rank: E- Efficiency Rank: J+ Source: feedroll.com

func DojiStar

func DojiStar(series Series) []int

DojiStart implements ta-lib function TA_CDLDOJISTAR.

|       Up:              36%
▓       Down:            64%
▓       Common Rank:     F+
|       Efficiency Rank: E-
 +      Source:          feedroll.com

func DragonFlyDoji

func DragonFlyDoji(series Series) []int

DragonFlyDoji implements ta-lib function TA_CDLDRAGONFLYDOJI.

---      Continuation:    50%
 |       Reversal:        50%
 |       Common Rank:     E
 |       Efficiency Rank: J-
 |       Source:          feedroll.com

– A Dragonfly Doji has only the Lower Shadow, that is very long, and no Upper Shadow; in fact it has as High, both the Opening Price and Closing Price.

– If it occurs during a Downtrend, especially if near a Low of the Trend, it means a possible bullish reversal.

/!\ do not use for up/down prediction, but only for continuation/reversal prediction /!\

func Engulfing

func Engulfing(series Series) []int

Engulfing implements ta-lib function TA_CDLENGULFING.

Bearish:

  |
| ░     Up:              21%
| ░     Down:            79%
▓ ░     Common Rank:     B+
▓ ░     Efficiency Rank: J+
| ░     Source:          feedroll.com
  |

– Normally it should be a signal of reversal of the current Trend.

– You can find it in the variants: Bullish and Bearish, depending on the Trend in which is located.

– Is one of the most reliable Candlestick Pattern; very often is not even required a confirmation from the next Candles (Although it should be better).

– If this Pattern is located near an High or Low of the current Trend, it’s more reliable.

Bullish:

  |
| ▓     Up:              63%
| ▓     Down:            37%
░ ▓     Common Rank:     B+
░ ▓     Efficiency Rank: I
| ▓     Source:          feedroll.com
  |

– As you can see from the previous image, the Bullish Engulfing occurs during a Downtrend; normally it should be a signal of bullish reversal.

– Whereas the Bearish Engulfing occurs during an Uptrend; normally it should be a signal of bearish reversal.

func EveningDojiStar

func EveningDojiStar(series Series, penetration float64) []int

EveningDojiStar implements ta-lib function TA_CDLEVENINGDOJISTAR.

func EveningStar

func EveningStar(series Series, penetration float64) []int

EveningStar implements ta-lib function TA_CDLEVENINGSTAR.

  |     Up:              28%
| ░ |   Down:            72%
░ | ▓   Common Rank:     H+
░   ▓   Efficiency Rank: A
|   ▓   Source:          feedroll.com
    |

func GapSideSideWhite

func GapSideSideWhite(series Series) []int

GapSideSideWhite implements ta-lib function TA_CDLGAPSIDESIDEWHITE.

  | |   Up:              66%
  ▓ ▓   Down:            34%
  ▓ ▓   Common Rank:     H+
  | |   Efficiency Rank: E
|       Source:          feedroll.com
▓
▓
|

– Normally it should be a signal of continuation of the current Trend.

– You can find it in the variants: Bullish and Bearish, depending on the Trend in which is located.

func GraveStoneDoji

func GraveStoneDoji(series Series) []int

GraveStoneDoji implements ta-lib function TA_CDLGRAVESTONEDOJI.

 |   Continuation:    49%
 |   Reversal:        51%
 |   Common Rank:     E+
 |   Efficiency Rank: H
-+-  Source:          feedroll.com

– A Gravestone Doji has only the Upper Shadow, that is very long, and no Lower Shadow; in fact it has as Low, both the Opening Price and Closing Price.

– If it occurs during an Uptrend, especially if near an High of the Trend, it means a possible bearish reversal.

func Hammer

func Hammer(series Series) []int

Hammer implements ta-lib function TA_CDLHAMMER.

|   Up:              60%
░   Down:            40%
|   Common Rank:     D
|   Efficiency Rank: G
|   Source:          feedroll.com

at the end of a downtrend

func HangingMan

func HangingMan(series Series) []int

HangingMan implements ta-lib function TA_CDLHANGINGMAN.

| | Up: 59% ▓ ░ Down: 41% | O | Common Rank: B | R | Efficiency Rank: I | | Source: feedroll.com

at the end of an uptrend

func Harami

func Harami(series Series) []int

Harami implements ta-lib function TA_CDLHARAMI.

|     Up:              53%
░ |   Down:            47%
░ ▓   Common Rank:     C
░ |   Efficiency Rank: D-
|     Source:          feedroll.com

func HaramiCross

func HaramiCross(series Series) []int

HaramiCross implements ta-lib function TA_CDLHARAMI.

|     ?:               ?
░ |   ?:               ?
░ +   Common Rank:     ?
░ |   Efficiency Rank: ?
|

func HighWave

func HighWave(series Series) []int

HighWave implements ta-lib function TA_CDLHIGHWAVE.

   |    |   Continuation:        49%
   |    |   Reversal:            54%
   ░ OR ▓   Common Rank:         B
   |    |   Efficiency Rank:     G
   |    |   Source:              feedroll.com

– In the case there is more than one High Wave, one after the other, they show the indecision of the Markets.

– If they occur during an Uptrend, they are a signal of a future consolidation of the prices or the beginning of a Downtrend; whereas if they occur during a Downtrend, they are a signal of a future consolidation of the prices or the beginning of an Uptrend.

func Hikkake

func Hikkake(series Series) []int

Hikkake implements ta-lib function TA_CDLHIKKAKE.

TODO

func InvertedHammer

func InvertedHammer(series Series) []int

InvertedHammer implements ta-lib function TA_CDLINVERTEDHAMMER.

|   Up:              35%
|   Down:            65%
|   Common Rank:     G+
░   Efficiency Rank: A
|   Source:          feedroll.com

only to be considered when in downtrend (at the end of a downtrend)

func MatchingLow

func MatchingLow(series Series) []int

MatchingLow implements ta-lib function TA_CDLMATCHINGLOW.

|     Up:              39%
▓ |   Down:            61%
▓ ▓   Common Rank:     F-
▓ ▓   Efficiency Rank: A-
▓ ▓   Source:          feedroll.com
| |

func MorningStar

func MorningStar(series Series, penetration float64) []int

MorningStar implements ta-lib function TA_CDLMORNINGSTAR.

|   |    Up:              78%
░   ▓    Down:            22%
░   ▓    Common Rank:     G
| | ▓    Efficiency Rank: B+
  ░ |    Source:          feedroll.com
  |

func Piercing

func Piercing(series Series) []int

Piercing implements ta-lib function TA_CDLPIERCING.

|     Up:              64%
▓ |   Down:            39%
▓ ░   Common Rank:     D-
▓ ░   Efficiency Rank: B+
| ░   Source:          feedroll.com
  |

func StickSandwich

func StickSandwich(series Series) []int

StickSandwich implements ta-lib function TA_CDLBREAKAWAY.

    |       Up:              38%
  | ▓       Down:            62%
| ░ ▓       Common Rank:     F-
▓ ░ ▓       Efficiency Rank: B
▓ ░ ▓       Source:          feedroll.com
▓ | ▓
    |

func ThreeBlackCrows

func ThreeBlackCrows(series Series) []int

ThreeBlackCrows implements ta-lib function TA_CDL3BLACKCROWS.

▓       Up:              22%
▓ ▓     Down:            78%
  ▓ ▓   Common Rank:     F-
    ▓   Efficiency Rank: A+
        Source:          feedroll.com

func ThreeInside

func ThreeInside(series Series) []int

ThreeInside implements ta-lib function TA_CDL3INSIDE.

|       Up:              40%
░ | |   Down:            60%
░ ▓ ▓   Common Rank:     D+
░ | ▓   Efficiency Rank: F
|   ▓   Source:          feedroll.com
    |

func ThreeLineStrike

func ThreeLineStrike(series Series) []int

ThreeLineStrike implements ta-lib function TA_CDL3LINESTRIKE.

    | |   Up:              35%
  | ░ ▓   Down:            65%
| ░ ░ ▓   Common Rank:     J
░ ░ | ▓   Efficiency Rank: A+
░ |   ▓   Source:          feedroll.com
|     ▓
      |

func ThreeOutside

func ThreeOutside(series Series) []int

ThreeOutside implements ta-lib function TA_CDL3OUTSIDE.

  |     Up:              31%
| ▓ |   Down:            69%
░ ▓ ▓   Common Rank:     C+
░ ▓ ▓   Efficiency Rank: D-
| ▓ ▓   Source:          feedroll.com
  | ▓
    |

func ThreeStarsInSouth

func ThreeStarsInSouth(series Series) []int

ThreeStarsInSouth implements ta-lib function TA_CDL3STARSINSOUTH.

▓       Up:              86%
▓ ▓     Down:            14%
▓ ▓ ▓   Common Rank:     J-
| |     Efficiency Rank: J-
|       Source:          feedroll.com

func ThreeWhiteSoldiers

func ThreeWhiteSoldiers(series Series) []int

ThreeWhiteSoldiers implements ta-lib function TA_CDL3WHITESOLDIERS.

    ░   Up:              82%
  ░ ░   Down:            18%
░ ░     Common Rank:     G
░       Efficiency Rank: D+
        Source:          feedroll.com

func TwoCrows

func TwoCrows(series Series) []int

TwoCrows implements ta-lib function TA_CDL2CROWS.

  |     Up:              46%
  ▓ |   Down:            54%
  ▓ ▓   Common Rank:     G
  | ▓   Efficiency Rank: G+
|   ▓   Source:          feedroll.com
░   |
░
░
|

Types

type Pattern

type Pattern func(Series) []int

type PatternDefinition

type PatternDefinition struct {
	Detect func(series Series) []int

	ShouldApplyOnUptrend   bool
	ShouldApplyOnDowntrend bool

	Behavior behavior.Behavior

	BehaviorRange int
}

type PatternPenetration

type PatternPenetration func(Series, float64) []int

type Series

type Series interface {
	Len() int
	High(i int) float64
	Open(i int) float64
	Close(i int) float64
	Low(i int) float64
}

type SimpleSeries

type SimpleSeries struct {
	Highs   []float64
	Opens   []float64
	Closes  []float64
	Lows    []float64
	Volumes []float64
	Rands   []float64
}

func (SimpleSeries) Close

func (s SimpleSeries) Close(i int) float64

func (SimpleSeries) High

func (s SimpleSeries) High(i int) float64

func (SimpleSeries) Len

func (s SimpleSeries) Len() int

func (SimpleSeries) Low

func (s SimpleSeries) Low(i int) float64

func (SimpleSeries) Open

func (s SimpleSeries) Open(i int) float64

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL