Skip to content

Commit

Permalink
Strategies return nonnormalized actions (#193)
Browse files Browse the repository at this point in the history
# Describe Request

Strategies return nonnormalized actions.

Fixed #192 

# Change Type

New feature.
  • Loading branch information
cinar authored Sep 7, 2024
1 parent cba1c86 commit 7076260
Show file tree
Hide file tree
Showing 50 changed files with 3,746 additions and 3,778 deletions.
2 changes: 1 addition & 1 deletion strategy/and_strategy.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ func (a *AndStrategy) Compute(snapshots <-chan *asset.Snapshot) <-chan Action {
}
}()

return NormalizeActions(result)
return result
}

// Report processes the provided asset snapshots and generates a report annotated with the recommended actions.
Expand Down
2 changes: 1 addition & 1 deletion strategy/compound/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ func (m *MacdRsiStrategy) Name() string
Name returns the name of the strategy.

<a name="MacdRsiStrategy.Report"></a>
### func \(\*MacdRsiStrategy\) [Report](<https://github.com/cinar/indicator/blob/master/strategy/compound/macd_rsi_strategy.go#L86>)
### func \(\*MacdRsiStrategy\) [Report](<https://github.com/cinar/indicator/blob/master/strategy/compound/macd_rsi_strategy.go#L84>)

```go
func (m *MacdRsiStrategy) Report(c <-chan *asset.Snapshot) *helper.Report
Expand Down
2 changes: 0 additions & 2 deletions strategy/compound/macd_rsi_strategy.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,6 @@ func (m *MacdRsiStrategy) Compute(snapshots <-chan *asset.Snapshot) <-chan strat
return strategy.Hold
})

actions = strategy.NormalizeActions(actions)

return actions
}

Expand Down
332 changes: 166 additions & 166 deletions strategy/compound/testdata/macd_rsi_strategy.csv
Original file line number Diff line number Diff line change
Expand Up @@ -50,48 +50,48 @@ Action
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
0
0
0
Expand All @@ -105,110 +105,110 @@ Action
0
0
-1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
0
0
0
Expand All @@ -230,23 +230,23 @@ Action
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
Loading

0 comments on commit 7076260

Please sign in to comment.