CalulateOnLastBars

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #21609 quote
    user101
    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
    Nicolas
    Keymaster
    Master

    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.

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 Nicolas
9 years ago.

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