Indicator shall return value just on certain bars

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #38452 quote
    Despair
    Blocked
    Master

    I programmed this simple indicator to show buy/sell triggers after an inside bar. But i want this lines to show only for say 4 bars after the inside bar occurred. After this the lines shall disappear and the indicator shall not display anything until it detects the next inside bar.

    I hade this problem before that i want an indicator to stop returning a value but i do not know how. Setting the returned value to zero makes the lines disappear but distorts the whole chart (no good solution).

    if high<high[1] and low>low[1] and range[1]>=SignalBar*pipsize then
      triggerup=high+pipsize
      triggerdown=low-pipsize
    endif
    RETURN triggerup as "TriggerUp", triggerdown as "TriggerDown"
    #38465 quote
    Nicolas
    Keymaster
    Master

    Setting the returned value to zero should not distort the chart if you set your horizontal price scale to use price only (look into the price settings).

    Despair thanked this post
Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.

Indicator shall return value just on certain bars


ProBuilder: Indicators & Custom Tools

New Reply
Author
author-avatar
Despair @despair Blocked
Summary

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

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