Programming a Heiken-Ashi indicator

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #19536 quote
    conwol
    Participant
    New

    Hi all,

    I have been using heiken-ashi on higher time frames as a trend indicator for lower time frames with some success. I’d like to program an indicator for a higher time fram heiken-ashi (say 1 hour) that I can use for a lower time frame (say 5 mins). Does anyone have any idea of how this could be done?

    Great pipping to all in the new year.

    #19619 quote
    Nicolas
    Keymaster
    Master

    >> Please update your country flag in your profile. Thank you 🙂 <<

    I think we could do something to draw candlesticks of superior timeframe with the new instruction DRAWCANDLE, but this is only compatible with version 10.3. What version of prorealtime are you using?
    #19645 quote
    cfta
    Participant
    Senior
    Hi, I would love a piece of code like that too, in fact I have already been experimenting with the HA indicator which Elsborgtrading provided in my Grid orders thread. I modified the code slightly intending to run it on M1 showing the HA value of M5 but I doubt I got it right since there are a lot of blank candles but thought it might be useful 🙂
    //Heikin-Ashi
    xClose = (Open+High+Low+Close)/4
    if(barindex>2) then
    xOpen = (xOpen[5] + xClose[5])/2
    endif
    changeToGreencandle = xClose[5]>xOpen[5] AND xClose[5]<xOpen[5]
    ChangeToRedcandle = xClose[5]<xOpen[5] AND xClose[5]>xOpen[5]
    Greencandle=xclose>xopen
    redcandle=xclose<xopen
    If changeToGreencandle then
    Indicator1=1
    elsif greencandle then
    indicator1=0.5
    Else
    Indicator1=0
    Endif
    
    If ChangeToRedcandle then
    
    Indicator22=-1
    elsif redcandle then
    indicator22=-0.5
    Else
    Indicator22=0
    Endif
    Return indicator1 COLOURED(0,255,0) as "Buy", indicator22 COLOURED(255,0,0) as "Sell"
    
    Elsborgtrading thanked this post
Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.

Programming a Heiken-Ashi indicator


ProBuilder: Indicators & Custom Tools

New Reply
Author
author-avatar
conwol @conny_wollbrant Participant
Summary

This topic contains 2 replies,
has 3 voices, and was last updated by cfta
9 years, 1 month ago.

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