Chart Elements

Optuma Forums Optuma Scripting Chart Elements

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #55499
    AvatarRaeburne
    • Topics: 2
    • Replies: 4
    • Posts: 6

    Hey guys,

    I was wondering if someone can point me in the right direction, I would like to have an indication on a Chart using  something like a chart element True/False box, that will show a percentage of how far +/- the current close is from my buy price.

    I have been playing with chart elements but i can’t work out how to achieve this. I can get fields from fundamental data, that change as I bring up a new code (I have saved a page layout for this) but what I would like to do is have a single stock fixed to its buy price if that makes sense.

    I apologise if I’m not explaining my self very well. But essentially I would like something that is easily visual on the chart without having to go back to a watch list or my P & L to reference the % of change.

    I have also tried with price alert, but would like to visually clear up the chart so I don’t have lines and markers all over the place, just a neat box on the corner with the info in it.

    Any help would be great

    Cheers

    #55501
    AvatarTrevor R
    • Topics: 60
    • Replies: 190
    • Posts: 250

    Hi Raeburne,

    If I understand you correctly, you would like a script or Tool in which you can set your buy price and then have the ± percentage difference to the current close price displayed using a Chart Element.

    The primary issue I see is your requirement is that there is, to my knowledge at least, no Scripting function that will allow the entry of a price through the Properties of the Script, without opening and changing a variable value within the script code itself – not a desirable necessity.

    What you desire can be done reasonably easily using a Optuma Pascal Custom Tool, but that means you need the Optuma Programming Module and a knowledge of Pascal, which I’m assuming from the nature of your question you do not have.

    Cheers

    Trevor

    The Auld Tyma at

    Auld Tyma Data Logo with URL 1 cm

     

    #55503
    AvatarChad
    • Topics: 4
    • Replies: 12
    • Posts: 16

    Is it similar to a stop loss?

    Heres my code I use for a stop loss.  Maybe you can use this as your starting point and instead of the stop price it’s your buy price.

    I made a user defined script for the Stop Level and then use DATAFIELD to pull those numbers in.

     

    Script Name: Price vs Stop

    (LAST() – DATAFIELD(FEED=UD, FIELD=Stop_Level) )/ LAST()

    #55507
    MathewMathew
    • Topics: 28
    • Replies: 1,229
    • Posts: 1,257

    Hi Raeburne,

    One thing to look at is User Defined Fields in a Watch list. What you can do is have a watchlist with all the codes you have a position in and then in the Watchlist type in your buy price.

    That User Defined Fields is then available in scripting like any other fundamental field and you can script against that using the DataField() function.

    Matt Humphreys did a couple articles on this – have a look at this and let us know if that does not do what you need.

    https://www.optuma.com/working-with-edfs-part1/

    Hope that helps

    Mathew

    #55509
    MathewMathew
    • Topics: 28
    • Replies: 1,229
    • Posts: 1,257

    The second part of his post covers the scripting with the fields.

    https://www.optuma.com/working-with-edfs-part-2/

    #55515
    AvatarRaeburne
    • Topics: 2
    • Replies: 4
    • Posts: 6

    Thanks everyone for your help, really appreciate the assistance.

    I’ll have a look and work through the articles Mathew has posted and see how I get on.

    Cheers

     

    #55527
    MatthewMatthew
    • Topics: 4
    • Replies: 216
    • Posts: 220

    Hi Raeburne,

    One additional note, if you have access to the current v1.5 beta, there is a new script function available called NEARESTALERT() which maybe of use to achieve the result you are after.

    If your buy price is setup in your Alerts you can now make reference to it in scripting.

    Here is an example using the Chart Element tool:

    AlertExample2

    You can see the Close is 1.31% away from the Alert line.  The script used for this was:

    For more information on this feature please refer to the following article: https://help.optuma.com/kb/faq.php?id=1104

Viewing 7 posts - 1 through 7 (of 7 total)
  • You must be logged in to reply to this topic.

Pin It on Pinterest

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