Help with drawing daily lines

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #61116 quote
    Juan Salas
    Participant
    Master

    Hi all,

    I am trying to create a very basic indicator, to help me visualise a strategy. I would like that everyday horizontal lines will be drawn to visualise some parameters.

    I have been reading the instructions to draw and create indicators and I am missing something. Right now, I can just see lines from today, and I would like to see different lines for everyday’s values.

    I am attaching the indicator:

    // GRID20 Indicator
    // LevelZERO and Levels 1up/1down
    
    defparam drawonlastbaronly = true
     
    // GRID distance
    disgrid1 = 10
    disgrid2 = 30
    
    // Defining GRID levels
    IF time=010000 THEN
    levelZERO=close
    ENDIF
     
    level1up = levelZERO + disgrid1*pipsize
    level2up = levelZERO + disgrid2*pipsize
     
    level1down = levelZERO - disgrid1*pipsize
    level2down = levelZERO - disgrid2*pipsize
    
    //Drawing text and lines
    DRAWTEXT("level2UP",barindex-1,level2up,SansSerif,Bold,14)coloured(200,200,0)
    DRAWTEXT("level1UP",barindex-1,level1up,SansSerif,Bold,14)coloured(0,0,153)
    DRAWTEXT("levelZERO",barindex-1,levelZERO,SansSerif,Bold,14)coloured(200,153,0)
    DRAWTEXT("level1DOWN",barindex-1,level1down,SansSerif,Bold,14)coloured(0,0,153)
    DRAWTEXT("level2DOWN",barindex-1,level2down,SansSerif,Bold,14)coloured(200,200,0)
    
    
    DRAWHLINE(level2up) coloured(0,200,0)
    DRAWHLINE(level1up) coloured(0,0,150)
    DRAWHLINE(levelZERO)coloured(0,200,0)
    DRAWHLINE(level1down)coloured(0,0,150)
    DRAWHLINE(level2down) coloured(0,200,0)
    
    RETURN
    
    
    
    
     
    

    Thanks,

    Juan

    #61122 quote
    Leo
    Participant
    Veteran

    why draw on last bar only?

    then you should test the code exactly at 1:00am….

    ;p

    #61142 quote
    Juan Salas
    Participant
    Master

    Hi Leo,

    I don’t understand. If I change/remove/deactivate defparam drawonlastbaronly to false, as you can see in the attached screenshot I still got the same lines from today back in the past, plus the text multiplied by every single bar.

    What I want is everyday draw lines at 010000 for that day. It is suppose to be different lines everyday, but now I just got the lines from today all the way to the past.

    Thanks

    Juan

    #61148 quote
    Juan Salas
    Participant
    Master

    Hi all,

    I got it. It is solved. I have checked some of the indicators of the library and they show how to do it.

    Thanks anyway,

    Juan

    #61161 quote
    Leo
    Participant
    Veteran

    Can you please post it? then we all learn how to do it.

    thanks i a

    #61178 quote
    Juan Salas
    Participant
    Master

    Sure,

    Actually, I have copied it from one of your indicators.

    // GRID20 Indicator
    // LevelZERO and Levels 1up/1down
    
    defparam drawonlastbaronly = true
     
    // Distancia GRID
    disgrid1 = 10
    disgrid2 = 30
    
    // Determinición niveles GRID
    IF time=010000 THEN
    levelZERO=close
    ENDIF
     
    level1up = levelZERO + disgrid1*pipsize
    level2up = levelZERO + disgrid2*pipsize
     
    level1down = levelZERO - disgrid1*pipsize
    level2down = levelZERO - disgrid2*pipsize
    
    RETURN LevelZERO as "levelZERO", level1up as "level1up", level2up as "level2up", level1down as "level1down", level2down as "level2down"
    
    
    
    
     
    

    I just replaced the drawing lines. The command RETURN and the description of the parameters did it.

    Regards,

    Juan

    #61231 quote
    Leo
    Participant
    Veteran

    Hahaha, cool!

    nice, thanks for sharing

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

Help with drawing daily lines


ProBuilder: Indicators & Custom Tools

New Reply
Author
author-avatar
Juan Salas @juan-salas Participant
Summary

This topic contains 6 replies,
has 2 voices, and was last updated by Leo
8 years ago.

Topic Details
Forum: ProBuilder: Indicators & Custom Tools
Language: English
Started: 01/31/2018
Status: Active
Attachments: 2 files
Logo Logo
Loading...