Green or red Heikin-Ashi

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

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

    #132277 quote
    robertogozzi
    Moderator
    Master

    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.

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 robertogozzi
5 years, 9 months ago.

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