error with Intradaybarindex and Highest

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #157640 quote
    Grantx
    Participant
    Average

    Why doesnt Highest allow me to use intradaybarindex as the bar count? It keeps throwing an error saying it needs a positive integer.

    Defparam DrawOnLastBarOnly = true
    //defparam calculateonlastbars = 1000
    
    nm = Intradaybarindex
    mx = Highest[nm](close)
    drawsegment(barindex[nm],mx,barindex,mx)
    drawsegment(barindex[nm],low,barindex,low)
    DRAWTEXT(intradaybarindex, barindex + 5, high, Dialog, Bold, 30) COLOURED(128,128,128)
    return
    #157641 quote
    robertogozzi
    Moderator
    Master

    No index can be lower than 1, so change line 4 to make sure it is at least 1:

    nm = max(1,Intradaybarindex)
    Grantx thanked this post
Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.

error with Intradaybarindex and Highest


ProBuilder: Indicators & Custom Tools

New Reply
Author
author-avatar
Grantx @grantx Participant
Summary

This topic contains 1 reply,
has 2 voices, and was last updated by robertogozzi
5 years, 1 month ago.

Topic Details
Forum: ProBuilder: Indicators & Custom Tools
Language: English
Started: 01/13/2021
Status: Active
Attachments: No files
Logo Logo
Loading...