DEFPARAM + ONCE issue with Range

Viewing 1 post (of 1 total)
  • Author
    Posts
  • #65915 quote
    robertogozzi
    Moderator
    Master

    Try this on DAX, 1-hour chart (add this indicator to the price chart, not below it):

    Pips   = 60 * pipsize         //Show only candles > 60 pips
    Offset = 10 * pipsize         //Offset above high/below low where we want an arrow to be displayed
    IF Range >= Pips THEN
       IF close > open THEN
          DRAWARROWUP(barindex,low - (offset / pipsize)) COLOURED(50,205,50)
       ELSE
          DRAWARROWDOWN(barindex,high + (offset / pipsize)) COLOURED(255,0,0)
       ENDIF
    ENDIF
    RETURN

    now try this slightly modified version:

    DEFPARAM CalculateOnLastBars = 500
    ONCE Pips   = 60 * pipsize    //Show only candles > 60 pips
    ONCE Offset = 10 * pipsize    //Offset above high/below low where we want an arrow to be displayed
    IF Range >= Pips THEN
       IF close > open THEN
          DRAWARROWUP(barindex,low - (offset / pipsize)) COLOURED(50,205,50)
       ELSE
          DRAWARROWDOWN(barindex,high + (offset / pipsize)) COLOURED(255,0,0)
       ENDIF
    ENDIF
    RETURN

    The latter one will show incorrect arrows due to a known bug with Range + DEFPARAM + ONCE.

    After many months this bug is still there, will the new version address it?

    Thank you.

Viewing 1 post (of 1 total)
  • You must be logged in to reply to this topic.

DEFPARAM + ONCE issue with Range


Platform Support: Charts, Data & Broker Setup

New Reply
Author
Summary

This topic contains 1 voice and has 0 replies.

Topic Details
Forum: Platform Support: Charts, Data & Broker Setup
Language: English
Started: 03/21/2018
Status: Active
Attachments: No files
Logo Logo
Loading...