Heikin Ashi alert when colour changes

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #63382 quote
    giogee
    Participant
    New

    Hi Can anybody help me with writing some code. I want an alert when HA changes colour and the bar has closed on a 30 min time frame?

    Is it possible to have the alert only if say daily chart or weekly chart is also the same colour which will then reduce number alerts.

    Thank you

    Gio

    #63384 quote
    giogee
    Participant
    New

    I found this in the forum made some changes on the code, but it could written in Chinese

    //Heikin-Ashi
    xClose = (Open+High+Low+Close)/4
    if(barindex>2) then
    xOpen = (xOpen[30] + xClose[30])/2
    endif
    changeToGreencandle = xClose[30]>xOpen[30] AND xClose[30]<xOpen[30]
    ChangeToRedcandle = xClose[30]<xOpen[30] AND xClose[30]>xOpen[30]
    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"
Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.

Heikin Ashi alert when colour changes


ProBuilder: Indicators & Custom Tools

New Reply
Author
author-avatar
giogee @giogee Participant
Summary

This topic contains 1 reply,
has 1 voice, and was last updated by giogee
7 years, 11 months ago.

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