I’m using Paper Trading and the below code to pull current position of a pair.
Using “ETH/BTC” and “ETHBTC” as the pair for the request but neither returns the position. I have 3 positions open in ETH/BTC I can see on the web portal.
It does work with ETHUSD and BTCUSD nut not cross pairs
I’m using bot the JS module here
async function getMyPosition(){
try {
await client.getPosition("ETHBTC").then( (data) => {
res = data;
// positionQuantity = data.qty;
// positionValue = data.market_value;
});
console.log(res);
} catch (error) {
console.log('error');
};
};
For python I’m using alpaca-py SDK. It returns all current positions but NOT the ETH/BTC open positions
def get_all_assets(self, user_asset_class):
search_params = GetAssetsRequest(asset_class=user_asset_class)
try:
assets = self.client.get_all_assets(search_params)
for asset in assets:
# print(type(asset), '\n')
# print(asset, '\n')
print(f"symbols: {asset.symbol}\n")
except Exception as e:
print("There was an issue getting trade quote from Alpaca: {0}".format(e))
return False
return assets
![Alpaca Position Return|466x500](upload://rXH1gMVu4NqamUmoBRvhsGn0evc.png)