<commit_before>package indicators_test

import (
	"encoding/csv"
	"fmt"
	. "github.com/onsi/ginkgo"
	. "github.com/onsi/gomega"
	"github.com/thetruetrade/gotrade"
	"github.com/thetruetrade/gotrade/feeds"
	"github.com/thetruetrade/gotrade/indicators"
	"io"
	"math"
	"os"
	"strconv"
	"strings"
	"testing"
	"time"
)

var (
	csvFeed          *feeds.CSVFileFeed
	sourceData       []float64        = []float64{5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0, 19.0, 20.0}
	sourceDOHLCVData []gotrade.DOHLCV = []gotrade.DOHLCV{gotrade.NewDOHLCVDataItem(time.Now(), 0.0, 0.0, 0.0, 5.0, 0.0),
		gotrade.NewDOHLCVDataItem(time.Now(), 0.0, 0.0, 0.0, 6.0, 0.0),
		gotrade.NewDOHLCVDataItem(time.Now(), 0.0, 0.0, 0.0, 7.0, 0.0),
		gotrade.NewDOHLCVDataItem(time.Now(), 0.0, 0.0, 0.0, 8.0, 0.0),
		gotrade.NewDOHLCVDataItem(time.Now(), 0.0, 0.0, 0.0, 9.0, 0.0),
		gotrade.NewDOHLCVDataItem(time.Now(), 0.0, 0.0, 0.0, 10.0, 0.0),
		gotrade.NewDOHLCVDataItem(time.Now(), 0.0, 0.0, 0.0, 11.0, 0.0),
		gotrade.NewDOHLCVDataItem(time.Now(), 0.0, 0.0, 0.0, 12.0, 0.0),
		gotrade.NewDOHLCVDataItem(time.Now(), 0.0, 0.0, 0.0, 13.0, 0.0),
		gotrade.NewDOHLCVDataItem(time.Now(), 0.0, 0.0, 0.0, 14.0, 0.0),
		gotrade.NewDOHLCVDataItem(time.Now(), 0.0, 0.0, 0.0, 15.0, 0.0),
		gotrade.NewDOHLCVDataItem(time.Now(), 0.0, 0.0, 0.0, 16.0, 0.0),
		gotrade.NewDOHLCVDataItem(time.Now(), 0.0, 0.0, 0.0, 17.0, 0.0),
		gotrade.NewDOHLCVDataItem(time.Now(), 0.0, 0.0, 0.0, 18.0, 0.0),
		gotrade.NewDOHLCVDataItem(time.Now(), 0.0, 0.0, 0.0, 19.0, 0.0),
		gotrade.NewDOHLCVDataItem(time.Now(), 0.0, 0.0, 0.0, 20.0, 0.0)}
)

func TestIndicators(t *testing.T) {<commit_msg>updated default test data to have entries for open, high, low and close<commit_after>
import (
	"encoding/csv"
	"fmt"
	. "github.com/onsi/ginkgo"
	. "github.com/onsi/gomega"
	"github.com/thetruetrade/gotrade"
	"github.com/thetruetrade/gotrade/feeds"
	"github.com/thetruetrade/gotrade/indicators"
	"io"
	"math"
	"os"
	"strconv"
	"strings"
	"testing"
	"time"
)

var (
	csvFeed          *feeds.CSVFileFeed
	sourceData       []float64        = []float64{5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0, 19.0, 20.0}
	sourceDOHLCVData []gotrade.DOHLCV = []gotrade.DOHLCV{gotrade.NewDOHLCVDataItem(time.Now(), 0.0, 0.0, 0.0, 5.0, 0.0),
		gotrade.NewDOHLCVDataItem(time.Now(), 7.0,  8.0,  5.0, 6.0,  0.0),
		gotrade.NewDOHLCVDataItem(time.Now(), 8.0,  9.0,  6.0,  7.0,  0.0),
		gotrade.NewDOHLCVDataItem(time.Now(), 9.0,  10.0, 7.0,  8.0,  0.0),
		gotrade.NewDOHLCVDataItem(time.Now(), 10.0, 11.0, 8.0,  9.0,  0.0),
		gotrade.NewDOHLCVDataItem(time.Now(), 11.0, 12.0, 9.0,  10.0, 0.0),
		gotrade.NewDOHLCVDataItem(time.Now(), 12.0, 13.0, 10.0, 11.0, 0.0),
		gotrade.NewDOHLCVDataItem(time.Now(), 13.0, 14.0, 11.0, 12.0, 0.0),
		gotrade.NewDOHLCVDataItem(time.Now(), 14.0, 15.0, 12.0, 13.0, 0.0),
		gotrade.NewDOHLCVDataItem(time.Now(), 15.0, 16.0, 13.0, 14.0, 0.0),
		gotrade.NewDOHLCVDataItem(time.Now(), 16.0, 17.0, 14.0, 15.0, 0.0),
		gotrade.NewDOHLCVDataItem(time.Now(), 17.0, 18.0, 15.0, 16.0, 0.0),
		gotrade.NewDOHLCVDataItem(time.Now(), 18.0, 19.0, 16.0, 17.0, 0.0),
		gotrade.NewDOHLCVDataItem(time.Now(), 19.0, 20.0, 17.0, 18.0, 0.0),
		gotrade.NewDOHLCVDataItem(time.Now(), 20.0, 21.0, 18.0, 19.0, 0.0),
		gotrade.NewDOHLCVDataItem(time.Now(), 21.0, 22.0, 19.0, 20.0, 0.0)}
)

func TestIndicators(t *testing.T) {
{'fraction_non_alphanumeric': 0.22346041055718474, 'fraction_numerical': 0.13812316715542522, 'mean_word_length': 3.4530026109660574, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7301934', 'n_tokens_mistral': 2070, 'n_tokens_neox': 1778, 'n_words': 289}