Interpreting a Bloomberg Price-to-EMA Percentage Formula
Summary
The document asks what a Bloomberg spreadsheet expression calculates while attempting to reproduce it with another data source. The expression retrieves a security’s last price with a historical data request and divides it by a technical-analysis request for an exponential moving average, then subtracts one and multiplies by one hundred. When the security cell is populated, this produces the percentage difference between the returned price and the returned EMA; otherwise, the spreadsheet cell is left blank.
The EMA request specifies a period of 30 and includes settings for price input, direction, date handling, adjustment for cash distributions and capital changes, and other Bloomberg options. The post does not establish exactly how each setting affects values or why the user’s own calculation differs. Matching results across data sources may require reproducing the source field, observation date, price adjustments, EMA initialization and history, and daily fill conventions. The formula indicates a relative percentage comparison, but its precise numerical equivalence depends on Bloomberg’s field and parameter behavior.
Key ideas
- The spreadsheet condition returns a blank when the security identifier cell is empty.
- For a populated identifier, the formula expresses the retrieved price’s difference from its EMA as a percentage of the EMA.
- The EMA request specifies a 30-period average and a last-price input field.
- Adjustment, date, fill, and initialization settings can affect whether another data source reproduces the same value.
- The document asks about the settings but does not provide a definitive explanation of Bloomberg’s parameter semantics.
Tags
Full text
# Can you tell me what this RBloomberg formula means? # Can you tell me what this RBloomberg formula means? I've been asked to re-create a spreadsheet that used RBloomberg using a different data source. But I'm having trouble figuring out exactly what one of the spreadsheet's formulas does. Can anyone tell me what exactly the following formula is calculating? I think it's something along the lines of (CurrentPrice/30dayEMA-1)*100. But I can't seem to get that calculation to match the values given by this formula. I wonder if this is caused by differences in things like whether this formula is using adjusted prices or not, when the EMA calculation starts, etc. Thanks! =IF($A19<>"",(BDH($A19,"PX_LAST",$B$7,$B$7,"Days=A", "Fill=P", "Dts=H")/BTH($A19,"EMAVG",$B$7,$B$7,"EMAVG","TAPeriod=30","DSClose=PX_LAST","Dir=V","Dts=H","Sort=A","QtTyp=P","Days=T","Per=cd","UseDPDF=N", "CshAdjNormal=Y","CshAdjAbnormal=Y","CapChg=Y")-1)*100,"") (A19 is a security name.B7 is the current date.)
Shown in full with attribution under the source's licence. Licence: CC BY-SA 4.0 (Stack Exchange)
This summary was written by Stratmill's research agent from the original; it is not a copy of the source.