Giter Club home page Giter Club logo

Comments (5)

matthewgilbert avatar matthewgilbert commented on June 30, 2024

It's helpful to include a full print out of messages to the console with con.debug = True for debugging purposes. Running your above snippet (with or without any overrides) I am seeing

import pdblp
con = pdblp.BCon(debug=True)
con.start()
con.bdh('SPY US EQUITY', 'SP_VOL_SURF_MID', '20150629', '20150630')
DEBUG:root:Sending Request:
 HistoricalDataRequest = {
    securities[] = {
        "SPY US EQUITY"
    }
    fields[] = {
        "SP_VOL_SURF_MID"
    }
    startDate = "20150629"
    endDate = "20150630"
    overrides[] = {
    }
}

DEBUG:root:Message Received:
 HistoricalDataResponse = {
    securityData = {
        security = "SPY US EQUITY"
        eidData[] = {
        }
        sequenceNumber = 0
        fieldExceptions[] = {
            fieldExceptions = {
                fieldId = "SP_VOL_SURF_MID"
                errorInfo = {
                    source = "236::bbdbh1"
                    code = 1
                    category = "BAD_FLD"
                    message = "Not valid historical field"
                    subcategory = "NOT_APPLICABLE_TO_HIST_DATA"
                }
            }
        }
        fieldData[] = {
        }
    }
}

Which seems to indicate this field is not available through a HistoricalDataRequest and is unrelated to any overrides.

from pdblp.

FDara avatar FDara commented on June 30, 2024

Thanks. This is a bdp function and not BDH. It's what It is ReferenceDataRequest. Is ReferenceDataRequest not supported in pdblp?

from pdblp.

matthewgilbert avatar matthewgilbert commented on June 30, 2024

ReferenceDataRequests are supported through BCon.ref, you can take a look at the tutorial to give you more info on relevant functionality https://matthewgilbert.github.io/pdblp/tutorial. When I run

con.ref('SPY US EQUITY', 'SP_VOL_SURF_MID')
DEBUG:root:Sending Request:
 ReferenceDataRequest = {
    securities[] = {
        "SPY US EQUITY"
    }
    fields[] = {
        "SP_VOL_SURF_MID"
    }
    overrides[] = {
    }
}

DEBUG:root:Message Received:
 ReferenceDataResponse = {
    securityData[] = {
        securityData = {
            security = "SPY US EQUITY"
            eidData[] = {
            }
            fieldExceptions[] = {
            }
            sequenceNumber = 0
            fieldData = {
            }
        }
    }
}

I am not getting any errors in the response message however I am also not getting any data. This could be a permission issue of my end though, since for the field SP_VOL_SURF_MID I see

Single point volatility surface mid interpolated from BVOL... BVOL source data
is for privileged Bloomberg Valuation (BVAL) users only.

from pdblp.

FDara avatar FDara commented on June 30, 2024

Thank you I got it working the following way. Can you also tell me how can I choose a range for REFERENCE_DATE override. Right now it is set to 1 day only. Should I loop and append? or there is a way to pass in a range in the function?

import pdblp

con = pdblp.BCon(debug=True)
con.start()

print con.ref('SPY US EQUITY', 'SP_VOL_SURF_MID',ovrds=[('REFERENCE_DATE','20170525'),('VOL_SURF_EXPIRY_OVR','20180119'),('VOL_SURF_STRIKE_OVR','200')])

          ticker            field      value
0  SPY US EQUITY  SP_VOL_SURF_MID  19.261268
 ReferenceDataRequest = {
    securities[] = {
        "SPY US EQUITY"
    }
    fields[] = {
        "SP_VOL_SURF_MID"
    }
    overrides[] = {
        overrides = {
            fieldId = "REFERENCE_DATE"
            value = "20170525"
        }
        overrides = {
            fieldId = "VOL_SURF_EXPIRY_OVR"
            value = "20180119"
        }
        overrides = {
            fieldId = "VOL_SURF_STRIKE_OVR"
            value = "200"
        }
    }
}

DEBUG:root:Message Received:
 ReferenceDataResponse = {
    securityData[] = {
        securityData = {
            security = "SPY US EQUITY"
            eidData[] = {
            }
            fieldExceptions[] = {
            }
            sequenceNumber = 0
            fieldData = {
                SP_VOL_SURF_MID = 19.261268
            }
        }
    }
}

from pdblp.

matthewgilbert avatar matthewgilbert commented on June 30, 2024

Looping and appending is one way, you could also take a look at the ref_hist method. Since I don't have access to this data it is difficult for me to provide more help, but given that you are overriding the REFERENCE_DATE the ref_hist method should work.

from pdblp.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.