Setup basic Alpaca action fetch and test.

This commit is contained in:
2023-10-27 17:41:57 -04:00
parent 8437515904
commit 327ab308bf
3 changed files with 27 additions and 3 deletions

View File

@ -37,7 +37,8 @@ export class AlpacaActionProvider {
activity.side === "buy" ? ActionSide.Buy : ActionSide.Sell,
parseFloat(activity.price)
);
})
}),
undefined
);
}).catch((err) => {
return err;

View File

@ -1,6 +1,7 @@
import Alpaca from '@alpacahq/alpaca-trade-api';
import { AlpacaPortfolioProvider } from './portfolio';
import { AlpacaQuoteProvider } from './quote';
import { AlpacaActionProvider } from './actions';
import { Exchange } from '../interface/exchange';
import { PortfolioProvider } from '../interface/portfolio';
import { QuoteProvider } from '../interface/quote';
@ -51,7 +52,7 @@ export class AlpacaExchange implements Exchange {
this.portfolioProvider = new AlpacaPortfolioProvider(this.alpaca);
this.quoteProvider = new AlpacaQuoteProvider(this.alpaca);
this.actionProvider = null!;
this.actionProvider = new AlpacaActionProvider(this.alpaca);
this.name = 'Alpaca';
}