forked from oss-jtyd/gocryptotrader
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
(GCTScript) Add technical analysis support via script bindings (thras…
…her-corp#467) * added mfi and example * renamed to moving average * converted to array return type and added obv and mfi * started work on test coverage * test coverage added for rsi & mfi * test coverage added for all indicators removed go mod replace moved to append helper method * moved all indicators to new appendTo and increased test coverage * added additional test and bumped go-talib to latest commi * go.mod update * linter fixes * go mod clean up * small fixes * reverted changes from previous attempt to rework as data is still incorrect now passing full OHLCV data back to script binding * testing new structure of passing full ohlcv data * started linking ohlcv to gctscript * OHCLV link up completed reworking passing back to indicators started * OHCLV link up completed reworking passing back to indicators started * added test coverage for tofloat * linter fixes (gofmt) * removed unused value * improved test coverage * added correct detection for 1w added ParseInterval test coverage moved OHCLV string to const * removed unused value * first round of changes addressed * all indicators have been split with packages named after each indicator and a new calculate() method added * linters * fixed tests * added check to check ta is running in validator for uploading * Added test data for OHLCV testing new indicator interface for wrapper * typed const to float64 * reworked validator data to generate previous timestamps * rewored macd to return slice of array * adding bbands linking and example * why didn't this pick it up before :D * bumped up total number of modules for test * moved parseIndicator to exchange added comments * test coverage added for ParseMAType & ParseIndicatorSelector * gofmt * WIP changes * updated tests for bbands & obv bumped to latest go-talib * move multiple use strong to const * reverted rpc.pb.go to master * added 4w option * removed selector from obv as unneeded * improved test coverage and reworked all indicator methods on how they pass errors back * order incoming OHCLV data * revert go.mod * removed verbose toggles * added spot asset type * removed 4w as its unused/uncommon * renamed * reworked further tests * converted all examples to use coinbasepro for consistency * updated all date ranges to 2019 + 6 months * backported binance OHLCV wrapper from thrasher-corp#479 * removed o * rounded numbers * chnage requests addressed and attempt to fix MACD... today has been really unproctive code wise :D * Migrated to gct-ta library * Corrected test import * wording changes on test * removed TA lib from go.mod * PR changes addressed Removed parallel running from tests due to slight possibility in very extreme cases TestExecution might not be set to the expected value and will cause lower test coverage * removed pkg folder * bumped gct-ta version * gct-ta version bump
- Loading branch information
Showing
36 changed files
with
1,882 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
fmt := import("fmt") | ||
exch := import("exchange") | ||
t := import("times") | ||
|
||
load := func() { | ||
start := t.add(t.now(), -t.hour*24) | ||
ohlcvData := exch.ohlcv("coinbasepro", "BTC-USD", "-", "SPOT", start, t.now(), "1h") | ||
fmt.println(ohlcvData) | ||
} | ||
|
||
load() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
fmt := import("fmt") | ||
exch := import("exchange") | ||
t := import("times") | ||
atr := import("indicator/atr") | ||
|
||
load := func() { | ||
start := t.date(2017, 8 , 17, 0 , 0 , 0, 0) | ||
end := t.add_date(start, 0, 6 , 0) | ||
ohlcvData := exch.ohlcv("binance", "BTC-USDT", "-", "SPOT", start, end, "1d") | ||
|
||
ret := atr.calculate(ohlcvData.candles, 14) | ||
fmt.println(ret) | ||
} | ||
|
||
load() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
fmt := import("fmt") | ||
exch := import("exchange") | ||
t := import("times") | ||
bbands := import("indicator/bbands") | ||
|
||
load := func() { | ||
start := t.date(2017, 8 , 17 , 0 , 0 , 0, 0) | ||
end := t.add_date(start, 0, 6 , 0) | ||
ohlcvData := exch.ohlcv("binance", "BTC-USDT", "-", "SPOT", start, end, "1d") | ||
|
||
ret := bbands.calculate("close", ohlcvData.candles, 20, 2.0, 2.0, "sma") | ||
fmt.println(ret) | ||
} | ||
|
||
load() |
Oops, something went wrong.