Custom Codes

Optuma Forums Optuma Scripting Custom Codes

Tagged: 

This topic contains 4 replies, has 2 voices, and was last updated by Darren Darren 3 days, 16 hours ago.

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #48467

    Duke
    • Topics: 3
    • Replies: 3
    • Posts: 6

    I use to have a list of custom codes that I created and when I moved to the new version I guess I never copied them to my directory.  In trying to recall how to create a code I think I am leaving out a step as this attached example doesn’t generate any data. I also tried using the GetData function with the same results. I also tried just the straight codes with no weighting and same results.  If someone recognizes the error in my code I would be obliged.  

    Attachments:
    #48475
    Darren
    Darren
    • Topics: 28
    • Replies: 145
    • Posts: 173

    Hi Duke,

    I think you need to put the individual symbols in parentheses:

    (SPY:BLMB * 0.6) + (EFA:BLMB * 0.3) + (SHV:BLMB * 0.1)

    Capture

    #48479

    Duke
    • Topics: 3
    • Replies: 3
    • Posts: 6

    That was it, thank you Darren. I was applying the weight outside the symbol call.   

    1 user thanked author for this post.
    #48643

    Duke
    • Topics: 3
    • Replies: 3
    • Posts: 6

    Formulas for Custom Codes

    Darren, as a follow up this question. I am trying to build a graphic (column Chart) of the percent changes of custom codes (which are blended benchmarks.) Normally I would build them in Bloomberg and use the custom symbol there but then I lose a lot of the functionality in Optuma.  However, using that method gives me access to Bloomberg datafields. Since I am now building these codes in Optuma I have to create a script to accomplish the same functionality. As an example, in the attached pic I am trying to build out a simple 1 day percent change. I know the formula can be condensed but is my way of practicing the structure.  The issue I am running into is that the aggregate data is not accurate which make me believe I am not pulling in the previous days values correctly.  In the example the current one day change of the constituents is less than the aggregate summed value. 

    Attachments:
    #48659
    Darren
    Darren
    • Topics: 28
    • Replies: 145
    • Posts: 173

    Hi Duke,

    We have the CHANGE() function which will calculate that for you. Try that instead and see how you go. By default it will be the one day change, but you can click on the text to change the lookback interval:

    Capture1

Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.

Pin It on Pinterest

Share This

By continuing to use the site, you agree to the use of cookies. more information

The cookie settings on this website are set to "allow cookies" to give you the best browsing experience possible. If you continue to use this website without changing your cookie settings or you click "Accept" below then you are consenting to this.

Close