Dollar Volume_Positive Integer needed?

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #140749 quote
    Monica Wall
    Participant
    New

    Hello,

    I am relatively new to scripting.  I recently discovered it and wanted to create a basic custom script.  I wanted a custom script to determine the Dollar Volume.  The dollar volume would be the volume times the price.  I wanted to take an average of the prices.  I was able to create the script, but it’s asking for a positive integer.  I thought that I found a related forum topic but it didn’t provide a suitable solution for this script: https://www.prorealcode.com/topic/screener-result-can-only-be-a-positive-integer/

    Please let me know what I would need to modify in order to add this indicator to my chart.  Your assistance would be greatly appreciated.  Thank you so much!

    hlc = DHigh (close) + DLow (close) + close
    hlc1 = ABS(hlc)
    hlc3 = hlc1 / 3
    tdv = hlc3 * volume
    RETURN tdv AS “Dollar Volume (avg $ * volume)”
    #140751 quote
    Monica Wall
    Participant
    New

    I am not sure of how to modify a post.  The rules indicate that I should Always use the ‘Insert PRT Code’ button when putting code in your posts.  Please let me know if I have done that.  If not, please advise as to where I should find the ‘Insert PRT Code’ button.  Thank you again.

    #140753 quote
    robertogozzi
    Moderator
    Master
    You didn’t (I will change it). You can see from the attached pic what button we are talking about.

    >> Please update your country flag in your profile. Thank you 🙂 <<

    x.jpg x.jpg
    #140756 quote
    robertogozzi
    Moderator
    Master
    DHigh(0), DHigh(1), etc...
    if you use CLOSE as an index:
    • you may end up using a too high value (in case it’s DAX, SP, etc…)
    • you will use a decimal value, which is not allowed (only integer); you should use ROUND() to make it integer
    #140775 quote
    Monica Wall
    Participant
    New
    Awesome, it worked! I also appreciate the button attachment pic.  I will update my flag.
Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.

Dollar Volume_Positive Integer needed?


ProBuilder: Indicators & Custom Tools

New Reply
Author
Summary

This topic contains 4 replies,
has 2 voices, and was last updated by Monica Wall
5 years, 6 months ago.

Topic Details
Forum: ProBuilder: Indicators & Custom Tools
Language: English
Started: 08/03/2020
Status: Active
Attachments: 1 files
Logo Logo
Loading...