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 • 282 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
JS
9 months ago
Trendilo
Trendilo
0
Indicators
Nicolas
10 months ago
Anthony2A Bjr, j ai des erreurs sur la ligne 69, 74, 78 et 80. sur drawcandle drawtext et endif. si ...
Lucas0000 Hello, Congratulations on this programming, it seems incredible to me, I am new to this but ...
plbourse Hello, I am trying to use this singal (in fact I have converted it to an indicateur giving B...
Nicolas
11 months ago
Maxime Baudin Well done Nicolas, creative!
Stenozar Hi Nicolas, please can you explain how to read/use this indicator? thanks!
FXtonio @RICOU en 1 minutes avec un filtre de tendance ZLSMA 200 et eventuellement un rsi 7 , 69% de...
JC_Bywan For people interested in the screener: https://www.prorealcode.com/topic/screener-buy-sell-m...
octum Gracias NJicolas. Las lineas 35 y 36 dan fallo. (¿Es adrede para iniciados?) Puedes co...
Nicolas Yes, Magic if the variable that contains the value of the line, you can test if it goes up o...
dadah1987 Bonjour Nicolas, merci pour cet indicateur. Utilisant pour l'instant la création simplifié p...
Nicolas Merci d'ouvrir un sujet sur le forum avec une description complète du système.
GustavoLoboOrenstein Is it possible to add histogram with only increasing bars?
Nicolas Je ne rencontre pas ce problème avec le NASDAQ par exemple, ce serait plus simple d'ouvrir u...
YvesRobert Bonjour Nicolas, en effet ca marche, je me suis trompé, j'ai bien tout le tracé. C'est parce...
oliTR Bonjour, les conditions longCond et shortCond ne contiennent-elles pas une condition qui s'a...
Jiacky
2 years ago
Kalman Filter
Kalman Filter
0
Indicators
Stenozar Hi Sever, how can I visualize the coloured areas?
Sever Hi Stenozar, You need to add the color zones yourself , just go to Add Color Zone To set ...
atlante hi nicolas this indicator have 2 wrong borderline and islalastbarupdate. thank you can you h...
Nicolas That'"s because you are not using PRT v11? Just remove lines 59 to 62
Kanamax Hi Roberto, sorry for my confusing previous posts (forget them). My request is very simple,...
robertogozzi Please start a new topic in ProOrder support.
robertogozzi There you go: myMagicTrend = CALL “Magic Trend custom”[20, 14, 1, 5] alpha = 105 b = 0...
johann8 exactly :) Thank you all for the help!
max_92 Ciao Roberto, ho scaricato l'indicatore e come ti avevano già scritto sopra anch'io vedo la ...
Xenotrax A première vue, sa à l'air d'être un indicateur très puissant sur de petites temporalités, j...
merri Bonjour Nicolas, Comment transformer cet indicateur en bot sur PRT ?
Nicolas Cela a déjà été fait, voir ce sujet: https://www.prorealcode.com/topic/strategia-con-lindica...
Nicolas change the last line with: return v coloured(r,g,b) style(line,2), v+band coloured(168,168,1...
Paolo.B Thanks ... works as i wanted.
Kanamax Bonjour Nicolas, comme Paolo.B je souhaiterais utiliser cette indicateur au sein d'un code. ...
zilliq Thanks @Nicolas. I tried to use it as Trend in a proorder system, but don't know why, it doe...
Suzu Yuk He is right. MT and mavgMT are not defined and causing errors.....
RakeshPoluri I have a question about the bands on the candles. Is it bollinger bands or something else?
Nicolas I think that's 2 Bollinger Bands

Top