Datafield Script Support

Optuma Forums Optuma Scripting Datafield Script Support

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
  • #55575
    • Topics: 44
    • Replies: 22
    • Posts: 66

    Hi guys – I am looking to search out companies which have been paying down their debt YoY.

    I don’t think my results are working as expected – how does this script look.  How does the period work [1] [2] how do you know if these are quarters or years:


    Debt = DATAFIELD(FEED=FD, FIELD=TotalDebt);

    Debt1 = Debt[1];

    Debt2 = Debt[2];

    DebtPaydown1yr = (( (Debt1-Debt2)/Debt2)*100);





    • Topics: 28
    • Replies: 1,447
    • Posts: 1,475

    Hi Mandeep,

    Firstly with the [1][2] question. It is whatever the base chart is unless you have “changed” the time frame. ie if you add this script to a Daily chart than [1] will be the previous day and [2] will be 2 days back.

    Remember that even if the DataField has Monthly data, it will still have a value for every day of the month if you add it to a daily chart.

    The way to get around that is to change the time frame. eg

    Debt = Month(DATAFIELD(FEED=FD, FIELD=TotalDebt));

    Another way you can do it is to use the Change() function. In there you can specify that you want to go back a year and it is smart enough to look at the dates to do that.

    Hope that helps


    • Topics: 44
    • Replies: 22
    • Posts: 66

    Thanks Mathew – on that basis I am using this:



    ((Debt – Debt[1]) / Debt[1] ) * 100


    But when I use on a ASX 200 watchlist the cells are all 0.  Is there an issue with this approach or maybe the data?

Viewing 3 posts - 1 through 3 (of 3 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.