Bid
Syntax
Bid(): numberReturn Value
Description
Example
// Get current bid price
const currentBid = this.api.Bid();
console.log(`Current bid price: ${currentBid}`);
// Calculate spread
const spread = this.api.Ask() - this.api.Bid();
console.log(`Current spread: ${spread}`);
// Use in trading decisions
if (this.api.Bid() > previousPrice) {
// Price has increased
// Implement trading logic
}Last updated