Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

# How to get Price change percent from ticker

See original GitHub issue

There is problem to get Price Change Percent from ticker because the limited variable set in ExchangeSharp.ExchangeTicker class. So how we get Price Change Percent from ticker

``````public sealed class ExchangeTicker
{
public ExchangeTicker();
public string Id { get; set; }
public string MarketSymbol { get; set; }
public decimal Bid { get; set; }
public decimal Ask { get; set; }
public decimal Last { get; set; }
public ExchangeVolume Volume { get; set; }

public void ToBinary(BinaryWriter writer);
public override string ToString();
}
``````

### Issue Analytics

• State:
• Created 4 years ago

1reaction
GonzoKKcommented, Feb 12, 2020

What I like about the GetCandlesAsync approach, you basically can get any time frame you want. Here’s BSVUSD at one hour intervals. I have it on a timer that refreshes every minute or every hour depending on the candle.

Edit: Percent calc fix

1reaction
GonzoKKcommented, Feb 12, 2020

Alternatively, use GetCandlesAsync to get any price history using candle data.

#### Top Results From Across the Web

Calculating Investment Percentage Gains or Losses
Take the selling price and subtract the initial purchase price. · Take the gain or loss from the investment and divide it by...
What Is Percentage Change?
The formula for percentage change is: (New Price - Old Price) / Old Price x 100. The percentage change will be positive if...
How is Percent Change Calculated? [StockCharts Support]
Percent Change, meanwhile, is calculated by dividing the Chg value by the previous period's close and multiplying the result by 100.
How to calculate percentage price changes correctly with ...
... logarithm when calculating percentage price increases and decreases. ... course, Stock prices,Mercursim; percentage change ; delta, ...
How to Calculate Market Price Change of Common Stock
Divide the change in dollars by the original price and multiply by 100 to figure the percentage change. In this example, divide \$2...

#### Troubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free