how to draw an object above or below a candle

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #39962 quote
    revdna
    Participant
    New

    I want to draw an up-arrow below the price bar when MACD crosses above the signal line and above the zero line. Please kindly help me with this as I am not very familiar with the programming code and search through the guides to no avail.

    Many thanks in advance.

    #39963 quote
    GraHal
    Participant
    Master

    Is below any help or a start anyway?

    https://www.prorealcode.com/documentation/drawarrow/

    #40008 quote
    revdna
    Participant
    New

    Hi GraHal,

    Thanks for the update. But I have some issues defining the conditions.

    if C>D and D>=C and D>E, how do I define this condition and get the program to draw an arrow above or below the bar?

    Many thanks for your prompt reply and help.

    Regards, Derick.

    #40060 quote
    GraHal
    Participant
    Master

    Hi Derick

    I’ve never coded DrawArrow, so I doubt below is fully correct and / or correct syntax, but something like below.

    The gist of below is … if conditions are met then Draw Arrow (as per the link in #39963)

     

    If C>D and D>=C and D>E Then
      DRAWARROW(barindex, close) COLOURED(0,100,255,255)
    endif

    Let us know how you get on?

    Cheers
    GraHal

    #40095 quote
    revdna
    Participant
    New

    Hi GraHal,

    Tried the above as per suggested, it does not work. 🙁

    I think there should be some syntax error some where.

    Regards, Derick.

    #40103 quote
    AVT
    Participant
    Senior

    Here is an example:

    // --- 1. possibility: variable holding the condition and test the variable
    //     advantage: simple change condition in variable
    //     disadvantage: one variable more
    //Popgun=(high[0]>high[1] AND low[0]<low[1] AND high[1]<high[2] AND low[1]>low[2])
    //IF Popgun THEN
    
    // --- 2. possibility: put the complete condition into ( )
    //     advantage: one variable less
    //     disadvantage: long search through code if you need changes
    IF ( high[0]>high[1] AND low[0]<low[1] AND high[1]<high[2] AND low[1]>low[2] ) THEN
    DRAWARROW(barindex,low) COLOURED(255,0,0) // right pointing arrow at low of candle
    DRAWARROWUP(barindex,low-5) COLOURED(0,0,255) // up pointing arrow a bit below the low of candle
    DRAWARROWDOWN(barindex,high+5) COLOURED(0,0,255) // down pointing arrow a bit above the high of candle
    ENDIF
    
    Return

    If you don’t see any arrows made by your code, think of the chance that your conditions are simple not met to be true.

    Hope it helps.

    Nicolas thanked this post
    #40116 quote
    GraHal
    Participant
    Master

    Hi Derick

    Use GRAPH to see if / when your conditions are being met (as AVT says).

    Also my code (incorrectly) shows a space before the close … is that giving you the syntax error?

    Also my colour has 4 shades, so try 3 and make sure it not same colour as your background else you not see the Arrow!? 🙂

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

how to draw an object above or below a candle


ProBuilder support

New Reply
Author
author-avatar
revdna @revdna Participant
Summary

This topic contains 6 replies,
has 3 voices, and was last updated by GraHal
8 years, 6 months ago.

Topic Details
Forum: ProBuilder support
Language: English
Started: 07/06/2017
Status: Active
Attachments: No files
Logo Logo
Loading...