HIGHEST command for all visible bars

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #105963 quote
    tested4perfectiontested4perfection
    Participant
    Average

    Hi,

    I’m hopeful someone can assist me with this task that keeps giving me errors.

    I would like to find the highest value of the CCI[20](close) for all bars that are loaded minus 20 bars – so not to cause problems with the first 20 bars needed for the calculations.

    Some of the code I’ve tried:

    CCIindex = CCI[20](close)
    
    Bars = BarIndex - 20          //(Gives me the max bars minus the first 20 bars to not cause problems)
    
    MaxValue = HIGHEST[Bars](CCIindex)

     

    And this is where it fails. I get error Null.

     

    I’ve even tried a FOR / NEXT loop to count the bars in the loop and then use that number. But still – I can’t get it to work.

    If I manually put in the maximum bars minus 20 in the HIGHEST[Bars] command, then it works.

    What am I doing wrong? This should be a no brainer…

    Many thanks!

    #105969 quote
    VonasiVonasi
    Moderator
    Master

    tested4perfection – welcome to the forums. Please use the ‘Insert PRT Code’ button when posting code in future posts as it makes it far easier for others to read. I have tidied up your post for you. 🙂

    #105971 quote
    VonasiVonasi
    Moderator
    Master
    if barindex >= 20 then
    CCIindex = CCI[20](close) 
    MaxValue = max(Maxvalue, CCIindex)
    endif
    #105977 quote
    GraHalGraHal
    Participant
    Legend

    Above added to here

    Snippet Link Library

    Looks like others have added 6 to 8 links to the Library since I last entered a link … thank you to those folks! 🙂

    #105981 quote
    VonasiVonasi
    Moderator
    Master

    Looks like others have added 6 to 8 links to the Library since I last entered a link

    I thought that you’d done it but just didn’t tell anybody!

    #106213 quote
    NicolasNicolas
    Keymaster
    Legend

    I did, but maybe some others too! 🙂

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

Stuck on this ProBuilder code?

Describe what this topic is trying to build, in plain English, and ProRealAI writes the ProRealTime™ indicator, screener or system for you.

Available in 7 languages
Try ProRealAI

HIGHEST command for all visible bars


ProBuilder: Indicators & Custom Tools

New Reply
Summary

This topic contains 5 replies,
has 4 voices, and was last updated by NicolasNicolas
7 years, 1 month ago.

Topic Details
Forum: ProBuilder: Indicators & Custom Tools
Language: English
Started: 08/31/2019
Status: Active
Attachments: No files
ProRealCode ProRealCode
Loading...