Green or red Heikin-Ashi

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #132275 quote
    umebonumebon
    Participant
    Average

    How do I code to get info if last candle in Heikin-Ashi was red or green?

    #132277 quote
    robertogozzirobertogozzi
    Moderator
    Legend

    There you go:

    once xOpen = open
    xClose     = (open + close + high + low) / 4
    if barindex > 0 then
        xOpen  = (xOpen + xClose[1]) / 2
    endif
    xLow       = min(low,min(xClose,xOpen))
    xHigh      = max(high,max(xClose,xOpen))
    IsGreen    = xClose > xOpen
    IsRed      = xClose < xOpen
    umebon thanked this post
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

Green or red Heikin-Ashi


ProBuilder: Indicators & Custom Tools

New Reply
Author
author-avatar
umebon @umebon Participant
Summary

This topic contains 1 reply,
has 2 voices, and was last updated by robertogozzirobertogozzi
6 years, 4 months ago.

Topic Details
Forum: ProBuilder: Indicators & Custom Tools
Language: English
Started: 05/19/2020
Status: Active
Attachments: No files
ProRealCode ProRealCode
Loading...