CalulateOnLastBars

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #21609 quote
    user101user101
    Participant
    New

    Hi

    I’d like to use functionality similar to DEFPARAM CALCULATEONLASTBARS in an indicator.  I want to be able to pass it a variable though (not hardcode a set number of bars to load).  I can’t find any way to do this though.  Alternatively is there a way to replicate this functionality within the indicator?   The indicator may be used on multiple different timeframes, so it is difficult to limit the calculation purely on date/time.

    Thank you

    #21658 quote
    NicolasNicolas
    Keymaster
    Legend

    No variable can be used with any of the DEFPARAM instruction, I’m sorry.

    About your second question, you could use a DRAWONLASTBARONLY and then make a loop from there to calculate and display your indicator within the last X bars defined in the loop. A bit tricky if your indicator has already one or more FOR/NEXT loop built-in, but it could work as intended.

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

CalulateOnLastBars


ProBuilder: Indicators & Custom Tools

New Reply
Author
author-avatar
user101 @user101 Participant
Summary

This topic contains 1 reply,
has 2 voices, and was last updated by NicolasNicolas
9 years, 8 months ago.

Topic Details
Forum: ProBuilder: Indicators & Custom Tools
Language: English
Started: 01/18/2017
Status: Active
Attachments: No files
ProRealCode ProRealCode
Loading...