Coloured Harami

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #52236 quote
    Marcel van Vliet
    Participant
    Veteran

    Hi, I am trying to build an indicator which paint all the candles of the specified setup in black (for this example the Harami setup) The code below is accepted by the platform, but does not seems to work. Has anybody a suggestion or want to help me to develop this indicator?

    //Coloured Harami by Marcel van Vliet
    //Version 1.5
    //Date 05-10-2017
    
    trendup =ExponentialAverage[50]>Average[200] AND High[1]>ExponentialAverage[50]
    
    harami = (High>High[1] and Low>Low[1]and Open>Open[1] and Close<Close[1])
    If trendup and harami then
    r = 0
    g = 0
    b = 0
    endif
    
    RETURN harami coloured(r,g,b)
    #52239 quote
    Despair
    Blocked
    Master

    You are just plotting the value of the variable harami as a line. There is no code for painting a candle in a special colour.

    #52265 quote
    Marcel van Vliet
    Participant
    Veteran

    @Despair,

    Thank you for your quick response. Can you provide me with an example for painting a candle in a special colour and where to put this line(s) into the code? This would help me a lot……

    #52357 quote
    Despair
    Blocked
    Master

    I never did this myself. The help function says (always a good place to look!) that there is a command called DRAWCANDLE. That is what you want to use. Than is you definition of a mahatma strange.

    trendup =ExponentialAverage[50]>Average[200] AND High[1]>ExponentialAverage[50]
     
    if open[1]<close[1] then
      harami =high<close[1] and low>open[1]
    elsif open[1]>close[1] then
      harami=high<open[1] and low>close[1]
    else
      harami=0
    endif 
    If trendup and harami then
      drawcandle(open, high,low,close) colored (0,0,0)
    endif
    RETURN
    Marcel van Vliet and Nicolas thanked this post
Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.

Coloured Harami


ProBuilder: Indicators & Custom Tools

New Reply
Author
Summary

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

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