Skip to content

Commit

Permalink
Fixes #26, updated README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
Karl Wan authored and Karl Wan committed Jun 10, 2018
1 parent 8820cce commit 6c4a3de
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,11 @@ Nuget package is available in modules, please install the package according to t

<a name="StrategyBuildingAndBacktesting"></a>
### Strategy building & backtesting
// Import your candles
var importer = new YahooFinanceImporter();
var fb = await importer.ImportAsync("FB");
var aapl = await importer.ImportAsync("AAPL");

// Build buy rule & sell rule based on various patterns
var buyRule = Rule.Create(c => c.IsFullStoBullishCross(14, 3, 3))
.And(c => c.IsMacdOscBullish(12, 26, 9))
Expand All @@ -205,8 +210,8 @@ Nuget package is available in modules, please install the package according to t

// Create portfolio instance by using PortfolioBuilder
var runner = new Builder()
.Add(equity, 10)
.Add(equity2, 30)
.Add(fb, 10)
.Add(aapl, 30)
.Buy(buyRule)
.Sell(sellRule)
.Build();
Expand Down

0 comments on commit 6c4a3de

Please sign in to comment.