Heikin Ashi alert when colour changes

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #63382 quote
    giogeegiogee
    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
    giogeegiogee
    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.
ProRealAI ProRealAI New

Stuck on this ProBuilder code?

Describe what this topic is trying to build, in plain English, and ProRealAI writes the ProRealTime™ indicator, screener or system for you.

Available in 7 languages
Try ProRealAI

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 giogeegiogee
8 years, 7 months ago.

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