Market Bias indicator coloured

Market Bias indicator coloured

This code represents a trading strategy which smooths the price data with exponential averages and Heikin Ashi methodology, and then provides a visual representation of bullish or bearish bias with the oscillator and colored candles.

Here is a breakdown of the code:

Variables HAlen and HAlen2 are set to 100. These variables represent the lookback periods for calculating the exponential averages for the original and smoothed Heikin Ashi candles respectively.

The Exponential Moving Averages (EMA) of the open, close, high, and low prices are calculated over the HAlen period. This is done with the ExponentialAverage[HAlen](Open/Close/High/Low) calls.

The HA close (HAClose) is calculated as an average of the open, high, low, and close prices. The HA open (HAOpen) is calculated as an average of the open and close prices from the previous period and the close price of the current period.

The HA high (HAHigh) and low (HALow) are determined by taking the maximum and minimum of the high, low, open, and close prices respectively.

An additional smoothing is then applied to the HA candle’s open, close, high, and low using ExponentialAverage[HAlen2](HAOpen/HAClose/HAHigh/HALow). The results are stored in O2, C2, H2, and L2 respectively.

HAAvg represents the average of the smoothed high and low of the Heikin Ashi candle.

OSCLen is set to 7, which represents the period for the oscillator.

The oscillator bias (OSCBias) is computed as the percentage difference between the smoothed close and open, and then smoothed again using an EMA over the OSCLen period to get OSCSmooth.

Depending on the value of OscBias relative to OscSmooth, the RGB (red, green, blue) color values are assigned for the candle drawing. The RGB values are used later to color the drawn candle.

A candle is drawn using the smoothed Heikin Ashi open, high, low, and close, and it is colored according to the determined RGB values.

Finally, the smoothed high and low of the Heikin Ashi candle and the average are returned as “BIAS High”, “BIAS Low”, and “BIAS Average” respectively.

Code converted from discussion in topic: https://www.prorealcode.com/topic/market-bias-indicator/

Share this

Risk disclosure:

No information on this site is investment advice or a solicitation to buy or sell any financial instrument. Past performance is not indicative of future results. Trading may expose you to risk of loss greater than your deposits and is only suitable for experienced investors who have sufficient financial means to bear such risk.

ProRealTime ITF files and other attachments : How to import ITF files into ProRealTime platform?

PRC is also on YouTube, subscribe to our channel for exclusive content and tutorials

  1. BriceE • 270 days ago #

    Bonjour Nicolas,
    Je suis a la recherche d’indicateurs pour me donner la meilleure indication possible de la tendance que devrait suivre actif travaille dans la journee. Que me proposeriez-vous?
    Merci par avance,
    Brice

avatar
Register or

Likes

avatar avatar avatar
Related users ' posts
kats Bonsoir, cet indicateur est vraiment très bien avec plusieurs possibilités en coloration . ...
roccafragius Thank you Ivan for your indicators, very very interesting!!!!
kats Bonsoir, Pensez vous pouvoir répondre à ma question posée ci dessus? Ce serait vraiment tr...
Gaspare Ciao Ivan si puo' inserire una strategia su questo indicatore per ottimizzare le variabil...
Iván
3 weeks ago
Iván Si lo descargas e importas en tu PRT verás que se han creado las variables para luego config...
WhyAskOZ Hi, Ivan As always you are doing great coding. The code works on my PRT, however the issu...
Iván You can delete in the last line (return) the configuration for color. Delete coloured(xx,xx,...
P. Marlowe Quite an impressive work, Iván. Extremely useful and accurate. Congratulations. Keep it up¡
lkiklkik i love it !!! thanks.
Stenozar Hi Ivan, can you translate from tradingviwe the EMA TREND METER INDICATOR? It couid be inte...
Iván Hi Yes I can. Please, create a new topic for that I will translate it.
Stenozar Hi Ivan, I've created a new topic about the indicator: https://www.prorealcode.com/topic/ema...
Doddge Hola Iván, ¿sería posible crear un screener que indique cuándo las velas coloreadas del indi...
RTR Ivan thank you for the pro-screener. I a trying to understand how to write the signals from ...
Iván Hi, Lines 62 and 63. These lines define buy and sell conditions.
Iván Hi You should delete from the indicator code all drawing functions and all variables not us...
Iván I've created a screener to show [longcondition or shortcondition]
Chrisinobi Hallo Ivan, Danke das ist Perfekt !! Kannst du bitte in der Screener-Bibliothek die itf. hoc...
MaoRai54 Thanks, now it's OK. in your first code at line 15-16 it's missing.
Madrosat Hello Ivan Did you try a strategy with this indicator
Iván Hi. No I didn't. This is a code translation requested by an user a few days ago.
Iván
2 months ago
cjr30 Simplemente modifica las lineas 19 y 21 por las siguientes: drawtext("▲",barindex,low-0.1*a...
groelandes Gracias!!
WhyAskOZ i copied the code into strategy and it gives error on line 21 and 23. it says " Line 1: ...
Iván
2 months ago
Madrosat Hello Ivan You have interesting topics on indicators , smart supertrend, optimised trend t...
Iván Hi! thanks. All of these codes are translations requested in the forum. I've on mind to back...
Raspete01 Buenos días Iván, estoy intentando llevar el código eliminando los colores y pasando un Back...
Iván
3 months ago
ARLEQUIN49 Hello Ivan, Would it be possible to convert the code of this QQE MOD indicator which accomp...
ARLEQUIN49 here is the code: //@version=4 //By Glaz, Modified // study("QQE MOD") RSI_Period = i...
Iván Hi, Yes I can translate it but please, create a new topic for it.
gidien
3 months ago
Cram13 Bonjour, qu'elles sont les valeurs des variables ? Avec mes remerciements Marc
gidien This indicator will not return any value. You can change the last line to : return ao...
gidien SMA1 = MovingAverage Length applied to the source candles (high , low, op...
Fgats quelques explications en Français ici : Some explanations in French here : https://www.p...
Nicolas Merci pour cette contribution, j'apprécie ! :)
Fgats Merci Nicolas pour ces encouragements et merci aussi pour le commentaire en Anglais accompa...
Bateson
5 months ago
Alai-n I really like it when you develop ideas around price movement! I am much less a fan of all t...
elcortijoverde Muy buen trabajo.Intuitivo y claro.Gracias por tu dedicación y aportación.
Nicolas Simple strategy with this indicator is available here: https://www.prorealcode.com/topic/ut-...
FXtonio Nicolas.... MERCI 1 millions de fois, cet indicateur gagne dans 75% des cas en scalping m1 ...
davy42 bonjour, à quel moment apparait le fleche, à l'ouverture ou la fermeture de la bougie? merci
Nicolas
9 months ago
B-Xtrender
B-Xtrender
8
Indicators
616248 Bonjour Nicolas, Peux tu nous expliquer le principe de fonctionnement ? Ou nous mettre un...
Nicolas Le lien vers l'article IFTA de l'auteur est dans le post déjà :)
P. Marlowe Very poweful indeed. It deserves close attention. I really appreciate very much IFTA backgro...
JS
9 months ago
Trendilo
Trendilo
0
Indicators

Top